A Course can be in many Programs, but each Program has only one Course: a one-to-many relationship from Course to Program.
ER diagram
+------------------+ 1 : N +-----------------+
| COURSE |---------< has >--------| PROGRAM |
| c_id (PK) | (1) (N) | prog_no (PK) |
| c_name | | prog_name |
| total_credit | | |
+------------------+ +-----------------+
Relational schema
- Course (c_id PRIMARY KEY, c_name, total_credit)
- Program (prog_no PRIMARY KEY, prog_name, c_id NOT NULL, FOREIGN KEY (c_id) REFERENCES Course(c_id))
The foreign key goes on the “many” side: each Program row names its single Course, and one Course can be referenced by many Programs.
— rhs