SlideShare a Scribd company logo
1 of 40
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

What's hot

Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Eddyzulham Mahluzydde
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdfShivani139202
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraintssontumax
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraintsKumar
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management SystemDrishti Bhalla
 
Database normalization
Database normalizationDatabase normalization
Database normalizationVARSHAKUMARI49
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancyVisakh V
 

What's hot (18)

Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2Chapter 2 Relational Data Model-part 2
Chapter 2 Relational Data Model-part 2
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Chapter3
Chapter3Chapter3
Chapter3
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database ConstraintsThe Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraints
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Normalization
NormalizationNormalization
Normalization
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Types of keys
Types of keysTypes of keys
Types of keys
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 

Similar to Top schools in india

Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...Mustafa Kamel Mohammadi
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.pptDeependra35
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfMisganawAbeje1
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]Bashir Rezaie
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesJafar Nesargi
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/NormalizationJoan Ador
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.pptKalpanaThakre2
 
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfPokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfjefrifrans
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 

Similar to Top schools in india (20)

Normalization
NormalizationNormalization
Normalization
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
L8 design1
L8 design1L8 design1
L8 design1
 
Normalization
NormalizationNormalization
Normalization
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdf
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
Normalization
NormalizationNormalization
Normalization
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
ER model
ER modelER model
ER model
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 
L7 er2
L7 er2L7 er2
L7 er2
 
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfPokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
 
Function Dependencies and Normalization
 Function Dependencies and Normalization Function Dependencies and Normalization
Function Dependencies and Normalization
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Normalisation
NormalisationNormalisation
Normalisation
 

More from Edhole.com

Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbaiEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 

More from Edhole.com (20)

Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbai
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 

Recently uploaded

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

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