SlideShare una empresa de Scribd logo
1 de 27
•   Introduction
•   Characteristics Of “BAD” Schema
•   What Is Functional Dependency?
•   Armstrong’s Reference Rules
•   Equivalence & Minimal Cover
•   Normalization
•   Normalization Types And Details
•   BCNF
•   Higher Normal Forms
•   De-Normalization
•   Multi-valued Dependencies(MVD)
•   Join Dependencies
•   Inclusion Dependencies
•   Conclusion
•   References
• The main aim for Database Design is coming up with “GOOD” schema.
• Problem-
      1.How do we characterize the “GOODNESS” of a schema?

     2.If two or more alternative schemas are available ,
       how do we compare them?

     3.What are the problems with “BAD” schema?

• An example-
• Redundant storage of DATA
     - Office Phone & HOD info – stored redundantly-wastage of disk space

• A program that updates Office Phone of a department must change it at
several places
     - more running time & error prone

ANOMALIES-

 a. Insertion anomaly - No way of inserting info about a new department
unless we also enter details of a (dummy) student in department.

 b. Deletion anomaly – If all students of a certain department leave and we
delete their tuples , information about department itself is lost .

 c. Update anomaly – Updating office phone of a department
                 1. value in several tuples need to be changed
                 2.if a tuple is missed-inconsistency in data
• Functional dependencies (FDs) are used to specify formal measures of the
"goodness" of relational designs
• FDs and keys are used to define normal forms for relations.

NORMAL FORMS -
   1. Each NF specifies certain conditions.
   2. If the conditions are satisfied by the schema certain kind of problems
      are avoided
                                               Consider the schema
                                               Student(s.name,rollno.,gender,dept,
                                               h.name,roomno.}

                                                 Since rollno. Is a key,
                                                 Rollno. →{s.name,gender,dept,
                                                            h.name,roomno.}

                                                 Let each student is given a hostel room,
                                                 Then h.name,roomno. → rollno.
•Armstrong shows that
 Rules 1,2,3 are
sound &
 Complete.

•These are called
Armstrong’s
Axioms(AA)

SOUNDNESS-

•Every new FD X → Y
 Derived from a given
set of FDs
 F using AA is such
that F ╞ {X → Y)
COMPLETENESS-

• Any FD X→Y logically implied by F (i.e. F╞ {X→Y} ) can be derived from F
  using AA

CLOSURE OF A SET OF FDs-

• Closure of a set of FDs is the set F+ of all the FDs that can be inferred from F.
• Closure of a set of attributes X w.r.t F is the set of X + of all attributes that are
  Functionally determined by X
Ex- P{a, b, c, d, e, f}
      set of FDs F on it, as follows:
      F={a → d, b →{e, f}, {a, b }→ c}
     F+ :the closure of F
     a + ={a, d}
     b + ={b, e, f}
     {a, b} + ={a, b, c, d, e, f}
• EQUIVALENCE of sets of FDs:
   Two sets of FDs F & G are equivalent if F =G i.e. Every FD in F can be
   inferred from G & every FD in G can be inferred from F.

• EXTRANEOUS ATTRIBUTE:
   The removal of which attribute doesn’t change F + .
   Ex- Given F={A → C, AB → C}
   B is extraneous in AB → C as A → C logically implies AB → C .

• MINIMAL COVER:
 A minimal cover of a set of FDs G is a minimal set of dependencies F
   that is equivalent to E.
 Here F + =G +, if we modify G by deleting an FD or by deleting attribute
   From an FD in G, the closure changes.
 RHS of each FD in G is a single attribute.

Ex-{A → B, ABCD → E, EF → GH, ACDF → EG} has the following
   minimal Cover: {A → B, ACD → E, EF → G, EF → H}
Functional
                            dependency
 No transitive
                            of nonkey
 dependency
                            attributes on
 between
                            the primary
 nonkey
 attributes
                  Boyce-    key - Atomic
                            values only
                 Codd and
                  Higher    Full
All
determinants                Functional
are candidate               dependency
keys - Single               of nonkey
multivalued                 attributes on
dependency                  the primary
                            key
• Un-normalized relations:
   First step in normalization is to convert the data into 2D table.
   Data can be repeated within a column.

• First Normal Form (1 NF)
   Only atomic values at each row and column.

• Second Normal Form (2 NF)
 A relation is said to be in Second Normal Form when every non-key
attribute is fully functionally dependent on the primary key.

 Applicable for composite key & when there is composite key , there
