SlideShare a Scribd company logo
Top school in India
By:
school.edhole.com
Ch 10, Functional Dependencies and
Normal forms
Bernard Chen, Ph.D.
Assistant Professor
Department of Computer Science
University of Central Arkansas
Fall 2011
school.edhole.com
Goodness of relation schemas
 The grouping of attributes to form "good"
relation schemas
 There are two levels:
 Logical Level --- How users interpret the relation
schemas and the meaning of their attributes
 Implementation level --- How the tuples in a
base relation are stored and updated
school.edhole.com
Outline
 We first discuss informal guidelines for good
relational design
 Semantics of the Relation Attributes
 Redundant Information in Tuples and Update
Anomalies
 Null Values in Tuples
 Then we discuss formal concepts of
functional dependencies and normal forms
school.edhole.com
1. Semantics of the Relation
Attributes
 Semantics of a relation refers to the
interpretation of attribute values in a
tuple
 In general, the easier it is to explain the
semantics of the relation, the better the
relation schema design will be
school.edhole.com
1. Semantics of the Relation
Attributes
 Take a look of the simplified version of
COMPANY relation database:
school.edhole.com
For example
school.edhole.com
1. Semantics of the Relation
Attributes
 All relation schemas in the example may be
considered as easy to explain and hence
good from the standpoint of having clear
semantics
 Bottom Line: Design a schema that can be
explained easily relation by relation. The
semantics of attributes should be easy to
interpret.
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 One goal of schema design is to minimize the
storage space
 Bad Design:
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 The previous example not only waste
spaces but also cause some anomalies:
 Insert Anomaly
 Delete Anomaly
 Modify Anomaly
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 Consider the relation:
 Insert Anomaly:
 For a new employee, you have to assign NULL to
projects
 Cannot insert a project unless an employee is
assigned to it.
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 Consider the relation:
 Delete Anomaly:
 If we delete from EMP_DEPT an employee
tuple that happens to represent the last
employee, the information containing that
department is lost from the database
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 Consider the relation:
 Modify Anomaly:
 If we change the value of the manager of
department 5, we must update the tuples
of all employees who work in the
department
school.edhole.com
2. Redundant Information in
Tuples and Update Anomalies
 GUIDELINE 2:
 Design a schema that does not suffer from
the insertion, deletion and update
anomalies.
 If there are any anomalies present, then
note them so that applications can be
made to take them into account.
school.edhole.com
3. Null Values in Tuples
 As far as possible, avoid placing attributes in
a base relation whose values may frequently
be NULL
 For example: if only 10% of employees have
individual offices, DO NOT include a attribute
OFFICE_NUMBER in the EMPLOYEE
relation
 Rather, a relation EMP_OFFICES(ESSN,
OFFICE_NUMBER) can be created. (just like
WEAK entity type)
school.edhole.com
Outline
 We first discuss informal guidelines for
good relational design
 Then we discuss formal concepts of
functional dependencies and normal
forms
 - 1NF (First Normal Form)
 - 2NF (Second Normal Form)
 - 3NF (Third Normal Form)
school.edhole.com
Functional Dependency
 Definition: a Functional Dependency,
denoted by X -> Y holds if whenever two
tuples have the same value for X, they must
have the same value for Y
school.edhole.com
Functional Dependency
 Written as X -> Y; can be displayed
graphically on a relation schema as
in Figures. ( denoted by the arrow)
 Social security number determines employee
name
 SSN -> ENAME
school.edhole.com
Functional Dependency
 Social security number determines
employee name
 SSN -> ENAME
 Project number determines project
name and location
 PNUMBER -> {PNAME, PLOCATION}
 Employee ssn and project number
determines the hours per week that the
employee works on the project
 {SSN, PNUMBER} -> HOURS
school.edhole.com
Functional Dependency
 Bad Design:
school.edhole.com
Normalization of Relations
 Normalization:
 The process of decomposing
unsatisfactory "bad" relations by breaking
up their attributes into smaller relations
 Normal form:
 Condition using keys and FDs of a relation
