|
|
|
We will illustrate the Entity-Relationship model design technique using an example next....
NOTE: in real life, these information are gathered by interviewing the users of the database.
|
|
|
|
|
|
Department( DName, DNumber, Managed-by(Employee, StartDate), {Locations}, Controls({Projects}) ) Project(PName, PNumber, Location) Employee(SSN, Name, Addr, Sal, Sex, BDate, Works-for(Department), Works-on({Proj, #hours}), Supervised-by(Employee), Cares-for({Dependent})) Dependent(FName, Sex, BDate, RelationToEmp) (Underlined attributes are key attributes) |
|
Department( DName, DNumber, Managed-by(Employee, StartDate), {Locations}, Controls({Projects}) ) Project(PName, PNumber, Location) Employee(SSN, Name, Addr, Sal, Sex, BDate, Works-for(Department), Works-on({Proj, #hours}), Supervised-by(Employee), Cares-for({Dependent})) Dependent(FName, Sex, BDate, RelationToEmp) // Note: no key attribute !! (Underlined attributes are key attributes) |
|
|
|
|
|
|
Such "attributes" are not really attributes, but they are in fact:
|