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

momin204320 8 views 8 slides Jan 04, 2025
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

bahria university karachi campus,bscs,dbms, 2024


Slide Content

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 CA. 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 nB
Augmentation
If A B, then A,C B,C
Transitive dependency
A B, B C then A C

Rules of Inference for Functional Dependencies
Additivityor 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 Aakey for R?
Compute Closure of A and if it equals all attributes of that
relation than Ais 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
Tags