One-to-many relation can be implemented by using two tables.. in two ways :
e.g we have a Department table and a Student Table
1. Department :
DeptID -> Primary Key
DeptName
DeptHead
Student :
StudentID -> Primary Key
StudentName
DeptID -> Foreign Key
2. Department :
DeptID -> Primary Key
DeptName
DeptHead
Student :
StudentID -> Composite Primary Key - 1
StudentName
DeptID -> Composite Primary Key - 2
No comments:
Post a Comment