SQL Homework Create a single script to do all of the following. Be sure to create in such a way that it can be re-run multiple times. Create a database named homework. In this database, create three tables: Student, Course, StudentCourse - Create the Student table with the following fields in this order: studentID as an integer; do not allow empty values firstName as a variable number of characters, max 30, with a null default value lastName as a variable number of characters, max 30, with a null default value address as a variable number of characters, max 30, with a null default value Use the studentID as the primary key for this table - populate this table with the following values, respectively: 1001, John, Brown, 123 Anystreet, OH 1002, Paul, Black, 23 Someplace Ct., IL 1003, George, Green, 1020 Langley Lane, TN 1004, Betty, Brown, 36250 Aims Ln, NY - Create the Course table with the following fields in this order: courseID as an integer; do not allow empty values courseName as a variable number of characters, max 30; do not allow empty values Use the courseID as the primary key for this table - populate this table with the following values, respectively: 1, Basket Weaving 2, The Writings of C. S. Lewis 3, Database Design 4, Computer Programming - Create the StudentCourse table with the following fields in this order: studentID as an integer; do not allow empty values courseID as an integer; do not allow empty values Use both fields as the primary key for this table Indicate each field as a foreign key, courseID as referencing the matching primary key in the Course table, and studentID as referencing the matching primary key in the Student table - populate this table with the following values, matched to courseID and studentID, respectively: 2, 1001 2, 1003 3, 1001 4, 1001 4, 1002 Execute the following queries: SQL Homework 1) Display all records for each of the three tables, Course, StSQL Homework 1) Display all records for each of the three tables, Course, Student, and StudentCourse. 2) Display all courses with enrollment and the enrolled students in each, ordered by course ID Display course name as "Course Name", student first name as "First Name", and last name as "Last Name" 3) Display all courses with enrollment and the enrolled students in each, ordered by course name Display course name as "Course Name", student first name as "First Name", and last name as "Last Name" 4) Display all enrolled students and the courses in which each is enrolled, ordered by student ID Display course name as "Course Name", student first name as "First Name", and last name as "Last Name" 5) Display all enrolled students and the courses in which each is enrolled, ordered by student last and first names Display course name as "Course Name", student first name as "First Name", and last name as "Last Name" Course P K courseID courseName Student P K studentID firstName address StudentEnroll
SQL Homework Create a single script to do all of the following. Be sure to create...
For this assignment, you should create an Entity Relationship Diagram (ERD) in Visio that shows a many-to-many relationship between DeVry University students and their classes. Since one student can have many classes and each class can have many students, you will need to create an associative entity to store the specific Student_Class data such as grade and attendance. Create the tables as well as the relationships. Don't forget to indicate the Primary Key and Foreign Key in each table. Tables...
Problem 1-5 using the table below in the picture to be
answered in Microsoft SQL. Thanks
4. Write SQL queries to answer the following questions, a. How many students were enrolled in secoon 14 b. How many students were enrolled in ISM 3113 5. Write an SOL query to answer the following question Which students were not enrolled in any courses on Problems and Exercises 6 through 14 are based on Figure 7-15. The problem set continues from Chapter 6,...
Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there are no class _descriptions display 'No description is available yet'. (USE NVL) 2 Give a listing of only the lname and the class_code for students who are taking 'Introduction to C programming'. (Inner join) 3 Give a lising of all the class_descriptions and the number...
Create a new database and execute the code below in SQL Server’s query window to create the database tables. CREATE TABLE PhysicianSpecialties (SpecialtyID integer, SpecialtyName varchar(50), CONSTRAINT PK_PhysicianSpecialties PRIMARY KEY (SpecialtyID)) go CREATE TABLE ZipCodes (ZipCode varchar(10), City varchar(50), State varchar(2), CONSTRAINT PK_ZipCodes PRIMARY KEY (ZipCode)) go CREATE TABLE PhysicianPractices (PracticeID integer, PracticeName varchar(50), Address_Line1 varchar(50), Address_Line2 varchar(50), ZipCode varchar(10), Phone varchar(14), Fax varchar(14), WebsiteURL varchar(50), CONSTRAINT PK_PhysicianPractices PRIMARY KEY (PracticeID), CONSTRAINT FK_PhysicianPractices_ZipCodes FOREIGN KEY (ZipCode) REFERENCES Zipcodes) go CREATE...
Use the SQL statements provided to create your tables. Write one
SQL statement for each of the following problems. You can only use
the conditions listed in the tasks. E.g., in task 1, you cannot
manually look up pid of Information Systems undergraduate
program.
Here is the given code:
drop table textbook_schedule cascade constraints;
drop table textbook_author cascade constraints;
drop table schedule cascade constraints;
drop table course cascade constraints;
drop table textbook cascade constraints;
drop table author cascade constraints;
drop...
Create an ER Diagram showing all entities and relationships that describe the scenario below: You are commissioned to design a database to keep records of a small college. You talked with various key members of this community and obtained the following information: The college keeps information about students and student performance. Every student is known by her/his first name, initials and last name. They are also identified by a unique StudentID provided by the University. Every student also belongs to...
Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that begins with the letter 'M! CREATE TABLE Persons Personi int LastName varchar(80). FirstName varchar(80). Address varchar(125). State char(2) Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that does not contain the letter 'S: CREATE TABLE Persons PersonlDint,...
Given (Oracle) SQL Script " CREATE TABLE Members( MemberID NUMBER(4) NOT NULL PRIMARY KEY, MFirst VARCHAR(25) NOT NULL, MLast VARCHAR(25) NOT NULL, Street VARCHAR(64) NOT NULL, City VARCHAR(25) NOT NULL, State VARCHAR(2) NOT NULL, ZipCode NUMBER(5) NOT NULL, CreditLimit NUMBER(7,2) NOT NULL, Gender VARCHAR(1) NOT NULL CHECK (Gender IN('F','M')) ); CREATE TABLE Employees( EmployeeID NUMBER(3) NOT NULL PRIMARY KEY, EFirst VARCHAR(25) NOT NULL, ELast VARCHAR(25) NOT NULL, ...
DO NOT COPY AND PASTED!!!!!!!!!!!!! IF YOU DO NOT HOW TO DO IT, JUST DO NOT ANSWER MY QUESTIONS package scheduler; import java.util.List; public class Scheduler { /** * Instantiates a new, empty scheduler. */ public Scheduler() { } /** * Adds a course to the scheduler. * * @param course the course to be added */ public void addCourse(Course course) { } /** * Returns the list of courses that this scheduler knows about. * * This returned object...
Question 1 (24 Marks] 1. (4 marks) Write an immutable Person class in Java which provides the following. • Two attributes: lastName and first Name of type String. • Appropriate initialization, accessors/mutator methods. 2. (6 marks) Write a Student class that is a subclass of Person class (in the previous question) which provides the following. • Two attributes: A unique student ID of type String and GPA of type float; the student ID is initialized when a Student object gets...