may exist partial FD, which 2NF denies, So to get 2NF we have to
Decompose it into Relation schema.

   After Decomposition , it is Lossless or NOT should be verified.
•   Full Functional Dependency:

A FD X → Y is said to be a FULL FD if after removal of any attribute from
X, the FD doesn’t hold good anymore.

•   Partial Functional Dependency:

A FD X → Y is partial FD if {X-A} → Y is also true.

•   Decomposition:

 Let R=(A,B,C,D)

     X=(P,Q,S,T) st. R= P υ Q υ S υ T

 Replacing R by P,Q,S,T- process of decomposing R
DESIRABLE PROPERTIES OF DECOMPOSITION:

•   Not all Decomposition of a schema are useful.
•   We require two properties to be satisfied.

    Lossless join property- The information in an instance r of R
      must be preserved in the instances .

* If R is decomposed into P , Q and P ∩ Q ≠ Φ , then it is lossless.

    Dependency preserving property:- if a set F of dependencies
      hold on R it should be possible to enforcing appropriate
      dependencies on each r.
• EID → Name, Address, Birthdate
• EID, Pname → StartDate
• Candidate key is {EID, PName}.
• The nonprime attributes are Name, Address, Birthdate, StartDate.
• Nonprime attributes Name, Address, Birthdate violate 2NF because they
are functionally dependent
• 2NF, plus no transitive functional dependencies.
• Given three attributes in a relation A, B, C, if A  B and B  C, this
forms a transitive functional dependency.
• Avoid transitive dependencies for 3NF
Ex-


                                                            Here,
                                                            Customer_ID
                                                            
                                                             Salesperson,
                                                            and
                                                            Salesperson
                                                            Region,
                                                            cause a
                                                            transitive
                                                            dependency
Solution:
• Most 3NF relations are also BCNF relations.
• A 3NF relation is NOT in BCNF if:
     Candidate keys in the relation are composite keys (they are not
    single attributes)
     There is more than one candidate key in the relation, and
     The keys are not disjoint, that is, some attributes in the keys are
    common
    Patient # Patient Name Patient Address
                          15 New St. New
         1111 John White York, NY
                          10 Main St. Rye,
         1234 Mary Jones NY
              Charles     Dogwood Lane
         2345 Brown       Harrison, NY
                          55 Boston Post
         4876 Hal Kane    Road, Chester,
                          Blind Brook
         5123 Paul Kosher Mamaroneck, NY
                          Hilton Road
         6845 Ann Hood    Larchmont, NY
Fourth Normal Form ( 4 NF)
• Any relation is in Fourth Normal Form if it is BCNF and any multi-valued dependencies are
   trivial
• Eliminate non-trivial multi-valued dependencies by projecting into simpler tables

JOIN DEPENDENCIES
• A join dependency denoted by JD (R1,R2,R3,……Rn), specified on relational schema
  R specifies a constraint on the states r of R. The constraint states that every legal
  state r of R should have a non-additive join decomposition into R1,R2,….. Rn
 NOTE - An MVD is a special case of JD where n=2
         i.e. a JD denoted as JD (R1,R2)
               implies an MVD (R1∩R2) →→(R1-R2)

Fifth Normal Form
• A relation is in 5NF if every join dependency in the relation is implied by the keys of the
  relation.
• Implies that relations that have been decomposed in previous NF can be recombined
   via natural joins to recreate the original relation
• De-normalization is the process of modifying a
perfectly normalized database design for performance
reasons.

• It is a natural and necessary part of database
design, but must follow proper normalization.

• It always makes your system potentially less
efficient and flexible.

  So de-normalize as needed, but not frivolously.
Customer        After:    Customer
Before:
            ID                        ID
            Address                   Address
            Name                      Name
            Telephone                 Telephone


          Order                      Order
          Order No                   Order No
          Date Taken                 Date Taken
          Date Dispatched            Date Dispatched
          Date Invoiced              Date Invoiced
          Cust ID                    Cust ID
                                     Cust Name
• The foreign key(or referential integrity)constraint can not be specified as
a functional or multi-valued dependency because it relates attributes across
relations.

• An ID R.X<S.Y between two sets of attributes – X of relation schema R &
y of relation schema S – specifies the constraint that at any specific time
when r is a relation state of R and s a relation state of S , we have

                        ╥y(s(S)) ⊇ ╥x(r(R))

 Condition

• X of R and Y of S must have same no. of attribute.
• The domains for each pair of corresponding attribute should be
compatible.

 So far no normal form have been developed based on ID
