DBMS Unit 3.0 Functional Dependencies
DBMS Unit 3.0 Functional Dependencies
• Delete Anomaly
• When a project is deleted, it will result in deleting all the
employees who work on that project. Alternately, if an employee
is the sole employee on a project, deleting that employee would
result in deleting the corresponding 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
Null Values in Tuples
Proof:
1. X → Y (given)
2. X → Z (given)
3. X → XY (using IR2 on 1 by augmentation with X. Where XX = X)
4. XY → YZ (using IR2 on 2 by augmentation with Y)
5. X → YZ (using IR3 on 3 and 4)
6. Decomposition Rule (IR5)
Decomposition rule is also known as project rule. It is the reverse of union rule.
This Rule says, if X determines Y and Z, then X determines Y and X determines
Z separately.
If X → YZ then X → Y and X → Z
Proof:
1.X → YZ (given)
2. YZ → Y (using IR1 Rule)
3. X → Y (using IR3 on 1 and 2)
If X → Y and YZ → W then XZ → W
Proof:
1. X → Y (given)
2. WY → Z (given)
3. WX → WY (using IR2 on 1 by augmenting with W)
4. WX → Z (using IR3 on 3 and 2)
Determinant
Functional Dependency
EmpNum EmpEmail
91.2914 22
Transitive dependency
Transitive dependency
91.2914 23
Transitive dependency
EmpNum DeptNum
DeptNum DeptName
91.2914 24
Partial dependency
A partial dependency exists when an attribute B is
functionally dependent on an attribute A, and A is a
component of a multipart candidate key.
• Decomposition
• If X YZ, then X Y and X Z
• Union
• If X Y and X Z, then X YZ
• Psuedotransitivity
• If X Y and WY Z, then WX Z
• Closure of a set F of FDs is the set F+ of all FDs that
can be inferred from F
Normalization
•Normalization is the process of organizing the data in the database.
•Normalization is used to minimize the redundancy from a relation or set of relations. It
is also used to eliminate the undesirable characteristics like Insertion, Update and
Deletion Anomalies.
•Normalization divides the larger table into the smaller table and links them using
relationship.
•The normal form is used to reduce redundancy from the database table.
• Definition
• Transitive functional dependency – if there a set of
atribute Z that are neither a primary or candidate key and
both X Z and Y Z holds.
• Examples:
• SSN DMGRSSN is a transitive FD since
SSN DNUMBER and DNUMBER DMGRSSN hold
• SSN ENAME is non-transitive since there is no set of
attributes X where SSN X and X ENAME
3rd Normal Form
• {Student,course} Instructor
• Instructor Course
• Decomposing into 2 schemas
• {Student,Instructor} {Student,Course}
• {Course,Instructor} {Student,Course}
• {Course,Instructor} {Instructor,Student}
Example