■Let K⊆R, R set of attributes of a relation schema
■K is a super key of R if values for K are sufficient to identify a unique
tuple of each possible relationr(R)
●Example: {ID} and {ID,name} are both superkeys ofinstructor.■Super key K is a candidate key if K is minimalExample: {ID} is a candidate key forInstructor
■One of the candidate keys is selected to be the primary key.
●which one? - Generally Primary Key is chosen such as its attributes are never or very rarely changed.
■Foreign keyconstraint: Value in one relation must appear in another
R1 may include Primary key of R2
Foreign key from R1 to R2
●Referencing relation R1
●Referenced relation R2
Foreign key constraint or the Referential integrity constraint requires that the values of the specified attributes in the referencing relation must also appear in the specifed attributes of at least one tuple of the referenced relation.