Question

Given the following relational database schema: Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber,...

Given the following relational database schema: Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title, NumberUnits) Section = ( CourseNumber, Quarter, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00PM. Enrollment = (SSN,CourseNumber, Quarter, Grade)// Grade is either Null or a letter grade.

I'm looking for the DLL statements to make the tables above in SQL

Homework Answers

Answer #1

Create Table Student (

SSN varchar(12) NOT NULL,

Name varchar(50) NOT NULL,

Major varchar(30) NOT NULL,

Primary Key(SSN)

) ;

Create Table Course(

CourseNumber int NOT NULL,

PrerequisiteCourseNumber int NOT NULL,

CourseTitle varchar(50) NOT NULL,

NumberUnits int NOT NULL,

Primary Key(CourseNumber)

);

Create Table Section (

CourseNumber int NOT NULL,

Quarter int NOT NULL,

RoomNumber int NOT NULL,

DayTime TimeDate NOT NULL,

Primary Key(CourseNumber, Quarter,RoomNumber),

Foreign Key(CourseNumber) References Course(CourseNumber)

);

Create Table Enrollment (

SSN varchar(12) NOT NULL,

CourseNumber int NOT NULL,

Quarter int NOT NULL,

Grade char(1) ,

Primary Key(SSN,CourseNumber,Quarter),

Foreign Key(SSN) References Student(SSN),

Foreign Key(CourseNumber) References Course(CourseNumber)

);

Do ask if any doubt. Please up-vote.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
14.19. Suppose that we have the following requirements for a university database that is used to...
14.19. Suppose that we have the following requirements for a university database that is used to keep track of students’ transcripts: a. The university keeps track of each student’s name (Sname), student number (Snum), Social Security number (Ssn), current address (Sc_addr) and phone (Sc_phone), permanent address (Sp_addr) and phone (Sp_phone), birth date (Bdate), sex (Sex), class (Class) (‘freshman’, ‘sophomore’, … , ‘graduate’), major department (Major_code), minor department (Minor_code) (if any), and degree program (Prog) (‘b.a.’, ‘b.s.’, … , ‘ph.d.’). Both...
Consider the following relational database:               STUDENT     (STDNO, SNAME, DEPTNO#)             &n
Consider the following relational database:               STUDENT     (STDNO, SNAME, DEPTNO#)               DEP                 (DEPTNO, DNAME)               COURSE        (CORSNO, CNAME, DEPTNO#, CMAX)               ENROLMENT       (STDNO#, CORSNO#, GRADE, EDATE) STUDENT.DEPTNO is the department number of the student. COURSE.DEPTNO is the department number that offers the course. ENROLMENT models the registrations of students in courses (M:M relationship) where the GRADE is the grade obtained by the student in the course. PART I : DATA DESCRIPTION LANGUAGE (DDL) Write DDL commands to create the four...
Consider the following relational schema about a University (the primary keys are underlined and foreign keys...
Consider the following relational schema about a University (the primary keys are underlined and foreign keys are italic) STUDENT(StudentID, name, major, year, age) CLASS(ClassName, meetsAt, room, LecturerID) ENROLLED(StudentID, ClassName, mark) LECTURER(LecturerID, name, DepartmentID) DEPARTMENT(DepartmentID, name) Write the SQL statements for the following query: B1. Find the age of the oldest student. B2. Find the ID’s of lecturers whose name begins with “K” B3. Find the age of the youngest student who is enrolled in Mechatronics. B4. Find the age of...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students’ transcripts. This is similar but not identical to the database shown in Figure 1.2: a. The university keeps track of each student’s name, student number, Social Security number, current address and phone number, permanent address and phone number, birth date, sex, class (freshman, sophomore, ..., graduate), major department, minor department (if any), and degree program (B.A., B.S., ..., Ph.D.). Some user applications...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
MySQL I have the following tables: Students(sid,first_name,last_name,birthday,major,zipcode) Students_Courses(sid,cid,year,semester,grade) Courses(cid,name,credits) use Students_Courses table to find the student...
MySQL I have the following tables: Students(sid,first_name,last_name,birthday,major,zipcode) Students_Courses(sid,cid,year,semester,grade) Courses(cid,name,credits) use Students_Courses table to find the student sid and course cid for whom took the same course more than one time. can you help me with my query select first_name,last_name,name from Students s, Courses c where s.sid,c.cid,ct in ( select sid,cid,count(*) from Students_Courses group by sid,cid having count(*) > 1);
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT