Relational Model
Relational Model
instance
Keys
• Let K R
• K is a superkey of R if values for K are sufficient to identify a unique tuple of each
possible relation r(R)
– Example: {ID} and {ID,name} are both superkeys of instructor.
• Superkey K is a candidate key if K is minimal
Example: {ID} is a candidate key for Instructor
• One of the candidate keys is selected to be the primary key.
– Which one?
• Foreign key constraint: Value in one relation must appear in another
– Referencing relation
– Referenced relation
– Example: dept_name in instructor is a foreign key from instructor referencing
department
Univerity database