SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbms
emailharmeet
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
kayathri02
 
Single User v/s Multi User Databases
Single User v/s Multi User DatabasesSingle User v/s Multi User Databases
Single User v/s Multi User Databases
Raminder Pal Singh
 
Normalization
NormalizationNormalization
Normalization
rey501
 
File system-and-database-chapter01-connoly
File system-and-database-chapter01-connolyFile system-and-database-chapter01-connoly
File system-and-database-chapter01-connoly
Temma Tems
 

Tendances (20)

Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
Partitioning
PartitioningPartitioning
Partitioning
 
Lecture 08 distributed dbms
Lecture 08 distributed dbmsLecture 08 distributed dbms
Lecture 08 distributed dbms
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Spark tuning
Spark tuningSpark tuning
Spark tuning
 
Naming convention in_database
Naming convention in_databaseNaming convention in_database
Naming convention in_database
 
Introduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal GulatiIntroduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal Gulati
 
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
 
Material master views
Material master viewsMaterial master views
Material master views
 
Managing and Deploying High Performance Computing Clusters using Windows HPC ...
Managing and Deploying High Performance Computing Clusters using Windows HPC ...Managing and Deploying High Performance Computing Clusters using Windows HPC ...
Managing and Deploying High Performance Computing Clusters using Windows HPC ...
 
Bcnf
BcnfBcnf
Bcnf
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Parallel databases
Parallel databasesParallel databases
Parallel databases
 
Normalization
NormalizationNormalization
Normalization
 
Single User v/s Multi User Databases
Single User v/s Multi User DatabasesSingle User v/s Multi User Databases
Single User v/s Multi User Databases
 
Normalization
NormalizationNormalization
Normalization
 
OLAP IN DATA MINING
OLAP IN DATA MININGOLAP IN DATA MINING
OLAP IN DATA MINING
 
File system-and-database-chapter01-connoly
File system-and-database-chapter01-connolyFile system-and-database-chapter01-connoly
File system-and-database-chapter01-connoly
 
Data Base Management System
Data Base Management SystemData Base Management System
Data Base Management System
 
Data mining and data warehousing
Data mining and data warehousingData mining and data warehousing
Data mining and data warehousing
 

En vedette

En vedette (13)

Database normalization
Database normalizationDatabase normalization
Database normalization
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
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
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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
 
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
 
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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

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