SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
Database Normalization
●   Overview
    –   Definition of database normalization

    –   Why normalize?

    –   First normal form

    –   Second normal form

    –   Third normal form
        Information for this presentation borrowed from
         http://www.devshed.com/c/a/MySQL/An-Introduction-to-Database-Normalization/
Database Normalization
●   Definition
    –   Optimizing table structures

    –   Removing duplicate data entries

    –   Accomplished by thouroughly investigating the
        various data types and their relationships with
        one another

    –   Follows a series of normalization “forms” or
        states
Database Normalization
●   Why Normalize?
    –   Improved speed

    –   More efficient use of space

    –   Increased data integrity
         ●   (decreased chance that data can get messed up due
             to maintenance)
Database Normalization
●   A sad, sad database:
    –   Refer to the following poor database design:
         student_id   class_name      time      location   professor_id
        999-40-9876    Math 148     MWF 11:30   Rm. 432      prof145
        999-43-0987   Physics 113    TR 1:30    Rm. 12       prof143
        999-42-9842    Botany 42     F 12:45     Rm. 9       prof167
        999-41-9832    Matj 148     MWF 11:30   Rm. 432      prof145


    –   Problems
         ●   no need to repeatedly store the class time and
             professor ID
         ●   redundancy introduces the possibility for error (Matj
             148)
Database Normalization
●   First Normal Form
    –   calls for the elimination of repeated groups of
        data by creating separate tables of related data
    –   Student information:
           StudentID   StudentName   Major   college   collegeLocation


    –   Class information:
           StudentID   ClassID       ClassName


    –   Professor Information:
           ProfessorID ProfessorName
Database Normalization
●   Second Normal Form
    –   Elimination of redundant data
         ●   Example data in Class Information:
              studentID           classID   className
              134-56-7890         M148      Math 148
              123-45-7894         P113      Physics 113
              534-98-9009         H151      History 151
              134-56-7890         H151      History 151


             Use:                                      To get Class Information:
               ClassID      ClassName                        studentID     classID
               M148         Math 148                         134-56-7890   M148
               P113         Physics 113                      123-45-7894   P113
               H151         History 151                      534-98-9009   H151
                                                             134-56-7890   H151
Database Normalization
●   Third Normal Form
    –   eliminate all attributes(column headers) from a
        table that are not directly dependent upon the
        primary key
         ●   college and collegeLocation attributes are less
             dependent upon the studentID than they are on
             the major attribute
         ●   New college table:
                major   college   collegeLocation

         ●   Revised student table:
                studentID   studentName   Major
Database Normalization
●   Old Design:
            student_id     class_name         time             location      professor_id
          999-40-9876        Math 148       MWF 11:30          Rm. 432            prof145
          999-43-0987       Physics 113      TR 1:30           Rm. 12             prof143
          999-42-9842        Botany 42       F 12:45            Rm. 9             prof167
          999-41-9832        Matj 148       MWF 11:30          Rm. 432            prof145




    New Design:
    Student                                   Enrollment                  Class
    studentID      studentName      Major     studentID     classID       ClassID       ClassName   ProfessorID




    College                                   Professor
    major       college   collegeLocation     ProfessorID      ProfessorName
Database Normalization
●   Questions?
Normalization Assignment
●   For your tool:
    –   Compile list of all data items used

    –   Place all data into one table

    –   Complete 1NF and describe reasons why this is
        better (or if data is already in 1NF continue)

    –   Complete 2NF in the same manner

    –   Complete 3NF in the same manner

Más contenido relacionado

La actualidad más candente

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
emailharmeet
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
koolkampus
 

La actualidad más candente (20)

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
14. Query Optimization in DBMS
14. Query Optimization in DBMS14. Query Optimization in DBMS
14. Query Optimization in DBMS
 
Non access modifiers
Non access modifiersNon access modifiers
Non access modifiers
 
Database Normalization
Database NormalizationDatabase Normalization
Database 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
 
Dbms 14: Relational Calculus
Dbms 14: Relational CalculusDbms 14: Relational Calculus
Dbms 14: Relational Calculus
 
Normlaization
NormlaizationNormlaization
Normlaization
 
Oops
OopsOops
Oops
 
Oodbms ch 20
Oodbms ch 20Oodbms ch 20
Oodbms ch 20
 
Object oreinted php | OOPs
Object oreinted php | OOPsObject oreinted php | OOPs
Object oreinted php | OOPs
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
sql-commands.pdf
sql-commands.pdfsql-commands.pdf
sql-commands.pdf
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
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)
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 

Destacado

Destacado (11)

Database normalization
Database normalizationDatabase normalization
Database normalization
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법
 
Normalization
NormalizationNormalization
Normalization
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Db normalization

  • 1. Database Normalization ● Overview – Definition of database normalization – Why normalize? – First normal form – Second normal form – Third normal form Information for this presentation borrowed from http://www.devshed.com/c/a/MySQL/An-Introduction-to-Database-Normalization/
  • 2. Database Normalization ● Definition – Optimizing table structures – Removing duplicate data entries – Accomplished by thouroughly investigating the various data types and their relationships with one another – Follows a series of normalization “forms” or states
  • 3. Database Normalization ● Why Normalize? – Improved speed – More efficient use of space – Increased data integrity ● (decreased chance that data can get messed up due to maintenance)
  • 4. Database Normalization ● A sad, sad database: – Refer to the following poor database design: student_id class_name time location professor_id 999-40-9876 Math 148 MWF 11:30 Rm. 432 prof145 999-43-0987 Physics 113 TR 1:30 Rm. 12 prof143 999-42-9842 Botany 42 F 12:45 Rm. 9 prof167 999-41-9832 Matj 148 MWF 11:30 Rm. 432 prof145 – Problems ● no need to repeatedly store the class time and professor ID ● redundancy introduces the possibility for error (Matj 148)
  • 5. Database Normalization ● First Normal Form – calls for the elimination of repeated groups of data by creating separate tables of related data – Student information: StudentID StudentName Major college collegeLocation – Class information: StudentID ClassID ClassName – Professor Information: ProfessorID ProfessorName
  • 6. Database Normalization ● Second Normal Form – Elimination of redundant data ● Example data in Class Information: studentID classID className 134-56-7890 M148 Math 148 123-45-7894 P113 Physics 113 534-98-9009 H151 History 151 134-56-7890 H151 History 151 Use: To get Class Information: ClassID ClassName studentID classID M148 Math 148 134-56-7890 M148 P113 Physics 113 123-45-7894 P113 H151 History 151 534-98-9009 H151 134-56-7890 H151
  • 7. Database Normalization ● Third Normal Form – eliminate all attributes(column headers) from a table that are not directly dependent upon the primary key ● college and collegeLocation attributes are less dependent upon the studentID than they are on the major attribute ● New college table: major college collegeLocation ● Revised student table: studentID studentName Major
  • 8. Database Normalization ● Old Design: student_id class_name time location professor_id 999-40-9876 Math 148 MWF 11:30 Rm. 432 prof145 999-43-0987 Physics 113 TR 1:30 Rm. 12 prof143 999-42-9842 Botany 42 F 12:45 Rm. 9 prof167 999-41-9832 Matj 148 MWF 11:30 Rm. 432 prof145 New Design: Student Enrollment Class studentID studentName Major studentID classID ClassID ClassName ProfessorID College Professor major college collegeLocation ProfessorID ProfessorName
  • 10. Normalization Assignment ● For your tool: – Compile list of all data items used – Place all data into one table – Complete 1NF and describe reasons why this is better (or if data is already in 1NF continue) – Complete 2NF in the same manner – Complete 3NF in the same manner