SlideShare uma empresa Scribd logo
1 de 16
Definition
A functional dependency is defined as a
constraint between two sets of attributes
in a relation from a database.
Given a relation R, a set of attributes X in R
is said to functionally determine another
attribute Y, also in R, (written X → Y) if
and only if each X value is associated
with at most one Y value.
In other words….
X is the determinant set and Y is the
dependent attribute. Thus, given a
tuple and the values of the attributes in
X, one can determine the
corresponding value of the Y attribute.
Example
Employee
SSN Name JobType DeptName
557-78-6587 Lance Smith Accountant Salary
214-45-2398 Lance Smith Engineer Product
Note: Name is functionally dependent on SSN because an employee’s name
can be uniquely determined from their SSN. Name does not determine SSN,
because more than one employee can have the same name..
Keys
Whereas a key is a set of attributes that uniquely
identifies an entire tuple, a functional
dependency allows us to express constraints
that uniquely identify the values of certain
attributes.
However, a candidate key is always a
determinant, but a determinant doesn’t need
to be a key.
Closure
Let a relation R have some functional dependencies F
specified. The closure of F (usually written as F+) is
the set of all functional dependencies that may be
logically derived from F. Often F is the set of most
obvious and important functional dependencies and
F+, the closure, is the set of all the functional
dependencies including F and those that can be
deduced from F. The closure is important and may,
for example, be needed in finding one or more
candidate keys of the relation.
Example
Student
SNo SName CNo CName Addr Instr. Office
5425 Susan
Ross
102 Calc I …San
Jose,
CA
P. Smith B42
Room
112
7845 Dave
Turco
541 Bio 10 ...San
Diego,
CA
L. Talip B24
Room
210
SNo -> SName CNo -> CName Instr -> Office
SNo -> Addr CNo -> Instr
Axioms
Before we can determine the closure of
the relation, Student, we need a set of
rules.
Developed by Armstrong in 1974, there
are six rules (axioms) that all possible
functional dependencies may be
derived from them.
Axioms Cont.
1. Reflexivity Rule --- If X is a set of attributes and
Y is a subset of X, then X  Y holds.
each subset of X is functionally dependent on X.
2. Augmentation Rule --- If X  Y holds and W is
a set of attributes, then WX  WY holds.
3. Transitivity Rule --- If X  Y and Y  Z holds,
then X  Z holds.
Derived Theorems from
Axioms
4. Union Rule --- If X  Y and X  Z
holds, then X  YZ holds.
5. Decomposition Rule --- If X  YZ
holds, then so do X  Y and X  Z.
6. Pseudotransitivity Rule --- If X  Y
and WY  Z hold then so does WX 
Z.
Back to the Example
SNo SName CNo CName Addr Instr. Office
Based on the rules provided, the following dependencies can be
derived.
(SNo, CNo)  SNo (Rule 1) -- subset
(SNo, CNo)  CNo (Rule 1)
(SNo, CNo)  (SName, CName) (Rule 2) -- augmentation
CNo  office (Rule 3) -- transitivity
SNo  (SName, address) (Union Rule)
etc.
Too Many FDs
Using the first rule alone, from our example we
have 2^7 = 128 subsets. This will further lead
to many more functional dependencies. This
defeats the purpose of normalizing relations.
So what now?
One way is to deal with one attribute or a set of
attributes at a time and find its closure (i.e. all
functional dependencies relating to them). The
aim of this exercise is to find what attributes
depend on a given set of attributes and
therefore ought to be together.
The approach
Step 1 Let X^c <- X
Step 2 Let the next dependency be A -> B.
If A is
in X^c and B is not, X^c <- X^c + B.
Step 3 Continue step 2 until no new
attributes can
be added to X^c.
Back To Our Example
Consider the following relation: student(SNo, SName, CNo,
CName).
We wish to determine the closure of (SNo, CNo). We have the
following functional dependencies.
SNo -> SName
CNo -> CName
 Step 1 --- X^c <- X, that is, X^c <- (SNo, CNo)
