SlideShare a Scribd company logo
Database Processing




              Chapter 5
     The Relational Model and
          Normalization




David M. Kroenke
                                  © 2000 Prentice Hall
Chapter 5


           The Relational Model
  • Broad, flexible model
  • Basis for almost all DBMS products
  • E.F. Codd defined well-structured
    “normal forms” of relations,
    “normalization”


Page 113
                                © 2000 Prentice Hall
Chapter 5


               Relation
  • Two-dimensional table
  • Rows are tuples
  • Columns are attributes




Page 113
                             © 2000 Prentice Hall
Equivalent Relational Terms




Page 114
            Figure 5-1   © 2000 Prentice Hall
Functional Dependency
   “relationship between or among
     attributes”




Page 114
                Figure 5-2          © 2000 Prentice Hall
Chapter 5

       Functional Dependency
              Notation

  SID  Major
  ComputerSerialNumber  MemorySize

  (SID, ClassName)  Grade

Page 115
                             © 2000 Prentice Hall
Key
  “a group of one or more attributes that
    uniquely identifies a row”




Page 116
                Figure 5-3        © 2000 Prentice Hall
Combination Key




Page 117
               Figure 5-4    © 2000 Prentice Hall
Chapter 5


           Normalization
  “the process of evaluating and
    converting a relation to reduce
    modification anomalies”




Page 118
                                  © 2000 Prentice Hall
Chapter 5


                Anomaly
  “an undesirable consequence of data
    modification in which two or more
    different themes are entered
    (insertion anomaly) in a single row or
    two or more themes are lost if the
    row is deleted (deletion anomaly)”

Page 118
                                   © 2000 Prentice Hall
Chapter 5


           Normal Forms
  “classes of relations and techniques for
    preventing anomalies”

  DK/NF = Domain Key Normal Form
  (free of modification anomalies)


Page 118
                                  © 2000 Prentice Hall
First Normal Form
“any table of data that meets the
  definition of a relation”




              Figure 5-3       © 2000 Prentice Hall
Second Normal Form
“when all of a relation’s nonkey attributes
  are dependent on all of the key”




                 Figure 5-5        © 2000 Prentice Hall
Third Normal Form
“if it is in second normal form and has
  no transitive dependencies”




               Figure 5-7        © 2000 Prentice Hall
Boyce-Codd Normal Form
“if every determinant is a candidate key”




               Figure 5-8       © 2000 Prentice Hall
Fourth Normal Form
“if in BCNF and has no multi-value
  dependencies”




              Figure 5-11       © 2000 Prentice Hall
Chapter 5


           Fifth Normal Form



                ?
Page 125
                           © 2000 Prentice Hall
Chapter 5


    Domain Key Normal Form
  “if every constraint on the relation is a
    logical consequence of the definition
    of keys and domains”




Page 125
                                   © 2000 Prentice Hall
Chapter 5


           DK/NF Terms
  • Constraint “a rule governing static
    values of attributes”
  • Key “unique identifier of a tuple”
  • Domain “description of an
    attribute’s allowed values”


Page 126
                                 © 2000 Prentice Hall
DK/NF Example




    Figure 5-13   © 2000 Prentice Hall
DK/NF Example




   Figure 5-15   © 2000 Prentice Hall
DK/NF Example




   Figure 5-16   © 2000 Prentice Hall
Summary of Normal Forms




        Figure 5-18   © 2000 Prentice Hall
Chapter 5


           A  B relationships
   A  B and B  A           one-to-one
   A  B but B not  A       many-to-one
   A not  B and B not  A   many-to-many




Page 131
                                 © 2000 Prentice Hall
Summary of Relationships




        Figure 5-19   © 2000 Prentice Hall
Chapter 5


            Optimization
  • De-Normalization
  • Controlled Redundancy




Page 135
                            © 2000 Prentice Hall

More Related Content

What's hot

Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
Mudasir Qazi
 
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
Oum Saokosal
 
Normalization
NormalizationNormalization
Normalization
thuvarakan28
 
Normalization
NormalizationNormalization
Normalization
ochesing
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
Bishrul Haq
 
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 databasesJafar Nesargi
 
Oracle SQL 1 Day Tutorial
Oracle SQL 1 Day TutorialOracle SQL 1 Day Tutorial
Oracle SQL 1 Day Tutorial
Chien Chung Shen
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
Prosanta Ghosh
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal formcollege
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Sakshi Jaiswal
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
Normalization in SQL | Edureka
Normalization in SQL | EdurekaNormalization in SQL | Edureka
Normalization in SQL | Edureka
Edureka!
 
Lenguaje estructurado de consulta
Lenguaje estructurado de consultaLenguaje estructurado de consulta
Lenguaje estructurado de consulta
Maria Garcia
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
Harsiddhi Thakkar
 
