CP363 Lecture Notes - Lecture 18: Foreign Key, Ename, Unique Key
Document Summary
The grouping of attributes to form good relation schemas. Design is concerned mainly with base relations. Semantics of the relational attributes must be clear. Guideline 1: informally, each tuple in a relation should represent one entity or relationship instance (applies to individual relations and their attributes) Attributes of different entities (employees, departments, projects) should not be mixed in the same relation. Only foreign keys should be used to refer to other entities. Entity and relationship attributes should be kept apart as much as possible. Bottom line: design a schema that can be explained easily relation by relation. The semantics of attributes should be easy to interpret. Semantics of a tuple: what does a tuple of this table mean. Project: pnumber is unique, dnum is a foreign key into department, etc. Works_on: models many to many relationship between employee and project tables (entities) Anomalies: cause certain issues in correctness of data.