Step 2 --- Consider SNo -> SName, since SNo is in X^c and SName is not, we
have: X^c <- (SNo, CNo) + SName
Step 3 --- Consider CNo -> CName, since CNo is in X^c and CName is not, we
have: X^c <- (SNo, CNo, SName) + CName
Step 4 --- Again, consider SNo -> SName but this does not change X^c.
Step 5 --- Again, consider CNo -> CName but this does not change X^c.
 Therefore X+ = X^c = (SNo, CNo, SName, CName).
 This shows that all the attributes in the relation student (SNo, CNo, SName,
CName) are dependent on (SNo, CNo) and therefore (SNo, CNo) is a candidate key
of the present relation. In this case, it is the only candidate key.
Normal Form
 Initially Codd (1972) presented three normal
forms (1NF, 2NF and 3NF) all based on
functional dependencies among the attributes
of a relation. Later Boyce and Codd proposed
another normal form called the Boyce-Codd
normal form (BCNF). The fourth and fifth
normal forms are based on multi-value and
join dependencies and were proposed later.
 The primary objective of normalization is to
avoid anomalies.
Functional dependency

Mais conteúdo relacionado

Mais procurados

Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & CalculusAbdullah Khosa
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalizationUniversity of Potsdam
 
Functional Dependency
Functional DependencyFunctional Dependency
Functional DependencyAlaanoor94
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseRoshni Singh
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modelingsontumax
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independenceBHARATH KUMAR
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFBiplap Bhattarai
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 

Mais procurados (20)

Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & Calculus
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Functional Dependency
Functional DependencyFunctional Dependency
Functional Dependency
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
joins in database
 joins in database joins in database
joins in database
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Normal forms
Normal formsNormal forms
Normal forms
 
Schedule in DBMS
Schedule in DBMSSchedule in DBMS
Schedule in DBMS
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 

Semelhante a Functional dependency (20)

UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
DBMS Unit 3.pptx
DBMS Unit 3.pptxDBMS Unit 3.pptx
DBMS Unit 3.pptx
 
Functional Dependency
Functional DependencyFunctional Dependency
Functional Dependency
 
Data normalization
Data normalizationData normalization
Data normalization
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
_lecture_05 F_chain_rule.pdf
_lecture_05 F_chain_rule.pdf_lecture_05 F_chain_rule.pdf
_lecture_05 F_chain_rule.pdf
 
DBMS.ppt
DBMS.pptDBMS.ppt
DBMS.ppt
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
Normalization
NormalizationNormalization
Normalization
 
Chapter10
Chapter10Chapter10
Chapter10
 
Normalization
NormalizationNormalization
Normalization
 
New_ML_Lecture_9.ppt
New_ML_Lecture_9.pptNew_ML_Lecture_9.ppt
New_ML_Lecture_9.ppt
 
Dbms unit-3
Dbms unit-3Dbms unit-3
Dbms unit-3
 
Normalisation
NormalisationNormalisation
Normalisation
 
Fuzzy logic1
Fuzzy logic1Fuzzy logic1
Fuzzy logic1
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Normalization
NormalizationNormalization
Normalization
 