to certify whether a relation schema is in a
particular normal form
school.edhole.com
List of Normal Forms
 First Normal Form (1NF)
 Atomic values
 2NF, 3NF
 based on primary keys
 4NF
 based on keys, multi-valued dependencies
 5NF
 based on keys, join dependencies
school.edhole.com
Practical Use of Normal
Forms
 Most practical relational design projects take
one of the following two approaches:
 Perform a conceptual schema design using a
conceptual model (ER, EER) and map the
conceptual design into relations
 Design the relations based on external knowledge
derived from an existing implementation of files (or
reports)
school.edhole.com
Practical Use of Normal
Forms
 Normalization is carried out in practice so
that the resulting designs are of high quality
and meet the desirable properties
 The database designers need not normalize
to the highest possible normal form
 (usually up to 3NF, BCNF or 4NF)
school.edhole.co
Definitions of Keys and
Attributes Participating in Keys
 A superkey of a relation schema R = {A1,
A2, ...., An} is a set of attributes S subset-of R
with the property that no two tuples t1 and t2
in any legal relation state r of R will have t1[S]
= t2[S]
 A key K is a superkey with the additional
property that removal of any attribute from K
will cause K not to be a superkey any more.
school.edhole.co
Definitions of Keys and
Attributes Participating in Keys
 If a relation schema has more than one key,
each is called a candidate key.
 One of the candidate keys is arbitrarily designated
to be the primary key
 A Prime attribute must be a member of
some candidate key
 A Nonprime attribute is not a prime
attribute—that is, it is not a member of any
candidate key.
school.edhole.co
First Normal Form
 Historically, it is designed to disallow
 composite attributes
 multivalued attributes
 Or the combination of both
 All the values need to be atomic
school.edhole.co
First Normal Form
school.edhole.co
First Normal Form
 To normalize into 1NF, we have the following
3 techniques:
 Remove the attribute Dlocations that violates 1NF
and place it in a separate relation
 Expand the key (10.8 C). In this case, the PK
become the combination of {Dnumber, Dlocation}
 If the max number of values is known, then we
can replace the violate attribute by the max
number atomic attributes, such as, Dlocation1,
Dlocation2, Dlocation3…
school.edhole.co
Second Normal Form
 In this example, {Ssn, Pnummber} ->
Hours is a fully dependency
 However, the dependency {Ssn,
Pnumber}->Ename is partial because
Ssn->Ename holds
school.edhole.co
Second Normal Form
 A relation schema R is in second normal form
(2NF) if every non-prime attribute A in R is fully
functionally dependent on the primary key
 A functional dependency X->Y is a partial
dependency if some attribute A belong X can be
removed from X and the dependency still holds
school.edhole.co
Second Normal Form
 If the primary key contains a single
attribute, it is 2NF
 Normalization into 2NF:
 If a relation schema is not in 2NF, it can be
normalized into a number of 2NF relations where
nonprime attributes are associated with only with
the part of the primary key on which they are fully
functionally dependent
school.edhole.co
Second Normal Form
school.edhole.co
Third Normal Form
 A relation schema R is in third normal
form (3NF) if it is in 2NF and no non-
prime attribute A in R is transitively
dependent on the primary key
 Transitive functional dependency: a
FD X -> Z that can be derived from two
FDs X -> Y and Y -> Z
school.edhole.co
Third Normal Form
 Examples:
 SSN -> DMGRSSN is a transitive FD

Since SSN -> DNUMBER and DNUMBER ->
DMGRSSN hold
 SSN -> ENAME is non-transitive

Since there is no set of attributes X where SSN
-> X and X -> ENAME
school.edhole.co
Third Normal Form
school.edhole.co
Normal Forms Defined
Informally
 1st
normal form
 All attributes depend on the key
 2nd
normal form
 All attributes depend on the whole key
 3rd
normal form
 All attributes depend on nothing but the
key
school.edhole.co
SUMMARY OF NORMAL FORMS
based on Primary Keys
school.edhole.co
Practice
 Based on the given primary key, is this relation in 1NF,
