Scenario : 2
Create the Following Tables with suitable Primary keys , Foregin keys and identify the order of tables ?
Dept Table : id, name
Course Table : id, name, dept, other_info
Teacher Table : id, fname, lname, phone
Section Table : id, course, teacher_id, capacity
Student Table : id, fname, lname, dob, phone
Student_section Table : id, studid, sectionid
Dept Table:
- id (Primary Key)
- name
- id (Primary Key)
- fname
- lname
- phone
- id (Primary Key)
- name
- dept (Foreign Key referencing Dept Table)
- other_info
- id (Primary Key)
- course (Foreign Key referencing Course Table)
- teacher_id (Foreign Key referencing Teacher Table)
- capacity
- id (Primary Key)
- fname
- lname
- dob
- phone
- id (Primary Key)
- studid (Foreign Key referencing Student Table)
- sectionid (Foreign Key referencing Section Table)
- Dept Table : No other table depends on it, so it comes first.
- Teacher Table : No other table depends on it.
- Course Table : Depends on Dept Table as well as Teacher Table.
- Section Table : Depends on Course Table and Teacher Table.
- Student Table : No other table depends on it.
- Student_section Table: Depends on both Student Table and Section Table.
Comments
Post a Comment