CH 14 A
CH 14 A
CH 14 A
Relational database design: The grouping of attributes to form "good" relation schemas Two levels of relation schemas:
The logical "user view" level The storage "base relation" level
Design is concerned mainly with base relations Criteria for "good" base relations:
Discuss informal guidelines for good relational design Discuss formal concepts of functional dependencies and normal forms 3NF, BCNF
Update Anomaly
Changing the name of project number P1 from Billing to Customer-Accounting may cause this update to be made for all 100 employees working on project P1
Insert Anomaly
Cannot insert a project unless an employee is assigned to . Inversely- Cannot insert an employee unless he/she is assigned to a project.
Design a schema that does not suffer from the insertion, deletion and update anomalies. If there are any present, then note them so that applications can be made to take them into account
Spurious Tuples
Bad designs for a relational database may result in erroneous results for certain JOIN operations The "lossless join" property is used to guarantee meaningful results for join operations The relations should be designed to satisfy the lossless join condition. No spurious tuples should be generated by doing a natural-join of any relations
Functional Dependencies
Functional dependencies (FDs) are used to specify formal measures of the "goodness" of relational designs FDs and keys are used to define normal forms for relations FDs are constraints that are derived from the meaning and interrelationships of the data attributes
Examples of FD constraints
Social Security Number determines employee name
SSN ENAME
Employee SSN and project number determines the hours per week that the employee works on the project
{SSN, PNUMBER} HOURS
Union
If X If X
Psuedotransitivity
Z, then WX
Closure of a set F of FDs is the set F+ of all FDs that can be inferred from F