2NF, or 3NF? Why or why not? How would you
successively normalize it completely?
school.edhole.co
school.edhole.co

More Related Content

PPT
free Video lecture in India
Edhole.com
 
PPT
Eer >r.model
lavya3
 
PPT
Kul 2
sw pitara
 
PPT
Chapter10
sasa_eldoby
 
PPT
Relational model
Jihin Raju
 
DOCX
ER to relational Mapping: Data base design using ER to relational language. C...
Raj vardhan
 
PDF
Database Systems - Normalization of Relations(Chapter 4/3)
Vidyasagar Mundroy
 
free Video lecture in India
Edhole.com
 
Eer >r.model
lavya3
 
Kul 2
sw pitara
 
Chapter10
sasa_eldoby
 
Relational model
Jihin Raju
 
ER to relational Mapping: Data base design using ER to relational language. C...
Raj vardhan
 
Database Systems - Normalization of Relations(Chapter 4/3)
Vidyasagar Mundroy
 

What's hot (18)

PDF
Chapter 2 Relational Data Model-part 2
Eddyzulham Mahluzydde
 
PPTX
Chapter 6 relational data model and relational
Jafar Nesargi
 
PPT
Er & eer to relational mapping
saurabhshertukde
 
PPT
Chapter3
Jafar Nesargi
 
PDF
24042020_normalization 1.pdf
Shivani139202
 
PDF
The Relational Data Model and Relational Database Constraints
sontumax
 
PDF
4 the relational data model and relational database constraints
Kumar
 
PPTX
Fd & Normalization - Database Management System
Drishti Bhalla
 
PPT
Database normalization
VARSHAKUMARI49
 
PDF
Normalization
Huda Alameen
 
PPTX
Chapter 4
Nazir Ahmed
 
PPTX
Theory of dependencies in relational database
Jyoti Ranjan Pattnaik
 
PPTX
Decomposition using Functional Dependency
Raj Naik
 
PPT
Normalization
Hardik Sondagar
 
PPTX
Normalization
Annurajsingh
 
PPTX
Types of keys
Bhavana sharma
 
PPTX
Functional dependancy
Visakh V
 
Chapter 2 Relational Data Model-part 2
Eddyzulham Mahluzydde
 
Chapter 6 relational data model and relational
Jafar Nesargi
 
Er & eer to relational mapping
saurabhshertukde
 
Chapter3
Jafar Nesargi
 
24042020_normalization 1.pdf
Shivani139202
 
The Relational Data Model and Relational Database Constraints
sontumax
 
4 the relational data model and relational database constraints
Kumar
 
Fd & Normalization - Database Management System
Drishti Bhalla
 
Database normalization
VARSHAKUMARI49
 
Normalization
Huda Alameen
 
Chapter 4
Nazir Ahmed
 
Theory of dependencies in relational database
Jyoti Ranjan Pattnaik
 
Decomposition using Functional Dependency
Raj Naik
 
Normalization
Hardik Sondagar
 
Normalization
Annurajsingh
 
Types of keys
Bhavana sharma
 
Functional dependancy
Visakh V
 
Ad

Similar to Top schools in india (20)

PPT
Normalization_dsa_project_easy_with_graph.ppt
guitarsoul9876
 
PPT
Normalization
rehanlko007
 
PPTX
Normalization.pptx Functional dependence
sadiariasat10
 
PPTX
Fundamentals of database system - Relational data model and relational datab...
Mustafa Kamel Mohammadi
 
PPTX
Learn more about database normalization concepts
PrathamKandari
 
PPTX
DBMS - Relational Model, Relational Table
ahirevedant07
 
PPTX
nosql-module1ppt-230309062548-d60645ec.pptx
GeethaAL
 
PPT
Normmmalizzarion.ppt
Deependra35
 
PDF
L8 design1
Tianlu Wang
 
PPTX
Normalization
Sakshi Jaiswal
 
PDF
chapter 4-Functional Dependency and Normilization.pdf
University of Gondar
 
PPTX
UNIT 2 -PPT.pptx
hemamalinikrishnan2
 
