Download presentation
Presentation is loading. Please wait.
1
Week 06 - Normalisation INFOSYS 222
2
Agenda Agenda Normalisation and normal forms 1NF, 2NF and 3NF
Practice on normalisation with previous exam questions
3
Normalisation What is normalisation? What are 1NF, 2NF and 3NF?
Why do we need normalisation? What would we achieve at the end of normalisation? What are 1NF, 2NF and 3NF? What are functional dependencies? What are partial functional dependencies? What are transitive functional dependencies
4
Normalisation Normalisation is a process that “improves” a database design by generating relations that are of higher normal forms. The objective of normalisation: “to create relations where every dependency is on the key, the whole key, and nothing but the key”. Minimize information duplication
5
Work Allocation Chart emp_No emp_Name rank_Id rank_Desc salary
project_No project_Desc project_Start_Date 123 John 01 Sr.Engr 52K ABC34 Waste disposal 01/03/15 456 Alan 03 App. Spec 35K QXN88 Sludge treatment 20/06/15 555 Peter 02 Engr 40K 12/03/15 467 Jane BAT20 N2O Generation 09/05/15 15/06/15 03/05/15 Show how to write 1NF
6
Functional dependencies
We say an attribute, B, has a functional dependency on another attribute, A, if for any two records, which have the same value for A, then the values for B in these two records must be the same. We illustrate this as: A B Example: We only track one name for each employee. Suppose each employee is identified by their unique employee number. We say there is a functional dependency of name on employee number: employee number employee name
7
Functional dependencies
If emp_No is the PK then the FDs: emp_No emp_Name emp_No rank_Desc emp_No salary must exist. emp_No is not the PK : A row is not unique emp_No and project_No : is unique Show 1NF with keys underlined
8
Partial dependency A partial dependency exists when an attribute B is functionally dependent on an attribute A, and A is a component of a multipart candidate key. emp_No project_No project_StartDate project_Desc Candidate keys: {emp_No, project_No} project_Desc is partially dependent on {emp_No, project_No} as project_No is a determinant of project_Desc and project_No is part of a candidate key Show that partial dependencies are removed to a separate relation Relations in 2NF
9
Transitive dependency
Consider attributes A, B, and C, and where A B and B C. Functional dependencies are transitive, which means that we also have the functional dependency A C We say that C is transitively dependent on A through B. For non key attributes
10
Transitive dependency
emp_No rank_Id emp_No emp_Name rank_Id rank_Desc rank_Id rank_Desc emp_No emp_Name rank_Id rank_Desc Remove all transitive dependent attributes together with their determinant to a new relation Show 3NF relations rank_Desc is transitively dependent on emp_No via rank_Id emp_No rank_Desc
11
INFOSYS 222 AC 2007 Exam 101 Derive a set of relation in 3NF. Show each step of normalisation clearly. All PKs should have a solid underline and FKs a dashed line. Draw an ERD for the derived relations
12
INFOSYS 222 AC 2016 Exam
13
INFOSYS 222 AC 2016 Exam Derive a set of relations in third normal form (3NF), using the data shown in figure above Clearly show each step of normalisation – 1NF, 2NF and 3NF
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.