Logical Database Design
Logical Database Design
Lecture 29
Logical Database Design
(Relational Model)
Objectives of logical design...
Data structure
Data organized into tables with rows and columns
Data manipulation
Add, delete, modify, and retrieve using SQL
Data integrity
Maintained using business rules
Primary Key
Foreign Key
(implements 1:N relationship
between customer and order)
Domain Constraints
Allowable values for an attribute.
Entity Integrity
No primary key attribute may be null. All primary key fields MUST have data
Referential Integrity
Either each foreign key value must match a primary key value in another relation or the
foreign key value must be null.
Referential
integrity
constraints are
drawn via arrows
from dependent to
parent table
(b)
Foreign key
One-to-Many
Primary key on the one side becomes a foreign key on the many side
Many-to-Many
Create a new relation with the primary keys of the two entities as its primary key
One-to-One
Primary key on the mandatory side becomes a foreign key on the optional side
(b) EMPLOYEE
relation with
recursive foreign key
Associative entity
has foreign keys to
each entity in the
relationship