Professional Documents
Culture Documents
Chittaranjan Pradhan
Bad Database
System 15 Design/Concept of
Anomalies
Functional
Chittaranjan Pradhan
School of Computer Engineering,
KIIT University
15.1
Database Design
Database Design
Chittaranjan Pradhan
Database Design
Database Design
• First characterize fully the data requirements of the Bad Database
prospective database users, which usually involves in Design/Concept of
Anomalies
textual descriptions Functional
Dependency(FD)
• Next, choose ER model to translate these requirements Trivial FDs and Non-Trivial
FDs
into a conceptual schema of the database Armstrong’s Inference
Axioms
• In the logical design phase, map the high level conceptual Logical Implication
Closure of a Set of
schema onto the implementation data model of the Functional Dependencies
Closure of a Set of
database system that will be used. The implementation Attributes
Redundancy of FDs
Bad Database
It is the anomaly in which the user cannot insert a fact about an Design/Concept of
Anomalies
entity until he/she has an additional fact about another entity. In Functional
other words, there are circumstances in which certain facts can Dependency(FD)
Trivial FDs and Non-Trivial
not be recorded at all. FDs
Armstrong’s Inference
Axioms
Logical Implication
Ex: We cannot record a new prof details without assigning a Closure of a Set of
Functional Dependencies
15.4
Database Design
Bad Database Design/Concept of Anomalies...
Chittaranjan Pradhan
Database Design
Bad Database
Design/Concept of
Anomalies
Updation Anomaly
Functional
Dependency(FD)
It is the anomaly in which the modification in the value of Trivial FDs and Non-Trivial
that value occurs. In other words, the same data can be Axioms
Logical Implication
single row only, then the updation process will put the database
in an inconsistent state so that the phone_no of Mahesh will
give conflicting answers
15.5
Database Design
Functional Dependency(FD)
Chittaranjan Pradhan
Bad Database
Functional Dependency is the building block of normalization Design/Concept of
Anomalies
principles
Functional
Dependency(FD)
Trivial FDs and Non-Trivial
Attribute(s) A in a relation schema R functionally determines FDs
Armstrong’s Inference
another attribute(s) B in R if for a given value a1 of A; there is a Axioms
Logical Implication
single, specific value b1 of B in relation r of R Closure of a Set of
Functional Dependencies
Closure of a Set of
Attributes
The symbolic expression of this FD is: Redundancy of FDs
15.6
Database Design
Functional Dependency(FD)...
Chittaranjan Pradhan
Database Design
Functional Dependency(FD) Bad Database
Design/Concept of
From Student schema, we can infer that Name→Phone_no Anomalies
Functional
because all tuples of Student with a given Name value also Dependency(FD)
have the same Phone_no value Trivial FDs and Non-Trivial
FDs
Armstrong’s Inference
Axioms
Likewise, it can also be inferred that Prof→Grade. At the same Logical Implication
Closure of a Set of
time, notice that Grade does not determine Prof Functional Dependencies
Closure of a Set of
Attributes
Redundancy of FDs
15.7
Database Design
Trivial FDs and Non-Trivial FDs
Chittaranjan Pradhan
Trivial FDs
Database Design
A functional dependency X→Y is a trivial functional Bad Database
dependency if Y is a subset of X Design/Concept of
Anomalies
Functional
For example, {Name, Course}→Course. If two records have the Dependency(FD)
Trivial FDs and Non-Trivial
same values on both the Name and Course attributes, then FDs
Armstrong’s Inference
Functional
Dependency(FD)
Let R(X, Y, Z, W) where X, Y, Z, and W are arbitrary subsets of Trivial FDs and Non-Trivial
FDs
the set of attributes of a universal relation schema R Armstrong’s Inference
Axioms
Logical Implication
Closure of a Set of
The three fundamental inference rules are: Functional Dependencies
Closure of a Set of
• Reflexivity Rule: If Y is a subset of X, then X→Y (Trivial Attributes
Redundancy of FDs
15.9
Database Design
Armstrong’s Inference Axioms...
Chittaranjan Pradhan
Database Design
F|=A→D
15.11
Database Design
Closure of a Set of Functional Dependencies
Chittaranjan Pradhan
Database Design
15.13
Database Design
Closure of a Set of Attributes
Chittaranjan Pradhan
{A}+ = {A, C}, {B}+ = {B, D}, {C}+ ={C}, {D}+ ={D},
{A, B}+ = {A, B, C, D}, {A, C}+ = {A, C}, {A, D}+ = {A, C, D},
{B, C}+ = {B, C, D}, {B, D}+ = {B, D}, {C, D}+ = {C, D},
{A, B, C}+ = {A, B, C, D}, {A, B, D}+ = {A, B, C, D},
{B, C, D}+ = {B, C, D}, {A, B, C, D}+ = {A, B, C, D}
Database Design
Bad Database
Design/Concept of
Anomalies
Uses of Attribute Closure:
Functional
Dependency(FD)
• Testing for key: To test whether X is a key or not, X + is Trivial FDs and Non-Trivial
FDs
X+ Canonical Cover/Minimal
Cover
15.15
Database Design
Redundancy of FDs
Chittaranjan Pradhan
Redundancy of FDs
Given a set of functional dependencies F, a functional Database Design
Functional
FDs F - {A→B} Dependency(FD)
Eliminating redundant functional dependencies allows us to Trivial FDs and Non-Trivial
FDs
redundant
Ex: F= {A→B, B→C, A→{C, D}} can be simplified to {A→B,
B→C, A→D}
Bad Database
For a given set F of FDs, a canonical cover, denoted by Fc , is a Design/Concept of
Anomalies
set of FDs where the following conditions are satisfied: Functional
Dependency(FD)
• F and Fc are equivalent Trivial FDs and Non-Trivial
FDs
• Every FD of Fc is simple. That is, the RHS of every Armstrong’s Inference
Axioms
functional dependency of Fc has only one attribute Logical Implication
Closure of a Set of
Fc = {A→B, B→C}
15.17