PPTX
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
PPTX
Normalization
Mohd Mastana
 
PPTX
The relational data model part[1]
Bashir Rezaie
 
PPT
ER model
ShilpaDe
 
PPT
Mapping EER Model Constructs to Relations ADB_05_BRvs.ppt
SenzotaSemakuwa
 
PPTX
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
PPT
NORMALIZATION in database management systems
SheebaS25
 
PDF
Penormalan/Normalization
Joan Ador
 
Normalization_dsa_project_easy_with_graph.ppt
guitarsoul9876
 
Normalization
rehanlko007
 
Normalization.pptx Functional dependence
sadiariasat10
 
Fundamentals of database system - Relational data model and relational datab...
Mustafa Kamel Mohammadi
 
Learn more about database normalization concepts
PrathamKandari
 
DBMS - Relational Model, Relational Table
ahirevedant07
 
nosql-module1ppt-230309062548-d60645ec.pptx
GeethaAL
 
Normmmalizzarion.ppt
Deependra35
 
L8 design1
Tianlu Wang
 
Normalization
Sakshi Jaiswal
 
chapter 4-Functional Dependency and Normilization.pdf
University of Gondar
 
UNIT 2 -PPT.pptx
hemamalinikrishnan2
 
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
Normalization
Mohd Mastana
 
The relational data model part[1]
Bashir Rezaie
 
ER model
ShilpaDe
 
Mapping EER Model Constructs to Relations ADB_05_BRvs.ppt
SenzotaSemakuwa
 
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
NORMALIZATION in database management systems
SheebaS25
 
Penormalan/Normalization
Joan Ador
 
Ad

More from Edhole.com (20)

PPT
Ca in patna
Edhole.com
 
PPT
Chartered accountant in dwarka
Edhole.com
 
PPT
Ca in dwarka
Edhole.com
 
PPT
Ca firm in dwarka
Edhole.com
 
PPT
Website development company surat
Edhole.com
 
PPTX
Website designing company in surat
Edhole.com
 
PPTX
Website dsigning company in india
Edhole.com
 
PPT
Website designing company in delhi
Edhole.com
 
PPT
Ca in patna
Edhole.com
 
PPT
Chartered accountant in dwarka
Edhole.com
 
PPT
Ca firm in dwarka
Edhole.com
 
PPTX
Ca in dwarka
Edhole.com
 
PPTX
Website development company surat
Edhole.com
 
PPT
Website designing company in surat
Edhole.com
 
PPT
Website designing company in india
Edhole.com
 
PPT
Website designing company in delhi
Edhole.com
 
PPT
Website designing company in mumbai
Edhole.com
 
PPT
Website development company surat
Edhole.com
 
PPT
Website desinging company in surat
Edhole.com
 
PPT
Website designing company in india
Edhole.com
 
Ca in patna
Edhole.com
 
Chartered accountant in dwarka
Edhole.com
 
Ca in dwarka
Edhole.com
 
Ca firm in dwarka
Edhole.com
 
Website development company surat
Edhole.com
 
Website designing company in surat
Edhole.com
 
Website dsigning company in india
Edhole.com
 
Website designing company in delhi
Edhole.com
 
Ca in patna
Edhole.com
 
Chartered accountant in dwarka
Edhole.com
 
Ca firm in dwarka
Edhole.com
 
Ca in dwarka
Edhole.com
 
Website development company surat
Edhole.com
 
Website designing company in surat
Edhole.com
 
Website designing company in india
Edhole.com
 
Website designing company in delhi
Edhole.com
 
Website designing company in mumbai
Edhole.com
 
Website development company surat
Edhole.com
 
Website desinging company in surat
Edhole.com
 
Website designing company in india
Edhole.com
 

Recently uploaded (20)

PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
High Ground Student Revision Booklet Preview
jpinnuck
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Introduction and Scope of Bichemistry.pptx
shantiyogi
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
High Ground Student Revision Booklet Preview
jpinnuck
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 

