database design
1. PRACTICE
Course and Class (1:M relationship)
Each course may form 1 or more classes
Each class must have at only one course.
Class and Student (M:N relationship)
Each class must have one or more students
Each student must enroll in one or more classes
Enroll is the bridge entity after the many to many decomposition
To demonstrate your understanding of PRIMARY KEYs and FOREIGN KEYS enter sample data in the tables below. (refer the ERD to understand the relationship between the entities)
TABLE COURSE:
|
CRS_CODE (PK) |
DEPT_CODE |
CRS_DESCRIPTION |
CRS_CREDIT |
|
C1 |
ENG |
|
|
|
C2 |
MATH |
|
|
|
C3 |
CS |
|
|
TABLE CLASS:
|
CLASS_CODE(PK) |
CRS_CODE (FK) |
CLASS_SECTION |
CLASS_TIME |
CLASS_ROOM |
PROF_NUM |
|
CL1 |
C2 |
SEC1 |
|
|
|
|
CL2 |
C2 |
SEC2 |
|
|
|
|
CL3 |
C3 |
SEC1 |
|
|
|
|
CL4 |
C3 |
SEC2 |
|
|
|
|
CL5 |
C3 |
SEC3 |
|
|
|
TABLE ENROLL: (COMPOSITE Pk)
|
CLASS_CODE(PK) |
STU_NUM(PK) |
ENROLL_GRADE |
|
CL1 |
S1 |
|
|
CL1 |
S2 |
|
|
CL1 |
S3 |
|
|
CL2 |
S3 |
|
|
CL3 |
S3 |
|
|
|
|
|
|
|
|
|
TABLE STUDENT:
|
STU_NUM(PK) |
LNAME |
FNAME |
INIT |
DOB |
PHONE |
|
S1 |
|
|
|
|
|
|
S2 |
|
|
|
|
|
|
S3 |
|
|
|
|
|
|
S4 |
|
|
|
|
|
|
S5 |
|
|
|
|
|
|
S6 |
|
|
|
|
|
|
S7 |
|
|
|
|
|
2. Region and Store (1:M relationship)
Store and Employee (1:N relationship)
Job and Employee (1:N relationship)
To demonstrate your understanding of PRIMARY KEYs and FOREIGN KEYS enter sample data in the tables Region, Store, Employee and Job. (refer the ERD to understand the relationship between the entities)