• After we have the ER diagrams each relation in the schema must be
independently reviewed and normalized when needed.

• Functional dependencies are the building blocks that enable the
analysis of data redundancy and the elimination of anomalies caused
by data redundancy through the process of normalization

• Normalization is a technique that facilitates systematic validation
of participation of attributes in a relation schema from a perspective
of data redundancy.

• This process gives us the final opportunity to correct errors and
establish a robust design before implementing the database system
• Fundamentals of Database systems,5th edition by Ramez Elmasari,
Shamkant B. Navathe

• Database system concepts by A. Seilberschatz, H. korth, S
Sudersan

•    An introduction to Database system by C.J. Date

• Lotito, J. (2001). Concepts of Database Design and Management.
Retrived September 2007 from
http://www.sitepoint.com/article/database-design-management

•    Scamell, R.W., & Umanath N.S. (2007). Data Modeling and
    Database Design: Boston, MA: Thomson
Theory of dependencies in relational database
Theory of dependencies in relational database

Más contenido relacionado

La actualidad más candente

12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
koolkampus
 

La actualidad más candente (20)

File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
joins in database
 joins in database joins in database
joins in database
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Chapter-7 Relational Calculus
Chapter-7 Relational CalculusChapter-7 Relational Calculus
Chapter-7 Relational Calculus
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
Structure of dbms
Structure of dbmsStructure of dbms
Structure of dbms
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
DBMS Canonical cover
DBMS Canonical coverDBMS Canonical cover
DBMS Canonical cover
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Slide 4 dbms users
Slide 4 dbms usersSlide 4 dbms users
Slide 4 dbms users
 

Destacado

Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
Databaseconcepts
DatabaseconceptsDatabaseconcepts
Databaseconcepts
kissumadanu
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependency
avniS
 

Destacado (20)

functional dependencies with example
functional dependencies with examplefunctional dependencies with example
functional dependencies with example
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Databaseconcepts
DatabaseconceptsDatabaseconcepts
Databaseconcepts
 
Bsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalizationBsc cs ii-dbms-u-iv-normalization
Bsc cs ii-dbms-u-iv-normalization
 
Normalization
NormalizationNormalization
Normalization
 
1 fn dependency
1 fn dependency1 fn dependency
1 fn dependency
 
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi  DATABASE FUNCTIONAL DEPENDENCY QUESTIONShashi  DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
 
Multivalued dependency
Multivalued dependencyMultivalued dependency
Multivalued dependency
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
 
Ch7
Ch7Ch7
Ch7
 
Normalization
NormalizationNormalization
Normalization
 
Normlaization
NormlaizationNormlaization
Normlaization
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization
NormalizationNormalization
Normalization
 

Similar a Theory of dependencies in relational database

Similar a Theory of dependencies in relational database (20)

chapter_8.pptx
chapter_8.pptxchapter_8.pptx
chapter_8.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Normalisation
NormalisationNormalisation
Normalisation
 
Normal forms & Normalization.pptx
Normal forms & Normalization.pptxNormal forms & Normalization.pptx
Normal forms & Normalization.pptx
 
UNIT-IV.ppt
UNIT-IV.pptUNIT-IV.ppt
UNIT-IV.ppt
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization1
Normalization1Normalization1
Normalization1
 
Database Systems - Normalization of Relations(Chapter 4/3)
Database Systems - Normalization of Relations(Chapter 4/3)Database Systems - Normalization of Relations(Chapter 4/3)
Database Systems - Normalization of Relations(Chapter 4/3)
 
functional dependency in engineering.pptx
functional dependency in engineering.pptxfunctional dependency in engineering.pptx
functional dependency in engineering.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Database Presentation
Database PresentationDatabase Presentation
Database Presentation
 
Chapter10
Chapter10Chapter10
Chapter10
 
DBMS 3.pdf
DBMS 3.pdfDBMS 3.pdf
DBMS 3.pdf
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdf
 
Distributed DBMS - Unit 2 - Overview of RDBMS
Distributed DBMS - Unit 2 - Overview of RDBMSDistributed DBMS - Unit 2 - Overview of RDBMS
Distributed DBMS - Unit 2 - Overview of RDBMS
 
Normal forms.ppt
Normal forms.pptNormal forms.ppt
Normal forms.ppt
 
Normalization
NormalizationNormalization
Normalization
 