Top schools in india

  • 1. Top school in India By: school.edhole.com
  • 2. Ch 10, Functional Dependencies and Normal forms Bernard Chen, Ph.D. Assistant Professor Department of Computer Science University of Central Arkansas Fall 2011 school.edhole.com
  • 3. Goodness of relation schemas  The grouping of attributes to form "good" relation schemas  There are two levels:  Logical Level --- How users interpret the relation schemas and the meaning of their attributes  Implementation level --- How the tuples in a base relation are stored and updated school.edhole.com
  • 4. Outline  We first discuss informal guidelines for good relational design  Semantics of the Relation Attributes  Redundant Information in Tuples and Update Anomalies  Null Values in Tuples  Then we discuss formal concepts of functional dependencies and normal forms school.edhole.com
  • 5. 1. Semantics of the Relation Attributes  Semantics of a relation refers to the interpretation of attribute values in a tuple  In general, the easier it is to explain the semantics of the relation, the better the relation schema design will be school.edhole.com
  • 6. 1. Semantics of the Relation Attributes  Take a look of the simplified version of COMPANY relation database: school.edhole.com
  • 8. 1. Semantics of the Relation Attributes  All relation schemas in the example may be considered as easy to explain and hence good from the standpoint of having clear semantics  Bottom Line: Design a schema that can be explained easily relation by relation. The semantics of attributes should be easy to interpret. school.edhole.com
  • 9. 2. Redundant Information in Tuples and Update Anomalies  One goal of schema design is to minimize the storage space  Bad Design: school.edhole.com
  • 10. 2. Redundant Information in Tuples and Update Anomalies  The previous example not only waste spaces but also cause some anomalies:  Insert Anomaly  Delete Anomaly  Modify Anomaly school.edhole.com
  • 11. 2. Redundant Information in Tuples and Update Anomalies  Consider the relation:  Insert Anomaly:  For a new employee, you have to assign NULL to projects  Cannot insert a project unless an employee is assigned to it. school.edhole.com
  • 12. 2. Redundant Information in Tuples and Update Anomalies  Consider the relation:  Delete Anomaly:  If we delete from EMP_DEPT an employee tuple that happens to represent the last employee, the information containing that department is lost from the database school.edhole.com
  • 13. 2. Redundant Information in Tuples and Update Anomalies  Consider the relation:  Modify Anomaly:  If we change the value of the manager of department 5, we must update the tuples of all employees who work in the department school.edhole.com
  • 14. 2. Redundant Information in Tuples and Update Anomalies  GUIDELINE 2:  Design a schema that does not suffer from the insertion, deletion and update anomalies.  If there are any anomalies present, then note them so that applications can be made to take them into account. school.edhole.com
  • 15. 3. Null Values in Tuples  As far as possible, avoid placing attributes in a base relation whose values may frequently be NULL  For example: if only 10% of employees have individual offices, DO NOT include a attribute OFFICE_NUMBER in the EMPLOYEE relation  Rather, a relation EMP_OFFICES(ESSN, OFFICE_NUMBER) can be created. (just like WEAK entity type) school.edhole.com
  • 16. Outline  We first discuss informal guidelines for good relational design  Then we discuss formal concepts of functional dependencies and normal forms  - 1NF (First Normal Form)  - 2NF (Second Normal Form)  - 3NF (Third Normal Form) school.edhole.com
  • 17. Functional Dependency  Definition: a Functional Dependency, denoted by X -> Y holds if whenever two tuples have the same value for X, they must have the same value for Y school.edhole.com
  • 18. Functional Dependency  Written as X -> Y; can be displayed graphically on a relation schema as in Figures. ( denoted by the arrow)  Social security number determines employee name  SSN -> ENAME school.edhole.com
  • 19. Functional Dependency  Social security number determines employee name  SSN -> ENAME  Project number determines project name and location  PNUMBER -> {PNAME, PLOCATION}  Employee ssn and project number determines the hours per week that the employee works on the project  {SSN, PNUMBER} -> HOURS school.edhole.com
  • 20. Functional Dependency  Bad Design: school.edhole.com
  • 21. Normalization of Relations  Normalization:  The process of decomposing unsatisfactory "bad" relations by breaking up their attributes into smaller relations  Normal form:  Condition using keys and FDs of a relation to certify whether a relation schema is in a particular normal form school.edhole.com
  • 22. List of Normal Forms  First Normal Form (1NF)  Atomic values  2NF, 3NF  based on primary keys  4NF  based on keys, multi-valued dependencies  5NF  based on keys, join dependencies school.edhole.com
  • 23. Practical Use of Normal Forms  Most practical relational design projects take one of the following two approaches:  Perform a conceptual schema design using a conceptual model (ER, EER) and map the conceptual design into relations  Design the relations based on external knowledge derived from an existing implementation of files (or reports) school.edhole.com
  • 24. Practical Use of Normal Forms  Normalization is carried out in practice so that the resulting designs are of high quality and meet the desirable properties  The database designers need not normalize to the highest possible normal form  (usually up to 3NF, BCNF or 4NF) school.edhole.co
  • 25. Definitions of Keys and Attributes Participating in Keys  A superkey of a relation schema R = {A1, A2, ...., An} is a set of attributes S subset-of R with the property that no two tuples t1 and t2 in any legal relation state r of R will have t1[S] = t2[S]  A key K is a superkey with the additional property that removal of any attribute from K will cause K not to be a superkey any more. school.edhole.co
  • 26. Definitions of Keys and Attributes Participating in Keys  If a relation schema has more than one key, each is called a candidate key.  One of the candidate keys is arbitrarily designated to be the primary key  A Prime attribute must be a member of some candidate key  A Nonprime attribute is not a prime attribute—that is, it is not a member of any candidate key. school.edhole.co
  • 27. First Normal Form  Historically, it is designed to disallow  composite attributes  multivalued attributes  Or the combination of both  All the values need to be atomic school.edhole.co
  • 29. First Normal Form  To normalize into 1NF, we have the following 3 techniques:  Remove the attribute Dlocations that violates 1NF and place it in a separate relation  Expand the key (10.8 C). In this case, the PK become the combination of {Dnumber, Dlocation}  If the max number of values is known, then we can replace the violate attribute by the max number atomic attributes, such as, Dlocation1, Dlocation2, Dlocation3… school.edhole.co
  • 30. Second Normal Form  In this example, {Ssn, Pnummber} -> Hours is a fully dependency  However, the dependency {Ssn, Pnumber}->Ename is partial because Ssn->Ename holds school.edhole.co
  • 31. Second Normal Form  A relation schema R is in second normal form (2NF) if every non-prime attribute A in R is fully functionally dependent on the primary key  A functional dependency X->Y is a partial dependency if some attribute A belong X can be removed from X and the dependency still holds school.edhole.co
  • 32. Second Normal Form  If the primary key contains a single attribute, it is 2NF  Normalization into 2NF:  If a relation schema is not in 2NF, it can be normalized into a number of 2NF relations where nonprime attributes are associated with only with the part of the primary key on which they are fully functionally dependent school.edhole.co
  • 34. Third Normal Form  A relation schema R is in third normal form (3NF) if it is in 2NF and no non- prime attribute A in R is transitively dependent on the primary key  Transitive functional dependency: a FD X -> Z that can be derived from two FDs X -> Y and Y -> Z school.edhole.co
  • 35. Third Normal Form  Examples:  SSN -> DMGRSSN is a transitive FD  Since SSN -> DNUMBER and DNUMBER -> DMGRSSN hold  SSN -> ENAME is non-transitive  Since there is no set of attributes X where SSN -> X and X -> ENAME school.edhole.co
  • 37. Normal Forms Defined Informally  1st normal form  All attributes depend on the key  2nd normal form  All attributes depend on the whole key  3rd normal form  All attributes depend on nothing but the key school.edhole.co
  • 38. SUMMARY OF NORMAL FORMS based on Primary Keys school.edhole.co
  • 39. Practice  Based on the given primary key, is this relation in 1NF, 2NF, or 3NF? Why or why not? How would you successively normalize it completely? school.edhole.co