0% found this document useful (0 votes)
7 views16 pages

CMPG213SU8Normalization2020 Compressed

The document outlines the steps for drawing a data model, including identifying entities, attributes, and relationships, as well as the process of normalization to minimize data redundancy and anomalies. It details the conversion to first, second, and third normal forms (1NF, 2NF, 3NF) with examples of how to eliminate repeating groups and dependencies. Additionally, it includes a class test and classwork exercise for normalizing employee and project data to 3NF.

Uploaded by

Luna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views16 pages

CMPG213SU8Normalization2020 Compressed

The document outlines the steps for drawing a data model, including identifying entities, attributes, and relationships, as well as the process of normalization to minimize data redundancy and anomalies. It details the conversion to first, second, and third normal forms (1NF, 2NF, 3NF) with examples of how to eliminate repeating groups and dependencies. Additionally, it includes a class test and classwork exercise for normalizing employee and project data to 3NF.

Uploaded by

Luna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Normalization

McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
Steps to draw a Datamodel

1. Identify nouns = Entities = Tables in Access


2. Identify attributes for each Entity
3. Normalisation
4. Identify relationships between each pair of
Entities

8-2
Identify relationships between each
pair of Entities
• Define cardinality (1-to-1 OR 1-to-many OR many-to-many)
• Indicate FK
• If 1-to-1, PK of one entity becomes FK in other
entity (result should have minimum null values)
• If 1-to-M, PK of one entity becomes FK in M entity
• If M-to-M, create NEW entity with PK containing at
least both entities’ PKs
• Determine if relationship is WEAK or STRONG
• If PK of 1-Entity appears in PK of M-Entity, then M-Entity =
WEAK and relationship = STRONG (identifying)
• If PK of 1-Entity does not appear in PK of M-Entity, then M-
Entity = STRONG and relationship = WEAK (non-
identifying)
8-3 • Define verbs
Normalization
• Evaluating and correcting table structures
to minimize data redundancies
• Reduces data anomalies
(onreëlmatighede)
• Assigns attributes to tables based on
determination (Key)
• Normal forms
• First normal form (1NF)
• Second normal form (2NF)
• Third normal form (3NF)
Conversion to First Normal
Form
• Steps
• Eliminate the repeating groups
• Eliminate attributes with more than one value
• Identify the primary key

8-5
Example of Repeating Groups

CD CD Name Title 1 Title 2 Title 3 Title 4


Number

CD (CD_Number (PK), CD_Name)

TITLE (Title_Number (PK), Title_Name)

TITLEOnCD (CD_Number (PK)(FK),


Title_Number(PK)(FK))

8-6
Example of attribute with more
than one value
Book Title Author
Number
9781408048634 Database Coronel, Morris, Rob,
Principles Crockett

BOOK (ISBN_Number (PK), Title)

AUTHOR (Author_Number (PK), Author_Name)

BOOKAUTHOR (ISBN_Number (PK)(FK),


Author_Number (PK)(FK))

8-7
Conversion to First Normal
Form

Dependency diagram: Depicts all


dependencies found within given table
structure
 Helps to get an overview of all relationships among
table’s attributes
 Makes it less likely that an important dependency will
be overlooked

8-8
First Normal Form (1NF)
Dependency Diagram

8-9
Conversion to Second Normal
Form
Table is in 2NF when it:
 Is in 1NF
 Includes no partial dependencies

Steps
 Make new tables to eliminate partial dependencies
 Reassign corresponding dependent attributes
When a table has a single attribute PK, the table is
automatically in 2NF if it is in 1NF

8-10
Second Normal Form (2NF)
Conversion Results

8-11
Conversion to Third Normal
Form
Table is in 3NF when it:
 Is in 2NF
 Contains no transitive dependencies
Steps
 Make new tables to eliminate transitive
dependencies
 Primary Key: Any attribute whose value determines other
values within a row
 Reassign corresponding dependent attributes

8-12
Third Normal Form (3NF)
Conversion Results

8-13
Class Test
‘n IT maatskappy hou detail in stand van alle sagteware
projekte waarin hulle werknemers op die oomblik betrokke
is. Die detail bestaan uit die volgende attribute: / An IT
company maintains details of all the software projects in
which its employees are currently involved. These details
comprise the following attributes:
• Werknemer nommer / Employee number
• Werknemer naam / Employee name
• Geboortedatum / Date of birth
• Departement kode / Department code
• Departement naam / Department name
• Projek kode / Project code
• Projek beskrywing / Project description
8-14 • Projek toesighouer / Project supervisor
Classwork
Aanvaar die volgende: / Assume the following:
• Elke werknemer nommer is uniek. / Each employee number is unique.
• Elke departement het ‘n unieke departement kode. / Each department has a
unique department code.
• Elke projek het ‘n unieke projek kode en unieke toesighouer met naam en van.
/ Each project has a unique project code and unique supervisor with name and
lastname.
• Elke werknemer werk in ‘n enkele departement, maar elke departement het
baie werknemers. / Each employee works in a single department but every
department has many employees.
• Elke werknemer mag op een of meer projekte werk. / Each employee may
work on one or more projects.
• Elke projek het een of meer werknemers wat daarop werk. / Each project has
one or more employees working on it.
• Werknemer name is nie uniek nie. / Employee names are not unique.
Normaliseer hierdie data tot 3NF. / Normalise this data to 3NF.
8-15
Classwork Memo

EMPLOYEE(Employee Number (PK) ,


Employee Name, Date of Birth, Department Code (FK)
) 

DEPARTMENT( Department Code (PK)  , Department Name) 

PROJECT( Project Code (PK)  , Project Description, Project Supervisor


Code (FK)) 

SUPERVISOR (Supervisor Code(PK), Supervisor Name) 

EMPLOYEEOnPROJECT
(Employee Number (PK) (FK) , Project Code (PK) (FK) )

You might also like