Último

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
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

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...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Theory of dependencies in relational database

  • 1.
  • 2. Introduction • Characteristics Of “BAD” Schema • What Is Functional Dependency? • Armstrong’s Reference Rules • Equivalence & Minimal Cover • Normalization • Normalization Types And Details • BCNF • Higher Normal Forms • De-Normalization • Multi-valued Dependencies(MVD) • Join Dependencies • Inclusion Dependencies • Conclusion • References
  • 3. • The main aim for Database Design is coming up with “GOOD” schema. • Problem- 1.How do we characterize the “GOODNESS” of a schema? 2.If two or more alternative schemas are available , how do we compare them? 3.What are the problems with “BAD” schema? • An example-
  • 4. • Redundant storage of DATA - Office Phone & HOD info – stored redundantly-wastage of disk space • A program that updates Office Phone of a department must change it at several places - more running time & error prone ANOMALIES- a. Insertion anomaly - No way of inserting info about a new department unless we also enter details of a (dummy) student in department. b. Deletion anomaly – If all students of a certain department leave and we delete their tuples , information about department itself is lost . c. Update anomaly – Updating office phone of a department 1. value in several tuples need to be changed 2.if a tuple is missed-inconsistency in data
  • 5. • Functional dependencies (FDs) are used to specify formal measures of the "goodness" of relational designs • FDs and keys are used to define normal forms for relations. NORMAL FORMS - 1. Each NF specifies certain conditions. 2. If the conditions are satisfied by the schema certain kind of problems are avoided Consider the schema Student(s.name,rollno.,gender,dept, h.name,roomno.} Since rollno. Is a key, Rollno. →{s.name,gender,dept, h.name,roomno.} Let each student is given a hostel room, Then h.name,roomno. → rollno.
  • 6.
  • 7.
  • 8. •Armstrong shows that Rules 1,2,3 are sound & Complete. •These are called Armstrong’s Axioms(AA) SOUNDNESS- •Every new FD X → Y Derived from a given set of FDs F using AA is such that F ╞ {X → Y)
  • 9. COMPLETENESS- • Any FD X→Y logically implied by F (i.e. F╞ {X→Y} ) can be derived from F using AA CLOSURE OF A SET OF FDs- • Closure of a set of FDs is the set F+ of all the FDs that can be inferred from F. • Closure of a set of attributes X w.r.t F is the set of X + of all attributes that are Functionally determined by X Ex- P{a, b, c, d, e, f} set of FDs F on it, as follows: F={a → d, b →{e, f}, {a, b }→ c} F+ :the closure of F a + ={a, d} b + ={b, e, f} {a, b} + ={a, b, c, d, e, f}
  • 10. • EQUIVALENCE of sets of FDs: Two sets of FDs F & G are equivalent if F =G i.e. Every FD in F can be inferred from G & every FD in G can be inferred from F. • EXTRANEOUS ATTRIBUTE: The removal of which attribute doesn’t change F + . Ex- Given F={A → C, AB → C} B is extraneous in AB → C as A → C logically implies AB → C . • MINIMAL COVER:  A minimal cover of a set of FDs G is a minimal set of dependencies F that is equivalent to E.  Here F + =G +, if we modify G by deleting an FD or by deleting attribute From an FD in G, the closure changes.  RHS of each FD in G is a single attribute. Ex-{A → B, ABCD → E, EF → GH, ACDF → EG} has the following minimal Cover: {A → B, ACD → E, EF → G, EF → H}
  • 11. Functional dependency No transitive of nonkey dependency attributes on between the primary nonkey attributes Boyce- key - Atomic values only Codd and Higher Full All determinants Functional are candidate dependency keys - Single of nonkey multivalued attributes on dependency the primary key
  • 12. • Un-normalized relations: First step in normalization is to convert the data into 2D table. Data can be repeated within a column. • First Normal Form (1 NF) Only atomic values at each row and column. • Second Normal Form (2 NF)  A relation is said to be in Second Normal Form when every non-key attribute is fully functionally dependent on the primary key.  Applicable for composite key & when there is composite key , there may exist partial FD, which 2NF denies, So to get 2NF we have to Decompose it into Relation schema.  After Decomposition , it is Lossless or NOT should be verified.
  • 13. Full Functional Dependency: A FD X → Y is said to be a FULL FD if after removal of any attribute from X, the FD doesn’t hold good anymore. • Partial Functional Dependency: A FD X → Y is partial FD if {X-A} → Y is also true. • Decomposition:  Let R=(A,B,C,D) X=(P,Q,S,T) st. R= P υ Q υ S υ T  Replacing R by P,Q,S,T- process of decomposing R
  • 14. DESIRABLE PROPERTIES OF DECOMPOSITION: • Not all Decomposition of a schema are useful. • We require two properties to be satisfied.  Lossless join property- The information in an instance r of R must be preserved in the instances . * If R is decomposed into P , Q and P ∩ Q ≠ Φ , then it is lossless.  Dependency preserving property:- if a set F of dependencies hold on R it should be possible to enforcing appropriate dependencies on each r.
  • 15. • EID → Name, Address, Birthdate • EID, Pname → StartDate • Candidate key is {EID, PName}. • The nonprime attributes are Name, Address, Birthdate, StartDate. • Nonprime attributes Name, Address, Birthdate violate 2NF because they are functionally dependent
  • 16. • 2NF, plus no transitive functional dependencies. • Given three attributes in a relation A, B, C, if A  B and B  C, this forms a transitive functional dependency. • Avoid transitive dependencies for 3NF Ex- Here, Customer_ID  Salesperson, and Salesperson Region, cause a transitive dependency
  • 18. • Most 3NF relations are also BCNF relations. • A 3NF relation is NOT in BCNF if:  Candidate keys in the relation are composite keys (they are not single attributes)  There is more than one candidate key in the relation, and  The keys are not disjoint, that is, some attributes in the keys are common Patient # Patient Name Patient Address 15 New St. New 1111 John White York, NY 10 Main St. Rye, 1234 Mary Jones NY Charles Dogwood Lane 2345 Brown Harrison, NY 55 Boston Post 4876 Hal Kane Road, Chester, Blind Brook 5123 Paul Kosher Mamaroneck, NY Hilton Road 6845 Ann Hood Larchmont, NY
  • 19.
  • 20. Fourth Normal Form ( 4 NF) • Any relation is in Fourth Normal Form if it is BCNF and any multi-valued dependencies are trivial • Eliminate non-trivial multi-valued dependencies by projecting into simpler tables JOIN DEPENDENCIES • A join dependency denoted by JD (R1,R2,R3,……Rn), specified on relational schema R specifies a constraint on the states r of R. The constraint states that every legal state r of R should have a non-additive join decomposition into R1,R2,….. Rn NOTE - An MVD is a special case of JD where n=2 i.e. a JD denoted as JD (R1,R2) implies an MVD (R1∩R2) →→(R1-R2) Fifth Normal Form • A relation is in 5NF if every join dependency in the relation is implied by the keys of the relation. • Implies that relations that have been decomposed in previous NF can be recombined via natural joins to recreate the original relation
  • 21. • De-normalization is the process of modifying a perfectly normalized database design for performance reasons. • It is a natural and necessary part of database design, but must follow proper normalization. • It always makes your system potentially less efficient and flexible. So de-normalize as needed, but not frivolously.
  • 22. Customer After: Customer Before: ID ID Address Address Name Name Telephone Telephone Order Order Order No Order No Date Taken Date Taken Date Dispatched Date Dispatched Date Invoiced Date Invoiced Cust ID Cust ID Cust Name
  • 23. • The foreign key(or referential integrity)constraint can not be specified as a functional or multi-valued dependency because it relates attributes across relations. • An ID R.X<S.Y between two sets of attributes – X of relation schema R & y of relation schema S – specifies the constraint that at any specific time when r is a relation state of R and s a relation state of S , we have ╥y(s(S)) ⊇ ╥x(r(R))  Condition • X of R and Y of S must have same no. of attribute. • The domains for each pair of corresponding attribute should be compatible.  So far no normal form have been developed based on ID
  • 24. • After we have the ER diagrams each relation in the schema must be independently reviewed and normalized when needed. • Functional dependencies are the building blocks that enable the analysis of data redundancy and the elimination of anomalies caused by data redundancy through the process of normalization • Normalization is a technique that facilitates systematic validation of participation of attributes in a relation schema from a perspective of data redundancy. • This process gives us the final opportunity to correct errors and establish a robust design before implementing the database system
  • 25. • Fundamentals of Database systems,5th edition by Ramez Elmasari, Shamkant B. Navathe • Database system concepts by A. Seilberschatz, H. korth, S Sudersan • An introduction to Database system by C.J. Date • Lotito, J. (2001). Concepts of Database Design and Management. Retrived September 2007 from http://www.sitepoint.com/article/database-design-management • Scamell, R.W., & Umanath N.S. (2007). Data Modeling and Database Design: Boston, MA: Thomson