Database Management System
By Assist Professor Malik M Ali
Rules of Inference for Functional Dependencies
Let A,B,C and D be subsets of attributes of a Relation R
Reflexivity
If A  B where B C A. This also implies that A  A
always holds. FDs of this type is known as trivial FDs
 A  B then A  A U B
A  B then A  A n B
Augmentation
If A  B, then A,C  B,C
Transitive dependency
A  B, B  C then A  C
Rules of Inference for Functional Dependencies
Additivity or Union
If A  B and A  C, then A  B,C
Decomposition
If A  B,C then A  B and A  C
PseudoTransitivity
If A  B and B,C  D then A,C  D
1. Relation R{A,B,C,D}
FD {A  B, B  C, C  D}
A+ = ABCD
B+ = BCD
C+ = CD
Only One Candidate Key Identified i.e. A
2. Relation R{A,B,C,D}
 FD {A  B, B  C, C  D, D  A}
 A+ = ABCD
 B+ = BCDA
 C+ = CDAB
 D+ = DABC
 FOUR CANDIDATE KEYS IDENTIFIED
Closure Method
Relation R as Eight Attributes  R{A,B,C,D,E,F,G,H}
F = {CH  G, A  BC, B  CFH, EA, FEG}
Identify number of Candidate Keys in R?
D+ = D
1. AD+ = ADBCFHEG
2. ED+ = EDABCFHG
3. FD+ = DEGABCFH
4. BD+ = CDFHEGAB
Closure Method
Closure Method
Relation R as five Attributes  R{A,B,C,D,E}
FD = {A  B, BC  D, EC, DA}
Identify number of Candidate Keys in R?
AE = ABCED
BE = ?
CE = ?
Closure of Attributes
Is A a key for R?
Compute Closure of A and if it equals all attributes of that
relation than A is a key.
NIC_Num  StdName, StdAddress,
Percentage
HighSchoolCode  BoardofEdu,
HighschoolName, HighschoolCity
Percentage  Priority
{NIC_Num, HSCode}+
{NIC_Num, HSCode, StdName, StdAddress, Percentage,
Priority, BoardofEdu, HighschoolName, HighschoolCity}
Mapping of Conceptual Schema to Logical
Schema

lecture-8 Rules-of-Inference-dbms-CS.pdf

  • 1.
    Database Management System ByAssist Professor Malik M Ali
  • 2.
    Rules of Inferencefor Functional Dependencies Let A,B,C and D be subsets of attributes of a Relation R Reflexivity If A  B where B C A. This also implies that A  A always holds. FDs of this type is known as trivial FDs  A  B then A  A U B A  B then A  A n B Augmentation If A  B, then A,C  B,C Transitive dependency A  B, B  C then A  C
  • 3.
    Rules of Inferencefor Functional Dependencies Additivity or Union If A  B and A  C, then A  B,C Decomposition If A  B,C then A  B and A  C PseudoTransitivity If A  B and B,C  D then A,C  D
  • 4.
    1. Relation R{A,B,C,D} FD{A  B, B  C, C  D} A+ = ABCD B+ = BCD C+ = CD Only One Candidate Key Identified i.e. A 2. Relation R{A,B,C,D}  FD {A  B, B  C, C  D, D  A}  A+ = ABCD  B+ = BCDA  C+ = CDAB  D+ = DABC  FOUR CANDIDATE KEYS IDENTIFIED Closure Method
  • 5.
    Relation R asEight Attributes  R{A,B,C,D,E,F,G,H} F = {CH  G, A  BC, B  CFH, EA, FEG} Identify number of Candidate Keys in R? D+ = D 1. AD+ = ADBCFHEG 2. ED+ = EDABCFHG 3. FD+ = DEGABCFH 4. BD+ = CDFHEGAB Closure Method
  • 6.
    Closure Method Relation Ras five Attributes  R{A,B,C,D,E} FD = {A  B, BC  D, EC, DA} Identify number of Candidate Keys in R? AE = ABCED BE = ? CE = ?
  • 7.
    Closure of Attributes IsA a key for R? Compute Closure of A and if it equals all attributes of that relation than A is a key. NIC_Num  StdName, StdAddress, Percentage HighSchoolCode  BoardofEdu, HighschoolName, HighschoolCity Percentage  Priority {NIC_Num, HSCode}+ {NIC_Num, HSCode, StdName, StdAddress, Percentage, Priority, BoardofEdu, HighschoolName, HighschoolCity}
  • 8.
    Mapping of ConceptualSchema to Logical Schema