Logical Database Design: Translating Unary and Ternary Relationships
Logical Database Design: Translating Unary and Ternary Relationships
Logical Database Design: Translating Unary and Ternary Relationships
MANAGES
EMPLOYEE
COMPONENT
ITEM
Quantity
PRE-REQUISITE
COURSE
CourseName
Units
EMPLOYEE PROJECT
ASSIGNMENT
EMPLOYEE(EmployeeID,Name)
SKILL(SkillCode, Description)
PROJECT(ProjectID,Description,BillingRate)
ASSIGNMENT(EmployeeID,SkillCode,ProjectID)
Access Implementation of Ternary:
(empprojternary.mdb)
Ternary versus Binary Relationships
PROJECT_SKILLS
EMPLOYEE(EmployeeID,Name)
SKILL(SkillCode, Description)
PROJECT(ProjectID,Description,BillingRate)
ASSIGNED_TO(EmployeeID,ProjectID)
ATTAINS(EmployeeID,SkillCode)
PROJECT_SKILL(ProjectID,SkillCode)
Access Implementation of Three
Binaries: (empprojbinary.mdb)
Sample Data for Three Binaries:
(empprojbinary.mdb)
Relationship Data for Three Binaries:
(empprojbinary.mdb)
EmployeeProjects Query: (empprojbinary.mdb)
The EmployeeProjects
query provides
information about
(1) Which projects a
particular employee
is working on
(2) Which employees are
working on a
particular project
We see that a particular employee can work
on many projects (for example,
employee1 works on project1 and
project2) and that a particular project
can have many employees working on
it (for example, project1 has employee1
and employee3 working on it).
EmployeeSkills Query: (empprojbinary.mdb)
But ……………..
We get output that indicates that an employee uses all of his/her skills on
any project he/she is involved with. For example, employee3 has three
skills (Java, Visual Basic, and Access); employee3 works on project1
and project3; the output indicates that employee3 uses all three skills
on both of those projects. If you were to add a fourth skill to employee3,
that fourth skill would show up for any project employee3 is involved
with. With the binary design, there is no way to indicate that employee3
uses Java on project1 and uses Access and Visual Basic on project3.
Sample Data for the Ternary Design:
(empprojternary.mdb)
Relationship Data for the Ternary Design:
(empprojternary.mdb)