Normalization
NormalizationNormalization
Normalization
Altafsoomro
 
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
Biplap Bhattarai
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Rakhi Mukherji
 
CONCURRENCY CONTOL notes.pdf
CONCURRENCY CONTOL notes.pdfCONCURRENCY CONTOL notes.pdf
CONCURRENCY CONTOL notes.pdf
BijayNag1
 

What's hot (20)

Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
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
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
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
 
Oracle SQL 1 Day Tutorial
Oracle SQL 1 Day TutorialOracle SQL 1 Day Tutorial
Oracle SQL 1 Day Tutorial
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Normalization in SQL | Edureka
Normalization in SQL | EdurekaNormalization in SQL | Edureka
Normalization in SQL | Edureka
 
Lenguaje estructurado de consulta
Lenguaje estructurado de consultaLenguaje estructurado de consulta
Lenguaje estructurado de consulta
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
 
Normalization
NormalizationNormalization
Normalization
 
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
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
CONCURRENCY CONTOL notes.pdf
CONCURRENCY CONTOL notes.pdfCONCURRENCY CONTOL notes.pdf
CONCURRENCY CONTOL notes.pdf
 

Normalization

  • 1. Database Processing Chapter 5 The Relational Model and Normalization David M. Kroenke © 2000 Prentice Hall
  • 2. Chapter 5 The Relational Model • Broad, flexible model • Basis for almost all DBMS products • E.F. Codd defined well-structured “normal forms” of relations, “normalization” Page 113 © 2000 Prentice Hall
  • 3. Chapter 5 Relation • Two-dimensional table • Rows are tuples • Columns are attributes Page 113 © 2000 Prentice Hall
  • 4. Equivalent Relational Terms Page 114 Figure 5-1 © 2000 Prentice Hall
  • 5. Functional Dependency “relationship between or among attributes” Page 114 Figure 5-2 © 2000 Prentice Hall
  • 6. Chapter 5 Functional Dependency Notation SID  Major ComputerSerialNumber  MemorySize (SID, ClassName)  Grade Page 115 © 2000 Prentice Hall
  • 7. Key “a group of one or more attributes that uniquely identifies a row” Page 116 Figure 5-3 © 2000 Prentice Hall
  • 8. Combination Key Page 117 Figure 5-4 © 2000 Prentice Hall
  • 9. Chapter 5 Normalization “the process of evaluating and converting a relation to reduce modification anomalies” Page 118 © 2000 Prentice Hall
  • 10. Chapter 5 Anomaly “an undesirable consequence of data modification in which two or more different themes are entered (insertion anomaly) in a single row or two or more themes are lost if the row is deleted (deletion anomaly)” Page 118 © 2000 Prentice Hall
  • 11. Chapter 5 Normal Forms “classes of relations and techniques for preventing anomalies” DK/NF = Domain Key Normal Form (free of modification anomalies) Page 118 © 2000 Prentice Hall
  • 12. First Normal Form “any table of data that meets the definition of a relation” Figure 5-3 © 2000 Prentice Hall
  • 13. Second Normal Form “when all of a relation’s nonkey attributes are dependent on all of the key” Figure 5-5 © 2000 Prentice Hall
  • 14. Third Normal Form “if it is in second normal form and has no transitive dependencies” Figure 5-7 © 2000 Prentice Hall
  • 15. Boyce-Codd Normal Form “if every determinant is a candidate key” Figure 5-8 © 2000 Prentice Hall
  • 16. Fourth Normal Form “if in BCNF and has no multi-value dependencies” Figure 5-11 © 2000 Prentice Hall
  • 17. Chapter 5 Fifth Normal Form ? Page 125 © 2000 Prentice Hall
  • 18. Chapter 5 Domain Key Normal Form “if every constraint on the relation is a logical consequence of the definition of keys and domains” Page 125 © 2000 Prentice Hall
  • 19. Chapter 5 DK/NF Terms • Constraint “a rule governing static values of attributes” • Key “unique identifier of a tuple” • Domain “description of an attribute’s allowed values” Page 126 © 2000 Prentice Hall
  • 20. DK/NF Example Figure 5-13 © 2000 Prentice Hall
  • 21. DK/NF Example Figure 5-15 © 2000 Prentice Hall
  • 22. DK/NF Example Figure 5-16 © 2000 Prentice Hall
  • 23. Summary of Normal Forms Figure 5-18 © 2000 Prentice Hall
  • 24. Chapter 5 A  B relationships A  B and B  A one-to-one A  B but B not  A many-to-one A not  B and B not  A many-to-many Page 131 © 2000 Prentice Hall
  • 25. Summary of Relationships Figure 5-19 © 2000 Prentice Hall
  • 26. Chapter 5 Optimization • De-Normalization • Controlled Redundancy Page 135 © 2000 Prentice Hall