3 Relational Database Model
3 Relational Database Model
• Domain constraints – Each value of the attribute of the tuple must be atomic and single valued within its
domain.
• Key constraint - When there are candidate keys only one of them is declared as primary key and underlined
and other key attributes are declared with unique property.
• Entity integrity constraint specifies that primary key must be defined and the value cannot be null.
REFERENTIAL INTEGRITY
employer worker head 1
DEPARTMENT 1 WORKS N EMPLOYEE EMPLOYEE
_IN
SUPERVIS
ES
employee N
EMPLOYEE
Employee_ID Department Area Designation Field_Supervisor
EE001 EIE Software Lecturer NULL
1 MANA 1 EMPLOYEE
EE002 EIE Communication Senior Lecturer EE001 DEPARTMENT
GES
MM007 MME Automobile Lecturer NULL
DEPARTMENT
MM001 MME Manufacturing Senior Lecturer MM007 Dept_ID Head Location Accreditation
CE001 CEE Hydraulic Senior Lecturer NULL
ElE EE001 Sector B Yes
CE003 CEE Structural Lecturer CE001
MME MM007 Sector A Yes
CE007 CEE Environment Lecturer CE001
CEE CE001 Sector C Yes
EE005 EIE Electronics Lecturer EE001
• Referential integrity states that tuple from the referencing relation must refer to an existing tuple in the
referenced relation or be null.
• The referencing attribute is called foreign key and it refers to a primary key in other relation.
• This facilitates to maintain the concept of relationships in ER model.
• Indicated using a dashed arrow from foreign key to the primary key.