test
testtest
test
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Functional dependency

  • 1.
  • 2. Definition A functional dependency is defined as a constraint between two sets of attributes in a relation from a database. Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y, also in R, (written X → Y) if and only if each X value is associated with at most one Y value.
  • 3. In other words…. X is the determinant set and Y is the dependent attribute. Thus, given a tuple and the values of the attributes in X, one can determine the corresponding value of the Y attribute.
  • 4. Example Employee SSN Name JobType DeptName 557-78-6587 Lance Smith Accountant Salary 214-45-2398 Lance Smith Engineer Product Note: Name is functionally dependent on SSN because an employee’s name can be uniquely determined from their SSN. Name does not determine SSN, because more than one employee can have the same name..
  • 5. Keys Whereas a key is a set of attributes that uniquely identifies an entire tuple, a functional dependency allows us to express constraints that uniquely identify the values of certain attributes. However, a candidate key is always a determinant, but a determinant doesn’t need to be a key.
  • 6. Closure Let a relation R have some functional dependencies F specified. The closure of F (usually written as F+) is the set of all functional dependencies that may be logically derived from F. Often F is the set of most obvious and important functional dependencies and F+, the closure, is the set of all the functional dependencies including F and those that can be deduced from F. The closure is important and may, for example, be needed in finding one or more candidate keys of the relation.
  • 7. Example Student SNo SName CNo CName Addr Instr. Office 5425 Susan Ross 102 Calc I …San Jose, CA P. Smith B42 Room 112 7845 Dave Turco 541 Bio 10 ...San Diego, CA L. Talip B24 Room 210 SNo -> SName CNo -> CName Instr -> Office SNo -> Addr CNo -> Instr
  • 8. Axioms Before we can determine the closure of the relation, Student, we need a set of rules. Developed by Armstrong in 1974, there are six rules (axioms) that all possible functional dependencies may be derived from them.
  • 9. Axioms Cont. 1. Reflexivity Rule --- If X is a set of attributes and Y is a subset of X, then X  Y holds. each subset of X is functionally dependent on X. 2. Augmentation Rule --- If X  Y holds and W is a set of attributes, then WX  WY holds. 3. Transitivity Rule --- If X  Y and Y  Z holds, then X  Z holds.
  • 10. Derived Theorems from Axioms 4. Union Rule --- If X  Y and X  Z holds, then X  YZ holds. 5. Decomposition Rule --- If X  YZ holds, then so do X  Y and X  Z. 6. Pseudotransitivity Rule --- If X  Y and WY  Z hold then so does WX  Z.
  • 11. Back to the Example SNo SName CNo CName Addr Instr. Office Based on the rules provided, the following dependencies can be derived. (SNo, CNo)  SNo (Rule 1) -- subset (SNo, CNo)  CNo (Rule 1) (SNo, CNo)  (SName, CName) (Rule 2) -- augmentation CNo  office (Rule 3) -- transitivity SNo  (SName, address) (Union Rule) etc.
  • 12. Too Many FDs Using the first rule alone, from our example we have 2^7 = 128 subsets. This will further lead to many more functional dependencies. This defeats the purpose of normalizing relations. So what now? One way is to deal with one attribute or a set of attributes at a time and find its closure (i.e. all functional dependencies relating to them). The aim of this exercise is to find what attributes depend on a given set of attributes and therefore ought to be together.
  • 13. The approach Step 1 Let X^c <- X Step 2 Let the next dependency be A -> B. If A is in X^c and B is not, X^c <- X^c + B. Step 3 Continue step 2 until no new attributes can be added to X^c.
  • 14. Back To Our Example Consider the following relation: student(SNo, SName, CNo, CName). We wish to determine the closure of (SNo, CNo). We have the following functional dependencies. SNo -> SName CNo -> CName  Step 1 --- X^c <- X, that is, X^c <- (SNo, CNo) Step 2 --- Consider SNo -> SName, since SNo is in X^c and SName is not, we have: X^c <- (SNo, CNo) + SName Step 3 --- Consider CNo -> CName, since CNo is in X^c and CName is not, we have: X^c <- (SNo, CNo, SName) + CName Step 4 --- Again, consider SNo -> SName but this does not change X^c. Step 5 --- Again, consider CNo -> CName but this does not change X^c.  Therefore X+ = X^c = (SNo, CNo, SName, CName).  This shows that all the attributes in the relation student (SNo, CNo, SName, CName) are dependent on (SNo, CNo) and therefore (SNo, CNo) is a candidate key of the present relation. In this case, it is the only candidate key.
  • 15. Normal Form  Initially Codd (1972) presented three normal forms (1NF, 2NF and 3NF) all based on functional dependencies among the attributes of a relation. Later Boyce and Codd proposed another normal form called the Boyce-Codd normal form (BCNF). The fourth and fifth normal forms are based on multi-value and join dependencies and were proposed later.  The primary objective of normalization is to avoid anomalies.