Functional dependencies in Database Management SystemKevin Jadiya
Slides attached here describes mainly Functional dependencies in database management system, how to find closure set of functional dependencies and in last how decomposition is done in any database tables
You can get clear knowledge about the functional dependencies in "Normalization". And also the rules, types of FDs and finally the closure and its applications
Functional dependencies in Database Management SystemKevin Jadiya
Slides attached here describes mainly Functional dependencies in database management system, how to find closure set of functional dependencies and in last how decomposition is done in any database tables
You can get clear knowledge about the functional dependencies in "Normalization". And also the rules, types of FDs and finally the closure and its applications
Normalization is the process of removing redundant data from your tables to improve storage efficiency, data integrity, and scalability.
Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.
Why normalization?
The relation derived from the user view or data store will most likely be unnormalized.
The problem usually happens when an existing system uses unstructured file, e.g. in MS Excel.
Normalization is the process of removing redundant data from your tables to improve storage efficiency, data integrity, and scalability.
Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.
Why normalization?
The relation derived from the user view or data store will most likely be unnormalized.
The problem usually happens when an existing system uses unstructured file, e.g. in MS Excel.
In this PPT contains Functional Dependency , Armstrong Inferences Rules and Data Normalization like 1NF,2NF and 3NF. Explain also full functional dependencies , multivalued dependency and Transitive Dependency.
It is very helpful in learning all the basics concepts of DBMS starting from Introduction: An Overview of Database Management System to Data Modeling using the Entity-Relationship Model, PL/SQL, Transaction Processing Concept, and Concurrency Control Techniques plus important numerals in exam point of view can be learned.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
2. Functional Dependencies
❖Users probably won’t understand that term “Functional Dependency”,
important to ask right question.
❖If you known a particular employee number, can you establish other
information, such as name?
❖If you can determine that the name is functionally dependent on the employee
number.
2
3. Functional Dependencies cont…
❖Another Question: Do you know the number of the department to which the
employee is assign?.
❖If you can then we can say department no is functionally dependent on
employee number.
❖If a employee can be assigned to more than one department, you would not the
know department number. So department no is not functionally dependent on
employee number.
3
4. Functional Dependencies cont…
❖Functional dependency concern the dependence of the value of one
attributes or set of attributes on those of another attribute or set of
attributes.
❖A FD is a property of the semantics or meaning of the attributes in a
relation.
❖Semantics indicate how attributes relate to one another and specify the
FDs between attributes.
4
5. Functional Dependencies cont…
❖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.
5
6. Functional Dependencies cont…
❖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.
❖Left hand side of the FD is called determinant whereas that of the right
side is called dependent.
6
7. Functional Dependencies cont…
❖Example: Employee
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..
7
9. 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.
9
10. Full Functional Dependency (FDD)
❖ Minimal set of attributes in a determinant of a FD.
❖Other words the set of attributes Y will be fully functionally dependent on
the set of attributes X,
⮚ Y is functionally dependent on X.
⮚ Y is not functionally dependent on any subset of X.
10
11. Full Functional Dependency cont…
❖ Example
Emp_id, Project_no, Project_budget -> Yr_spent_by_emp_on_project.
❖In this Emp_id and Project_no is sufficient set of attribute to determines
the value of right hand side. So there is no need of Project-budget. FDD is
Emp_id, Project_no-> Yr_spent_by_emp_on_project
11
12. Full Functional Dependency cont…
❖A FD X -> Y is a fully functional dependency if removal of any attribute A
from X, means that the dependency does not hold any more: i.e. for any
attribute A Ɛ X.
❖Example: {SSN, Pnumber} -> Hours.
❖We can not remove any attribute from determinant side.
12
13. Closure (F+)
❖ 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.
13
14. Closure (F+)
❖Example: FD is given:
SSN->{ename, bdate, address, dnumber}
Dnumber-> dname, dmgr_ssn
Now we can infer from F are the following:
SSN -> Dname, dmgr_sssn
14
15. Axioms (Inference Rules)
❖Before we can determine the closure of the relation, 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.
15
16. Axioms (Inference Rules) cont…
❖Reflexivity Rule :- If X is a set of attributes and Y is a subset of X, then X →
Y holds.
Example: AB->A.
❖Augmentation Rule :- If X → Y holds and W is a set of attributes, then WX →
WY holds.
Example: AB->C, ABD->CD 16
17. Axioms (Inference Rules) cont…
❖Transitivity Rule :- If X → Y and Y → Z holds,
then X → Z holds.
Example: A → BC (GIVEN) find BC->B and A->B
BC → B (Using Rule 1, since B ⊆ BC)
A → B (Using Rule 3)
17
18. Derived Theorems from Axioms
❖Union Rule :- If X → Y and X → Z holds,
then X → YZ holds.
❖Decomposition Rule :-If X → YZ holds, then
X → Y and X → Z.
❖Pseudotransitivity Rule :- If X → Y and WY → Z hold then WX → Z.
18
19. Derived Theorems from Axioms
❖Composition – If A->B and X->Y holds, then AX ->BY holds.
❖Self Determination Rule - A → A is a self determination rule.
❖Note: These are not commutative as well as associative. i.e. if X → Y then
Y → X (not possible)
19
20. Exercise
❖Consider relation E = (P, Q, R, S, T, U) having set of Functional
Dependencies (FD).
❖P → Q , P → R, QR → S , Q → T, R → U, PR → U
❖Calculate some members of Axioms are as follows,
❖ P → T
❖ PR → S
❖QR → SU
❖PR → SU 20
21. Exercise (Solution)
❖Given FD’s are:
P → Q , P → R, QR → S , Q → T, R → U, PR → U
1. P → T
In the above FD set, P → Q and Q → T
Using Transitive Rule: If P → Q and Q → T, then P → T.
2. PR → S
In the above FD set, P → Q and QR → S.
Using Pseudo Transitivity Rule: If P → Q and QR → S,
then PR → S. 21
22. Exercise (Solution)
❖Given FD’s are:
P → Q , P → R, QR → S , Q → T, R → U, PR → U
3. QR → SU
In above FD set, QR → S and QR → U
Using Union Rule: If QR → S and QR → U, then QR → SU.
4. PR → SU
Using Pseudo Transitivity Rule:
If PR → S and PR → U, then PR → SU.
22
23. Exercise (Home Work)
❖Consider a relational scheme R with attributes A,B,C,D,F and the FDs A →
BC, B → E, CD → EF. Prove that functional dependency AD → F holds in R.
❖Let set of FD's are given F={A->B, C->X, BX->Z}. Prove or disprove that AC-
>Z.
❖Let F={A->B, C->D, C IS SUBSET OF B}. Prove or disprove that A->C.
23
24. Points to Compute Closure
❖First start with result: First we assign the result same as the value of the
closure which we want to compute.
❖Inner Loop: We now go to the inner loop as many times as the FD’s are
given.
❖Find Subset: If we find that the left hand side is the subset of the closure,
which we want to compute , add those attributes to the result.
24
25. Points to Compute Closure
❖Nested Inner Loop: Now we go to the inner loop many times as the left
hand side is the subset of the result.
❖Stop Inner loop: If left hand side is not the subset of the result, we stop
going round to the inner loop.
❖Result: Final result is generated.
25
26. Example: Compute Closure
❖Let R={A,B,C,D,E,F} and FDs {A->BC, E->CF, B->E, CD->EF}. Now compute
the closure {AB}+.
❖Solution: 1. Start with result: {AB} so
AB->AB {all attributes are determined by itself.}
2. We now go to inner loop four times because of fours FDs.
(I) Iteration I: Inner Loop Iteration (I) We have AB-> AB now take FD A-
>BC. Check left hand side is the subset of the result {AB}.
26
27. Example: Compute Closure
A->BC and AB->AB
Means A is subset of AB. If yes then include B and C
into result. So new result set is {ABC}
Note: Include only those attributes which are not present in result set.
Inner Loop Iteration II: After first iteration we have result set {ABC}. Now
take E->CF. Find left hand side is subset of result set =🡺 NO.
So result set remain unchanged {ABC}.
27
28. Example: Compute Closure
Inner Loop Iteration III: Result set {ABC}. Now take B->E.
Check left side is subset of Result set: YES
Include E into result set. So new result set is: {ABCE}.
Inner Loop Iteration IV: Result set {ABCE}. Now take CD->EF.
Check left side is subset of Result set: NO
Result set remain unchanged: {ABCE}.
28
29. Example: Compute Closure
II. Iteration II: After Iteration I we have result set {ABCE}. Now we will
compute inner loop again four times:
Inner loop Iteration I: {ABCE} result set. Now take A->BE. Check left side is
subset: YES. Result set{ABCE}.
Inner loop Iteration II: {ABCE} result set. Now take E->CF. Check left side is
subset: YES. Result set{ABCEF}.
29
30. Example: Compute Closure
Inner loop Iteration III: {ABCEF} result set. Now take B->E. Check left side is
subset: YES. Result set no changed. {ABCEF}.
Inner loop Iteration IV: {ABCEF} result set. Now take CD->EF. Check left side
is subset: YES. Result set no changed. {ABCEF}.
III. Iteration III: Result set {ABCEF}. Now Computer inner loop four time. No
changes in result set.
30
31. Example: Compute Closure
IV. Iteration IV: Result set {ABCEF}. Now Computer inner loop four time. No
changes in result set.
So the whole process terminates with :
AB+ = {ABCEF}.
Exercise I : Let R {A,B,C,D,E} AND FDs AB->C, A->D, D->E, AC->B. Compute
AB+, A+, B+, D+.
Solutions: AB+= {ABCDE}, A+={ADE}, B+={B}, D+={DE}.
31
32. Example: Compute Closure
Exercise II : Let R {A,B,C,G,H,I} AND FDs A->B, A->C, CG->H, CG->I, B->H.
Compute AG+
Solutions: AG+= ABCGHI
32
33. Trivial and Non-Trivial FD
If a functional dependency X->Y holds true where Y
is a subset of X then this dependency is called trivial
Functional dependency.
Example: {Student_Id, Student_Name} -> Student_Id
is a trivial functional dependency as Student_Id is a
subset of {Student_Id, Student_Name}.
33
34. Trivial and Non-Trivial FD
If a functional dependency X->Y holds true where Y
is not a subset of X then this dependency is called
non trivial Functional dependency.
Example: Employee Table:
emp_id -> emp_name ,
emp_id -> emp_address
34
35. Trivial and Non-Trivial FD
If a functional dependency X->Y holds true where Y
is not a subset of X then this dependency is called
non trivial Functional dependency.
Example: Employee Table:
emp_id -> emp_name ,
emp_id -> emp_address
35
36. Cover and Equivalence of FD’s
❖ Set of functional dependencies F is said to cover another set of functional
dependencies G, if every FD in G is also in F+; that is, if every
dependency in G can be inferred from F; alternatively, we can say that G
is covered by F.
36
37. Cover and Equivalence of FD’s
❖ Two sets of functional dependencies G and F are equivalent if G+ = F+.
Therefore, equivalence means that every FD in G can be inferred from F,
and every FD in F can be inferred from G; that is, G is equivalent to F, if
both the conditions—G covers F and F covers G—hold.
37
38. Cover and Equivalence of FD’s
Example: F = {A → C, AC → D, E → AD, E → H} and G = {A → CD, E → AH}.
❖ Take Set F and Check G is covered from F or not.
❖ A+= ACD, E+=ADCH
❖ Hence, both A → CD and E → AH are covered.
❖ G is derived from F. Hence G is covered by F.
38
39. Cover and Equivalence of FD’s
Example: F = {A → C, AC → D, E → AD, E → H} and G = {A → CD, E → AH}.
❖ Take Set G and Check F is covered from G or not.
❖ (A)+ = {ACD} (AC)+ = {ACD} (E)+ = {EAHCD}
Hence F = {A → C, AC → D, E → AD, E → H} is covered.
F is derived from G. Hence F is covered from G.
So F is cover by G and G is cover by F, we can say F and G are equivalent.
39
40. Determining Candidate Key
1. Compute Closure of each of attributes. i.e. A+, B+.
2. If any attribute is candidate key then do not create any candidate key
using it. Because its subset not allow to make another attribute as a
candidate key.
3. Any attribute is called a candidate key of any relation, if attribute closure
is equal to the relation. For Example: if R{A,B,C,D,E} then A is a candidate
key, if A+={A,B,C,D,E}.
40
41. Determining Candidate Key cont…
Example: Given R{A,B,C,D} And FDs F={AB->C, C->D, D->A}. List all the
candidate keys.
Solution: 1. compute A+={A} // not a candidate key because A+ can not
determines all A, B, C, D.
2. B+=B //not a candidate key.
3. C+=CDA // not a candidate key.
4. D+=DA // not a candidate key.
5. AB+=ABCD //AB is a candidate key. 41
42. Determining Candidate Key cont…
So any combination of AB does not form other candidate key.
6. AC+=ACD // not a candidate key.
7. AD+=AD //not a candidate key.
8. BC+=BCDA // candidate key. Combination not allowed.
9. BD+=ABCD //candidate key.
10. CD+=CDA //not a candidate key.
42
43. Determining Candidate Key cont…
List of candidate keys { AB, BC, BD}.
Example 2: Given R {A,B,C,D,E}. List all candidates keys of R for a given FD’s
{A->BC, CD->E, B->D, E->A}.
Result: {A, E, BC, CD}.
Example 3: R{ABCD} , FD’s ABC->D, D->A.
Result: {ABC, BCD}.
43
44. Non-redundant Covers
❖ A set F, of FDs is non-redundant if there is no proper subset F’ of F, with
F’ = F. If such an F ’ exists, F is redundant. F is a non-redundant cover for
G, if F is a cover for G and F is non-redundant.
❖ A functional dependency in the set, is redundant if it can be derived from
the other functional dependencies in the set.
❖ We can remove some FD which are redundant to make the whole FD’s
non redundant.
44
45. Steps to detect redundant FD’s
A redundant FD can be detected using the following
steps:
1. Start with a set of F, of functional dependencies (FDs).
2. Remove an FD, f and create a set of FDs F' = F - f .
3. Test whether f can be derived from the FDs in F';
4. If f can be derived, it is redundant , and hence F' = F. Otherwise replace f
into F'; so that now F' = F + f.
45
46. Steps to detect redundant FD’s conti…
5: Repeat steps 2 to 4 for all FDs in F.
Example: F={Z -> A B -> X AX -> Y ZB -> Y }
Step I: F’=F-f 🡺 F’={B->X AX->Y ZB->Y}
Step II: Check Z-> A derive from F’. //NO we can not derive. So Z->A is not
redundant.
Repeat Step: check for B->X //not redundant.
Repeat Step: check for AX->Y //not redundant.
Repeat Step: check for ZB->Y. // redundant. 46
47. Steps to detect redundant FD’s conti…
❖ Z -> A by augmentation rule will yield ZB -> AB.
❖ B -> X and AX -> Y by pseudo-transitivity rule will yield AB -> Y.
❖ ZB -> AB and AB -> Y by transitivity rule will yield
ZB -> Y.
So ZB->Y redundant.
47
48. Steps to detect redundant FD’s conti…
Example 2: F = {A -> B, C -> D, BD -> E, AC -> E}
❖ Find out whether a FD f : AC -> E is redundant or not.
❖ Find out whether a FD f : BD -> E is redundant or not.
❖ AC->E redundant.
❖ BD->E non redundant.
Example 3: R{XYZWPQ} F🡺{X->YZ, ZW->P, P->Z, W->XPQ, XYQ->YW, WQ-
>YZ}. Find non redundant.
Sol: {X->YZ, P->Z, W->XPQ, XYQ->YW} 48
49. Irreducible/ minimal set/ canonical cover
❖ A canonical cover of F is a “minimal” set of functional dependencies
equivalent to F, having no redundant dependencies or redundant parts of
dependencies.
❖ Canonical cover of any functional dependency is denoted by Fc.
❖ Canonical cover Fc for F is a set of dependencies such that F logically
implies all dependencies in Fc and Fc logically implies all dependencies in F.
So Fc must have the following properties:
49
50. Irreducible/ minimal set/ canonical cover
❖No functional dependency in Fc contains an extraneous attribute.
❖Each left side of a functional dependency in Fc is unique. That is there are no
two dependencies X1->Y1 and X2->Y2 in Fc such that X1=X2.
50
51. Irreducible/ minimal set/ canonical cover
❖ Sets of functional dependencies may have redundant dependencies that can
be inferred from the others.
❖ Eg: A → C is redundant in: {A → B, B → C, A → C}.
❖ Parts of a functional dependency may be redundant .
❖ E.g. on RHS: {A → B, B → C, A → CD} can be simplified to {A → B, B → C, A →
D}
❖ E.g. on LHS: {A → B, B → C, AC → D} can be simplified to {A → B, B → C, A →
D}
51
52. Extraneous Attributes
❖ Consider F, and a functional dependency, A 🡺B.
❖ “Extraneous”: Are there any attributes in A or B that can be safely removed,
without changing thFe constraints implied by F.
Testing if an Attribute is Extraneous:
❖ Consider a set F of functional dependencies and the functional dependency
α→β in F.
52
53. Extraneous Attributes
❖ To test if attribute A ∈ α is extraneous in α.
⮚ Compute ({ α} – A)+ using the dependencies in F.
⮚ Check ({ α} – A )+ contains A; if it does, A is extraneous.
❖ To test if attribute A ∈ β is extraneous in β
⮚ compute α+ using only the dependencies in F’ = (F – {α→β})
∪ {α →(β – A)},
⮚ check that α+ contains A; if it does, A is extraneous.
53
54. Canonical Cover
❖ A canonical cover for F is a set of dependencies Fc such that
I. F logically implies all dependencies in Fc, and
II. Fc logically implies all dependencies in F, and
III. No functional dependency in Fc contains an extraneous attribute, and
IV. Each left side of functional dependency in Fc is unique.
54
55. Canonical Cover cont…
❖ Find the minimal cover or irreducible set from the following functional
dependencies : AB → CD, BC → D
Step 1 : Union Simplification : H={AB → C , AB → D, BC → D}.
Step 2 : Removal of Redundant set of FDs –
I. First take AB🡺C, check it is essential or nor. So we compute AB+ in set J={AB🡺D, BC🡺D)
and we get (AB)+ = {ABD}. as (AB)+ will not determine C, So AB → C is non redundant or
essential and remain in H.
II. Now take AB🡺D, So we compute AB+ in set J={AB🡺C, BC🡺D) and we get (AB)+ = {ABCD}.
As (AB)+ will determine D, So AB → D is redundant or inessential and remove from H.
55
56. Canonical Cover cont…
III. Now we get H={AB→C, BC→D}. Now we take BC🡺D, check it is essential or nor. So we
compute BC+ in set J={AB🡺C) and we get (BC)+ = {BC}. As (BC)+ will not determine D, So
BC → D is non redundant or essential and remain in H.
Step 3: LHS Simplification or Removal of Extraneous Attributes. FDs remained after
step 2, AB→C and BC→D. First we
take AB → C.
I. Remove A from AB → C, and find B+ from J={BC🡺D}. B+ = {B} ⇒ A is Non Redundant.
II. Now drop B from AB🡺C and find A+ from j={BC🡺D}. A+={A}. B is non redundant.
56
57. Canonical Cover cont…
Step 3 conti… : Now we take BC → D.
I. Remove B from BC → D, and find C+ from J={AB🡺C}. C+ = {C} ⇒ B is Non Redundant.
II. Now drop C from BC🡺D and find B+ from j={AB🡺C}. B+={B}. C is non redundant.
Apply step 2 again if we find any redundant attribute, otherwise skip. So Finally, Irreducible
set will be AB→C, BC→D.
Example2: F={A🡺BC, B🡺C, A🡺B, AB🡺C}. Compute Fc for R{ABC}.
Sol: A🡺B B🡺C.
57
58. Canonical Cover cont…
Example: F={V🡺W, VW🡺 X, Y🡺VXZ}. Compute Fc for R{VWXYZ}.
Sol:
Example: R = {A,B,C,D,E,F,G,H} , F = {AC→G, D→EG, BC→D, CG→BD, ACD→B, CE→AG}Find the
canonical cover of F.
Example: F={A🡺BC, CD🡺E, B🡺D, E🡺A}. Compute Fc for R{ABCDE}.
Sol: AD🡺CF, C🡺B, B🡺E.
Example: F={ABCD → E, E → D , AC → D, A → B). Compute Fc for R{ABCDE}.
Sol: AC → E, E → D, A → B.
58
59. Decomposition
❖Functional Decomposition is the process of breaking down the functions of an
organization into progressive greater levels of details.
❖The decomposition of a relation scheme R consists of replacing the relation
schema by two or more relation schemas that each contain a subset of the
attributes of R and together include all attributes in R.
59
60. Decomposition conti…
❖Decomposition helps in eliminating some of the problems of bad design
such as redundancy, inconsistencies and anomalies.
❖Using the functional dependency the design algorithms decompose the
universal relation schema R into a set of relation schemas (Projection in
relational algebra.).
60
61. Decomposition conti…
❖R1 = projection of R on A1, ..., An, B1, ..., Bm
❖R2 = projection of R on A1, ..., An, C1, ..., Cp
❖A1, ..., An ∪ B1, ..., Bm ∪ C1, ..., Cp = all attributes
❖R1 and R2 may (/not) be reassembled to produce original R.
R(A1, ..., An, B1, ..., Bm, C1, ..., Cp)
R1(A1, ..., An, B1, ..., Bm) R2(A1, ..., An, C1, ..., Cp)
61
62. Decomposition conti…
❖We must make sure that each attributes in R will appear in at least one
relation schema Ri, in the decomposition, so that no attribute are lost;
❖This is called the Attribute Preservation condition of a decomposition.
62
64. Lossy Decomposition
❖We should take care some desirable properties while doing
decomposition. If we do the careless decomposition, then it will lead to a
bad design again.
❖Consider a Schema relation which has many attributes and results into
redundancy. Let us apply Decomposition:
64
67. Lossy Decomposition conti…
❖In above example some information is lost during retrieval of original
relation or table.
❖Let R be the relational schema with instance r is decomposed
into R1,R2,….,Rn with instances r1,r2,..,rn.
❖If r1 ⋈ r2 ⋈ ……. ⋈ rn ⊃ r , then it is called Lossy Join Decomposition. i.e. if
the original relation is the proper subset of natural joins of all the
decompositions, then it is said to be Lossy Join Decomposition.
67
68. Lossless Decomposition
❖A relational table decomposed into two or more smaller tables, in such a
way that designer can capture the precise content of the original table by
joining the decomposed parts. This is called lossless-join.
❖Let R be the relational schema with instance r is decomposed into
R1,R2,….,Rn with instance r1,r2,…..,rn.
❖If r1 ⋈ r2 ⋈ ……. ⋈ rn = r , then it is called Lossless Join Decomposition.
68
69. Lossless Decomposition conti…
❖If we decompose a relation R into relations R1 and R2,
❖Decomposition is lossy if R1 ⋈ R2 ⊃ R
❖Decomposition is lossless if R1 ⋈ R2 = R
69
71. Lossless Decomposition conti…
S# P# Sname City
3 301 Smith London
5 500 Nick NY
2 20 Steve Boston
5 400 Nick NY
5 301 Nick NY
S# P# QTY
3 301 20
5 500 50
2 20 10
5 400 40
5 301 10
71
72. To check for lossless join
❖Union of Attributes of R1 and R2 must be equal to attribute of R. Each
attribute of R must be either in R1 or in R2.
Att(R1) U Att(R2) = Att(R)
❖Intersection of Attributes of R1 and R2 must not be NULL. i.e. Att(R1) ∩
Att(R2) ≠ Φ
❖Common attribute must be a key for at least one relation (R1 or R2)
Att(R1) ∩ Att(R2) -> (R1) or
Att(R1) ∩ Att(R2) -> (R2)
72
73. Find Lossless or Lossy
❖Example 1: Given R(ABCDE) having following FD’s AB→C, C→D, B→E, D =
{ABC, CDE} Check whether decomposition is lossless or lossy.
Solution: I. D={ABC, CDE} check R1 U R2=R TRUE.
II. R1∩R2 = C
III. C+ = {CD} is not a super key of any table.
Give R is Lossy join decomposition.
73
74. Find Lossless or Lossy
❖Example 2: If above relation with same FD set is decomposed into D =
{ABCD, BE}. Check whether decomposition is lossless or lossy.
❖Solution: Now common attribute is B
B+ = BE (super key for 2nd table)
hence lossless join decomposition
74
75. Dependency Preservation Property
❖The decomposition of relation R with FDs F into R1 and R2 with FDs f1
and f2 respectively, is said to be dependency preserving if.
F={f1 U f2} or F+={f1 U f2}+.
❖Example: R=(A, B, C), F= { A->B, B->C } decomposition of R: R1=(A, B)
R2=(B, C). Does this decomposition preserve the given dependencies?
75
76. Dependency Preservation Property
❖In R1 the following dependencies hold: F1={A->B, A->A, B->B, AB->AB}
❖In R2 the following dependencies hold: F2= {B->B, C->C, B->C, BC->BC}
❖F’= F1’ U F2’ = {A->B, B->C, only non-trivial dependencies}
❖In F’ all the original dependencies occur, so this decomposition preserves
dependencies.
76
77. Dependency Preservation Property
❖Example 2 : R=(A, B, C), F={A->B, B->C} Decomposition of R: R1=(A, C)
R2=(B, C). Does this decomposition preserve the given dependencies?
❖Solution: In R1 the following dependencies hold: F1={A->A, A->C, C->C,
AC->AC}
❖In R2 the following dependencies hold: F2={B->B, B->C, C->C, BC->BC}
❖F’={F1 U F2} => {A->C, B->C} i.e. not equal to F. So this decomposition not
dependency preserving.
77
78. Dependency Preservation Property
❖Example 3: Let R (A, B, C, D) be a relational schema with the following
functional dependencies: A → B, B → C, C → D and D → B. The
decomposition of R into (A, B), (B, C), (B, D). The relation is dependency
preserving or not?
❖Solution: Dependency Preserving.
78
79. Normalization
❖Normalization is the process of minimizing redundancy from a relation or set of
relations.
❖Redundancy in relation may cause insertion, deletion and updating anomalies.
So, it helps to minimize the redundancy in relations.
❖Normal forms are used to eliminate or reduce redundancy in database tables.
79
80. Normalization cont…
❖Normalization is a process of decomposing a set of relations with
anomalies to produce smaller and well structured relations that contain
minimum or no redundancy.
❖It is a formal process of deciding which attribute should be grouped
together in a relation.
80
81. Normalization cont…
❖ However during normalization, it is ensured that a normalized schema:
⮚ Does not lose any information present in the original un-normalized schema.
⮚ Preserves dependencies present in the original schema.
❖ The process of normalization was first proposed by E. F. Codd.
❖ Normalization is a bottom-up design technique for relational database.
❖ It is difficult to use in large database design.
81
82. Normalization cont…
❖A Normal form is a state of relation that results from applying simple
rules, regarding functional dependencies (FD’s) to that relation.
❖The normal form are used to ensure that various types of anomalies and
inconsistencies are not introduced into the database.
82
83. Anomalies without Normalization
❖Anomalies refers to the problems occurred after poorly planned and un-
normalized databases.
❖Lets consider a schema:
SID Sname CID Cname FEE
S1 A C1 C 5k
S2 A C1 C 5k
S1 A C2 C 10k
S3 B C2 C 10k
S3 B C3 JAVA 15k
Primary Key: (SID, CID)
83
84. Types of Anomalies
❖Three types of anomalies are:
⮚ Insertion Anomaly
⮚ Deletion Anomaly
⮚ Update / Modification Anomaly
❖Insertion Anomaly: In above schema if new course is introduced C4, but no
student is there who is having C4 subject.
❖Because of insertion of some data, It is forced to insert some other dummy data.
84
86. Insertion Anomaly cont…
❖Suppose if we want to know the number of students, then answer will be,
4 (S1,S2,S3, xx), which is not correct.
❖Deletion Anomaly:
⮚Deletion of S3 student cause the deletion of course JAVA.
⮚Because of deletion of some data forced to delete some other useful data.
86
87. Update Anomaly
❖ If there is updation in the fee from 5000 to 7000, then we have to update
FEE column in all the rows, else data will become inconsistent.
87
89. Normal Forms
❖Initially E. F. Codd proposed three normal forms namely 1NF, 2NF and
3NF. Subsequently BCNF was jointly introduced by R. Boyce and E. F.
Codd. Later the normal forms 4 NF and 5 NF were produced.
1 NF 2NF 3NF BCNF 4NF 5NF
89
90. Normal Forms
Table with Multivalued attributes
First Normal Form
Second Normal Form
Third Normal Form
Boyce - Codd Normal Form
Fifth Normal Form
Fourth Normal Form
Remove Multivalued
attributes
Remove Partial
Dependencies
Remove Transitive
Dependencies
Remove resulting anomalies
from partial Dependencies
Remove Multivalued
Dependencies
Remove Join Dependencies
90
91. First Normal Form (1 NF)
❖A relation is in first Normal Form if and only if all underlying domains
contain atomic values only. In other words, a relation doesn’t have
Multivalued attributes.
❖Every tuple in the relational schema contains only one value of each
attribute and no repeating groups.
91
92. First Normal Form (1 NF) conti…
❖For example: consider Student relation
SID Sname Cname
S1 A C,C++
S2 B C++,DB
S3 A DB
SID Sname Cname
S1 A C
S1 A C++
S2 B C++
S2 B DB
S3 A DB
Remove
Multivalued
Attribute
92
93. First Normal Form (1 NF) conti…
❖Another Example: Create a database which stores my friends name and
their top three favorite artists. And FID is a primary key of the database.
93
94. First Normal Form (1 NF) conti…
❖Now convert into 1 NF because having Multivalued attribute favoriteartist.
Now we have 02 alternative way to convert into 1NF.
❖ First we can set number of favoriteartist values means he/she can enter
only 02 or 03 values for favoriteartist attribute.
94
95. First Normal Form (1 NF) conti…
FID FNAME favoriteartist1 favoriteartist2 favoriteartist3
1 Shrihari Akon The Corrs Robbie
2 Arvind Enigma Chicane Twania
95
96. First Normal Form (1 NF) conti…
❖But it is not a proper solution because we can not fixed attributes(
Multivalued attribute). So now we decompose the relation:
96
97. Second Normal Form (2 NF)
❖Relation R is in Second Normal Form (2NF) only if :
⮚R should be in 1NF and
⮚R should not contain any Partial Dependency.
❖Partial Dependency: If proper subset of candidate key determines non-
prime attribute, it is called partial dependency.
❖Suppose a relation R(A,B,C,D) and FD’s=>(AB🡺D, B🡺C), AB is a candidate
key.
97
98. Second Normal Form (2 NF)
❖In this example AB is candidate key and B is a proper subset of AB. C is a
non-prime attribute.
❖AB is candidate key means possible values for AB are
❖Means A or B individual can be null. Suppose B is null in that situation B🡺C
not valid. (B can not determines C).
A B
Null A
A Null
A B
98
99. Second Normal Form (2 NF)
❖So this database are not in second normal form.
❖We can convert into 2NF by decomposition of R:
❖R1
❖R2
A B D
Candidate Key: (A,B)
B C
Candidate Key: (B)
99
100. Second Normal Form (2 NF)
❖Now R1 and R2 both are in 2NF.
❖Note: If candidate key contains a single attribute, the test need not to
applied at all.
100
101. Third Normal Form (3 NF)
❖Let R be the relational schema, R is in 3NF only if :
⮚R should be in 2NF.
⮚R should not contain transitive dependencies.
❖Transitive dependencies: Let R be a relational Schema and X,Y,Z be the
attribute sets over R.
❖If X is functionally determines Y (X → Y) and Y is functionally determines Z
(Y → Z) then X is transitive determines Z (X → Z).
101
102. Third Normal Form (3 NF)
❖Example: Suppose a relation R(A,B,C,D) with following dependencies: AB🡺C, C🡺
D.
❖Now first we need to find out candidate key so we can say AB is candidate key.
AB+🡺 ABCD. So {A,B} are prime attribute and {C,D} are non-prime attributes.
❖Now check given relation R in second normal or not.
❖No Partial dependency exist because partial dependencies says every non-prime
attribute not depends on part of candidate key.
102
103. Third Normal Form (3 NF)
❖AB🡺C and C🡺D are in second normal form but not in 3NF because transitive
dependency exist.
❖But what will be the problem due to transitive dependency?
❖Now in this case AB 🡺 C and C🡺D. So AB🡺D with the help of C.
❖Means C is promising that I will find the value of D for AB.
❖But what will be happens when C becomes NULL because C is non- prime
attribute.
103
104. Third Normal Form (3 NF)
❖If C becomes null then we are unable to find D.
❖So need to overcomes this problem or convert relation into 3 NF.
❖For converting 3NF we will make C as a candidate key in decomposed
relation.
❖R1{A,B,C} because C is fully functional dependent on candidate key.
❖R2{C,D} now C is key in this Relation.
104
105. Boyce Codd Normal Form(BCNF)
❖Before understand BCNF we just quick review of 2 NF and 3 NF.
❖In 2 NF we talk about
❖In 3 NF we talk about
❖If we talk about all the combination then we missed :
105
106. Boyce Codd Normal Form(BCNF)
❖Let R be the relational schema, R is in BCNF only if :
⮚R should be in 3NF.
⮚Every Functional Dependency will have a Super-key on the LHS or all determinants
are the super-keys.
❖Example: F = {A → BCD, BC → AD, D → B} of R{ABCD}.
❖Now find candidate keys: A, BC, DC.
106
107. Boyce Codd Normal Form(BCNF)
❖A → BCD // In BCNF.
❖BC → AD // IN BCNF.
❖D → B // not in BCNF because of D is not a super key.
❖So we need to decompose the relation :
❖R1{D B}
❖R2{ADC}
107
108. Acknowledgement and Disclaimer
❖This presentation is the culmination of content extracted from a variety of sources namely
lecture notes, presentations, books and websites. In many cases, the identity of the original
contributor is not available with the author. The author wish to take this opportunity to
thank individual contributors of these extracts.
❖The author wishes to record that this presentation is solely used for education purpose and
copyright violation if any, is unintentional. The author is willing to remove any such extract
from the presentation with immediate effect.
❖The materials available at referred sites are not maintained by Acropolis Institute and we
are not responsible for the contents thereof.
❖All trademarks, service marks, and trade names used in this presentation are the marks of
the respective owner(s).
Dr Kamal Kumar Sethi
Professor & Head, IT
Acropolis Institute(AITR), Indore
kamalsethi@acropolis.in
9 July 2020 108
kamalsethi@acropolis.in