CISC 332 Lecture Notes - Lecture 4: Referential Integrity, Unique Key, Relational Model
Document Summary
Primary key the candidate key that"s chosen to represent the tuples o o. Have foresight just because an attribute is unique at the moment, doesn"t mean it will always be unique when you add data. Ex a last name in a class may be unique at one point, but if someone adds the class, they may have a duplicate last name. A better option would be student number, as this doesn"t have duplicates. Also: make sure, it will never be null (ex a sin number non-citizens may not have one) Shouldn"t be able to change to change a primary key, you have to delete and re- add the tuple. Constraint value in one relation must appear in another i. e. keys that link two tables example of a referential integrity constraint foreign key always refers to the primary key of another relation o. Ex: teaches has 4 foreign keys that relate to the section relation because section has 4 primary keys.