SlideShare a Scribd company logo
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
Syllabus:
Data Base Design & Normalization: Functional dependencies, normal forms, first, second, third
normal forms, BCNF, inclusion dependence, loss less join decompositions, normalization using
FD, MVD, and JDs, alternative approaches to database design.
12 Rules of RDBMS
Dr Edgar F. Codd, after his extensive research on the Relational Model of database systems, came up with twelve
rules of his own, which according to him, a database must obey in order to be regarded as a true relational
database.
These rules can be applied on any database system that manages stored data using only its relational capabilities.
This is a foundation rule, which acts as a base for all the other rules.
Rule 1: Information Rule
The data stored in a database, may it be user data or metadata, must be a value of some table cell. Everything in a
database must be stored in a table format.
Rule 2: Guaranteed Access Rule
Every single data element (value) is guaranteed to be accessible logically with a combination of table-name,
primary-key (row value), and attribute-name (column value). No other means, such as pointers, can be used to
access data.
Rule 3: Systematic Treatment of NULL Values
The NULL values in a database must be given a systematic and uniform treatment. This is a very important rule
because a NULL can be interpreted as one the following − data is missing, data is not known, or data is not
applicable.
Rule 4: Active Online Catalog
The structure description of the entire database must be stored in an online catalog, known as data dictionary,
which can be accessed by authorized users. Users can use the same query language to access the catalog which
they use to access the database itself.
Rule 5: Comprehensive Data Sub-Language Rule
A database can only be accessed using a language having linear syntax that supports data definition, data
manipulation, and transaction management operations. This language can be used directly or by means of some
application. If the database allows access to data without any help of this language, then it is considered as a
violation.
Rule 6: View Updating Rule
All the views of a database, which can theoretically be updated, must also be updatable by the system.
Rule 7: High-Level Insert, Update, and Delete Rule
A database must support high-level insertion, updation, and deletion. This must not be limited to a single row, that
is, it must also support union, intersection and minus operations to yield sets of data records.
Rule 8: Physical Data Independence
The data stored in a database must be independent of the applications that access the database. Any change in the
physical structure of a database must not have any impact on how the data is being accessed by external
applications.
Rule 9: Logical Data Independence
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
The logical data in a database must be independent of its user’s view (application). Any change in logical data
must not affect the applications using it. For example, if two tables are merged or one is split into two different
tables, there should be no impact or change on the user application. This is one of the most difficult rule to apply.
Rule 10: Integrity Independence
A database must be independent of the application that uses it. All its integrity constraints can be independently
modified without the need of any change in the application. This rule makes a database independent of the front-
end application and its interface.
Rule 11: Distribution Independence
The end-user must not be able to see that the data is distributed over various locations. Users should always get
the impression that the data is located at one site only. This rule has been regarded as the foundation of distributed
database systems.
Rule 12: Non-Subversion Rule
If a system has an interface that provides access to low-level records, then the interface must not be able to
subvert the system and bypass security and integrity constraints.
Functional Dependency
Functional dependencies are constraints on the set of legal relations. They allow us to express facts about the
enterprise that we are modeling with our database.
Let R be a relation schema. A subset K of R is a superkey of R if, in any legal relation r(R), for all pairs t1 and t2
of tuples in r such that t1 ≠ t2, then t1 [K] ≠ t2[K]. That is, no two tuples in any legal relation r(R) may have the
same value on attribute set K.
The notion of functional dependency generalizes the notion of superkey. Consider a relation schema R, and let α
⊆ R and β ⊆ R. The functional dependency α →β holds on schema R if, in any legal relation r(R), for all pairs of
tuples t1 and t2 in r such that t1[α] = t2[α], it is also the case that t1[β] = t2[β].
Using the functional-dependency notation, we say that K is a superkey of R if K → R. That is, K is a superkey if,
whenever t1[K] = t2[K], it is also the case that t1[R] = t2[R] (that is, t1 = t2).
Functional dependency (FD) is a set of constraints between two attributes in a relation. Functional dependency
says that if two tuples have same values for attributes A1, A2,..., An, then those two tuples must have to have
same values for attributes B1, B2, ..., Bn.
Functional dependency is represented by an arrow sign (→) that is, X→Y, where X functionally determines Y.
The left-hand side attributes determine the values of attributes on the right-hand side.
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
Closure of a Set of Functional Dependencies
If F is a set of functional dependencies then the closure of F, denoted as F+, is the set of all functional
dependencies logically implied by F. Armstrong's Axioms are a set of rules, that when applied
repeatedly, generates a closure of functional dependencies.
 Reflexivity rule. If α is a set of attributes and β ⊆ α, then α →β holds.
 Augmentation rule. If α → β holds and γ is a set of attributes, then γα → γβ holds.
 Transitivity rule. If α → β holds and β → γ holds, then α → γ holds.
 Union rule. If α → β holds and α → γ holds, then α → βγ holds
 Decomposition rule. If α → βγ holds, then α → β holds and α →γ holds
 Pseudo-transitivity rule. If α → β holds and γβ → δ holds, then αγ → δ holds.
TrivialFunctionalDependency
 Trivial − If a functional dependency (FD) X → Y holds, where Y is a subset of X, then it is
called a trivial FD. Trivial FDs always hold.
 Non-trivial − If an FD X → Y holds, where Y is not a subset of X, then it is called a non-trivial
FD.
 Completely non-trivial − If an FD X → Y holds, where x intersect Y = Φ, it is said to be a
completely non-trivial FD.
A procedure to compute F+
.
F+
= F
repeat
for each functional dependency f in F+
apply reflexivity and augmentation rules on f
add the resulting functional dependencies to F+
for each pair of functional dependencies f1 and f2 in F+
if f1 and f2 can be combined using transitivity
add the resulting functional dependency to F+
until F+
does not change any further
Example:
F= (A → B, A → C, CG → H, CG → I, B → H)
 A→ B & B → H ═> A→ H
 CG → H & CG → I ═> CG → HI
 A → C & CG → H ═> AG→I similarly AG→H
F+
= (A → B, A → C, CG → H, CG → I, B → H, A→ H, CG → HI, AG→I, AG → H)
Closure of Attribute Sets
 To test whether a set of is a super key, we need to find the set of attributes functionally determined by α.
 Let α be a set of attributes. We call the set of attributes determined by α under a set F of functional
dependencies the closure of α under F, denoted α+
.
A procedure to compute α +
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
result := α;
while (changes to result) do
for each functional dependency β → γ in F do
begin
if β ⊆ result then result := result ∪ γ;
end
Example:
Find AG+
in F= (A → B, A → C, CG → H, CG → I, B → H)
 A → B causes us to include B in result. To see this fact, we observe that A → B is in F, A ⊆ result which
is AG), so result: = result ∪ B.
 A→ C causes result to become ABCG.
 CG→H causes result to become ABCGH.
 CG→I causes result to become ABCGHI.
To test if α is a superkey, we compute α+, and check if α+ contains all attributes of R.
Extraneousattributes
An attribute of a functional dependency is said to be extraneous if we can remove it without changing the closure
of the set of functional dependencies. The formal definition of extraneous attributes is as follows. Consider a set F
of functional dependencies and the functional dependency α →β in F.
 Attribute A is extraneous in α if A ∈ α, and F logically implies (F − {α → β}) ∪ {(α − A) → β}.
• Attribute A is extraneous in β if A ∈ β, and the set of functional dependencies (F − {α →β}) ∪ {α → (β −
A)} logically implies F.
Consider a set F of functional dependencies and the functional dependency α→β in F.
• To test if attribute A ∈ α is extraneous in α
1. compute ({α} – A)+ using the dependencies in F
2. check that ({α} – A)+ contains all attributes of β; if it does, A is extraneous
• To test if attribute A ∈ β is extraneous in β
1. compute α+ using only the dependencies in F’ = (F – {α→β}) ∪ {α →(β – A)},
2. check that α+ contains A; if it does, A is extraneous
CanonicalCover
A canonical cover for F is a set of dependencies Fc such that
• F logically implies all dependencies in Fc,
• Fc logically implies all dependencies in F
• No functional dependency in Fc contains an extraneous attribute
• Each left side of functional dependency in Fc is unique.
• To compute a canonical cover for F:
repeat
Use the union rule to replace any dependencies in F
α1 → β1 and α1 → β1 with α1 → β1 β2
Find a functional dependency α→β with an
extraneous attribute either in α or in β
If an extraneous attribute is found, delete it from α→β
until F does not change
• Note: Union rule may become applicable after some extraneous attributes have been deleted, so it has to
be re-applied
R = (A, B, C)
F = {A → BC, B → C, A → B, AB → C}
• Combine A → BC and A → B into A → BC
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
Set is now {A → BC, B → C, AB → C}
• A is extraneous in AB → C
Check if the result of deleting A from AB → C is implied by the other dependencies
Yes: in fact, B → C is already present!
Set is now {A → BC, B → C}
• C is extraneous in A → BC
Check if A → C is logically implied by A → B and the other dependencies
Yes: using transitivity on A → B and B → C.
Can use attribute closure of A in more complex cases
• The canonical cover is: A → B, B → C
Normalization
If a database design is not perfect, it may contain anomalies, which are like a bad dream for any
database administrator. Managing a database with anomalies is next to impossible.
 Update anomalies − If data items are scattered and are not linked to each other properly, then it
could lead to strange situations. For example, when we try to update one data item having its
copies scattered over several places, a few instances get updated properly while a few others are
left with old values. Such instances leave the database in an inconsistent state.
 Deletion anomalies − we tried to delete a record, but parts of it was left undeleted because of
unawareness, the data is also saved somewhere else.
 Insert anomalies − we tried to insert data in a record that does not exist at all.
Normalization:
Normalization is a method to remove all these anomalies and bring the database to a consistent state.
First Normal Form
First Normal Form defines that all the attributes in a relation must have atomic domains. The values in
an atomic domain are indivisible units.
We re-arrange the relation (table) as below, to convert it to First Normal Form.
Each attribute must contain only a single value from its pre-defined domain.
SecondNormalForm
Before we learn about the second normal form, we need to understand the following −
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
• Prime attribute − An attribute, which is a part of the primary-key, is known as a prime attribute.
• Non-prime attribute − An attribute, which is not a part of the primary-key, is said to be a non-
prime attribute.
The relation is in 2NF if every non-prime attribute is fully functionally dependent on primary key
attribute. That is, if X → A holds, then there should not be any proper subset Y of X, for which Y → A
also holds true.
In the above Student_Project relation, the prime key attributes are Stu_ID and Proj_ID. According to the
rule, non-key attributes, i.e. Stu_Name and Proj_Name must be dependent upon both and not on any of
the prime key attribute individually.
But we find that Stu_Name can be identified by Stu_ID and Proj_Name can be identified by Proj_ID
independently. This is called partial dependency, which is not allowed in Second Normal Form.
We broke the relation in two as in the above picture. So there exists no partial dependency.
ThirdNormalForm
A relation is in Third Normal Form, if it is in Second Normal form and the following must satisfy −
• No non-prime attribute is transitively dependent on prime key attribute.
• For any non-trivial functional dependency, X → A, then either −
o X is a superkey or,
o A is prime attribute.
We find that in the above Student_detail relation, Stu_ID is the key and only prime key attribute. We
find that City can be identified by Stu_ID as well as Zip itself. Neither Zip is a superkey nor is City a
prime attribute. Additionally, Stu_ID → Zip → City, so there exists transitive dependency.
To bring this relation into third normal form, we break the relation into two relations as follows −
Subject: Database Management System Mukesh Kumar
Subject Code: (NCS-502) Assistant Professor (CSE-Deptt)
UNIT-3
I.T.S Engineering College, Greater Noida
Boyce-CoddNormalForm
Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on strict terms. A relation is
in BCNF if it is in 3NF and for any non-trivial functional dependency, X → A, X must be a super-key.
In the above image, Stu_ID is the super-key in the relation Student_Detail and Zip is the super-key in
the relation ZipCodes. So,
Stu_ID → Stu_Name, Zip
and
Zip → City
Which confirms that both the relations are in BCNF.

More Related Content

What's hot

Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
Kevin Jadiya
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
Megha yadav
 
Unary operator overloading
Unary operator overloadingUnary operator overloading
Unary operator overloading
BalajiGovindan5
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
Surbhi Panhalkar
 
Modelling and evaluation
Modelling and evaluationModelling and evaluation
Modelling and evaluation
eShikshak
 
Acid properties
Acid propertiesAcid properties
Acid properties
Abhilasha Lahigude
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
Pooja Dixit
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
Muhammad Amjad Rana
 
Vb script
Vb scriptVb script
Vb script
mcatahir947
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
Rachana Pathak
 
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
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
Dharani Kumar Madduri
 
PL-SQL, Cursors & Triggers
PL-SQL, Cursors & TriggersPL-SQL, Cursors & Triggers
PL-SQL, Cursors & Triggers
Shalabh Chaudhary
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mappingShubham Saini
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
Visakh V
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
Boopathi K
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
Bharati Ugale
 

What's hot (20)

Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Unary operator overloading
Unary operator overloadingUnary operator overloading
Unary operator overloading
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
Modelling and evaluation
Modelling and evaluationModelling and evaluation
Modelling and evaluation
 
Characteristics of oop
Characteristics of oopCharacteristics of oop
Characteristics of oop
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Vb script
Vb scriptVb script
Vb script
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
Types of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal GulatiTypes of keys in database management system by Dr. Kamal Gulati
Types of keys in database management system by Dr. Kamal Gulati
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
PL-SQL, Cursors & Triggers
PL-SQL, Cursors & TriggersPL-SQL, Cursors & Triggers
PL-SQL, Cursors & Triggers
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mapping
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 

Similar to Dbms unit-3

Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
Ajit Nayak
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
KalpanaThakre2
 
DBMS.pdf
DBMS.pdfDBMS.pdf
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NFALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ijdms
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
Database
DatabaseDatabase
Database
Riki Afriansyah
 
Ch7
Ch7Ch7
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdf
TamiratDejene1
 
Lecture_W9_Normalization.ppt
Lecture_W9_Normalization.pptLecture_W9_Normalization.ppt
Lecture_W9_Normalization.ppt
SadiaArifinSmrity
 
Normalisation
NormalisationNormalisation
Normalisation
Soumyajit Dutta
 
Final exam in advance dbms
Final exam in advance dbmsFinal exam in advance dbms
Final exam in advance dbms
Md. Mashiur Rahman
 
Assignment#16
Assignment#16Assignment#16
Assignment#16
Sunita Milind Dol
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
BelkinAntony1
 
Normalization
NormalizationNormalization
Normalization
Mohd Mastana
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
Roshni Singh
 
Rdbms
RdbmsRdbms
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
cscpconf
 

Similar to Dbms unit-3 (20)

Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NFALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
ALGORITHM FOR RELATIONAL DATABASE NORMALIZATION UP TO 3NF
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
Database
DatabaseDatabase
Database
 
Ch7
Ch7Ch7
Ch7
 
Ch7
Ch7Ch7
Ch7
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdf
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
Lecture_W9_Normalization.ppt
Lecture_W9_Normalization.pptLecture_W9_Normalization.ppt
Lecture_W9_Normalization.ppt
 
Normalisation
NormalisationNormalisation
Normalisation
 
Final exam in advance dbms
Final exam in advance dbmsFinal exam in advance dbms
Final exam in advance dbms
 
Assignment#16
Assignment#16Assignment#16
Assignment#16
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
Normalization
NormalizationNormalization
Normalization
 
Cs501 fd nf
Cs501 fd nfCs501 fd nf
Cs501 fd nf
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Rdbms
RdbmsRdbms
Rdbms
 
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
VALIDATION METHOD OF FUZZY ASSOCIATION RULES BASED ON FUZZY FORMAL CONCEPT AN...
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

Dbms unit-3

  • 1. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida Syllabus: Data Base Design & Normalization: Functional dependencies, normal forms, first, second, third normal forms, BCNF, inclusion dependence, loss less join decompositions, normalization using FD, MVD, and JDs, alternative approaches to database design. 12 Rules of RDBMS Dr Edgar F. Codd, after his extensive research on the Relational Model of database systems, came up with twelve rules of his own, which according to him, a database must obey in order to be regarded as a true relational database. These rules can be applied on any database system that manages stored data using only its relational capabilities. This is a foundation rule, which acts as a base for all the other rules. Rule 1: Information Rule The data stored in a database, may it be user data or metadata, must be a value of some table cell. Everything in a database must be stored in a table format. Rule 2: Guaranteed Access Rule Every single data element (value) is guaranteed to be accessible logically with a combination of table-name, primary-key (row value), and attribute-name (column value). No other means, such as pointers, can be used to access data. Rule 3: Systematic Treatment of NULL Values The NULL values in a database must be given a systematic and uniform treatment. This is a very important rule because a NULL can be interpreted as one the following − data is missing, data is not known, or data is not applicable. Rule 4: Active Online Catalog The structure description of the entire database must be stored in an online catalog, known as data dictionary, which can be accessed by authorized users. Users can use the same query language to access the catalog which they use to access the database itself. Rule 5: Comprehensive Data Sub-Language Rule A database can only be accessed using a language having linear syntax that supports data definition, data manipulation, and transaction management operations. This language can be used directly or by means of some application. If the database allows access to data without any help of this language, then it is considered as a violation. Rule 6: View Updating Rule All the views of a database, which can theoretically be updated, must also be updatable by the system. Rule 7: High-Level Insert, Update, and Delete Rule A database must support high-level insertion, updation, and deletion. This must not be limited to a single row, that is, it must also support union, intersection and minus operations to yield sets of data records. Rule 8: Physical Data Independence The data stored in a database must be independent of the applications that access the database. Any change in the physical structure of a database must not have any impact on how the data is being accessed by external applications. Rule 9: Logical Data Independence
  • 2. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida The logical data in a database must be independent of its user’s view (application). Any change in logical data must not affect the applications using it. For example, if two tables are merged or one is split into two different tables, there should be no impact or change on the user application. This is one of the most difficult rule to apply. Rule 10: Integrity Independence A database must be independent of the application that uses it. All its integrity constraints can be independently modified without the need of any change in the application. This rule makes a database independent of the front- end application and its interface. Rule 11: Distribution Independence The end-user must not be able to see that the data is distributed over various locations. Users should always get the impression that the data is located at one site only. This rule has been regarded as the foundation of distributed database systems. Rule 12: Non-Subversion Rule If a system has an interface that provides access to low-level records, then the interface must not be able to subvert the system and bypass security and integrity constraints. Functional Dependency Functional dependencies are constraints on the set of legal relations. They allow us to express facts about the enterprise that we are modeling with our database. Let R be a relation schema. A subset K of R is a superkey of R if, in any legal relation r(R), for all pairs t1 and t2 of tuples in r such that t1 ≠ t2, then t1 [K] ≠ t2[K]. That is, no two tuples in any legal relation r(R) may have the same value on attribute set K. The notion of functional dependency generalizes the notion of superkey. Consider a relation schema R, and let α ⊆ R and β ⊆ R. The functional dependency α →β holds on schema R if, in any legal relation r(R), for all pairs of tuples t1 and t2 in r such that t1[α] = t2[α], it is also the case that t1[β] = t2[β]. Using the functional-dependency notation, we say that K is a superkey of R if K → R. That is, K is a superkey if, whenever t1[K] = t2[K], it is also the case that t1[R] = t2[R] (that is, t1 = t2). Functional dependency (FD) is a set of constraints between two attributes in a relation. Functional dependency says that if two tuples have same values for attributes A1, A2,..., An, then those two tuples must have to have same values for attributes B1, B2, ..., Bn. Functional dependency is represented by an arrow sign (→) that is, X→Y, where X functionally determines Y. The left-hand side attributes determine the values of attributes on the right-hand side.
  • 3. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida Closure of a Set of Functional Dependencies If F is a set of functional dependencies then the closure of F, denoted as F+, is the set of all functional dependencies logically implied by F. Armstrong's Axioms are a set of rules, that when applied repeatedly, generates a closure of functional dependencies.  Reflexivity rule. If α is a set of attributes and β ⊆ α, then α →β holds.  Augmentation rule. If α → β holds and γ is a set of attributes, then γα → γβ holds.  Transitivity rule. If α → β holds and β → γ holds, then α → γ holds.  Union rule. If α → β holds and α → γ holds, then α → βγ holds  Decomposition rule. If α → βγ holds, then α → β holds and α →γ holds  Pseudo-transitivity rule. If α → β holds and γβ → δ holds, then αγ → δ holds. TrivialFunctionalDependency  Trivial − If a functional dependency (FD) X → Y holds, where Y is a subset of X, then it is called a trivial FD. Trivial FDs always hold.  Non-trivial − If an FD X → Y holds, where Y is not a subset of X, then it is called a non-trivial FD.  Completely non-trivial − If an FD X → Y holds, where x intersect Y = Φ, it is said to be a completely non-trivial FD. A procedure to compute F+ . F+ = F repeat for each functional dependency f in F+ apply reflexivity and augmentation rules on f add the resulting functional dependencies to F+ for each pair of functional dependencies f1 and f2 in F+ if f1 and f2 can be combined using transitivity add the resulting functional dependency to F+ until F+ does not change any further Example: F= (A → B, A → C, CG → H, CG → I, B → H)  A→ B & B → H ═> A→ H  CG → H & CG → I ═> CG → HI  A → C & CG → H ═> AG→I similarly AG→H F+ = (A → B, A → C, CG → H, CG → I, B → H, A→ H, CG → HI, AG→I, AG → H) Closure of Attribute Sets  To test whether a set of is a super key, we need to find the set of attributes functionally determined by α.  Let α be a set of attributes. We call the set of attributes determined by α under a set F of functional dependencies the closure of α under F, denoted α+ . A procedure to compute α +
  • 4. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida result := α; while (changes to result) do for each functional dependency β → γ in F do begin if β ⊆ result then result := result ∪ γ; end Example: Find AG+ in F= (A → B, A → C, CG → H, CG → I, B → H)  A → B causes us to include B in result. To see this fact, we observe that A → B is in F, A ⊆ result which is AG), so result: = result ∪ B.  A→ C causes result to become ABCG.  CG→H causes result to become ABCGH.  CG→I causes result to become ABCGHI. To test if α is a superkey, we compute α+, and check if α+ contains all attributes of R. Extraneousattributes An attribute of a functional dependency is said to be extraneous if we can remove it without changing the closure of the set of functional dependencies. The formal definition of extraneous attributes is as follows. Consider a set F of functional dependencies and the functional dependency α →β in F.  Attribute A is extraneous in α if A ∈ α, and F logically implies (F − {α → β}) ∪ {(α − A) → β}. • Attribute A is extraneous in β if A ∈ β, and the set of functional dependencies (F − {α →β}) ∪ {α → (β − A)} logically implies F. Consider a set F of functional dependencies and the functional dependency α→β in F. • To test if attribute A ∈ α is extraneous in α 1. compute ({α} – A)+ using the dependencies in F 2. check that ({α} – A)+ contains all attributes of β; if it does, A is extraneous • To test if attribute A ∈ β is extraneous in β 1. compute α+ using only the dependencies in F’ = (F – {α→β}) ∪ {α →(β – A)}, 2. check that α+ contains A; if it does, A is extraneous CanonicalCover A canonical cover for F is a set of dependencies Fc such that • F logically implies all dependencies in Fc, • Fc logically implies all dependencies in F • No functional dependency in Fc contains an extraneous attribute • Each left side of functional dependency in Fc is unique. • To compute a canonical cover for F: repeat Use the union rule to replace any dependencies in F α1 → β1 and α1 → β1 with α1 → β1 β2 Find a functional dependency α→β with an extraneous attribute either in α or in β If an extraneous attribute is found, delete it from α→β until F does not change • Note: Union rule may become applicable after some extraneous attributes have been deleted, so it has to be re-applied R = (A, B, C) F = {A → BC, B → C, A → B, AB → C} • Combine A → BC and A → B into A → BC
  • 5. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida Set is now {A → BC, B → C, AB → C} • A is extraneous in AB → C Check if the result of deleting A from AB → C is implied by the other dependencies Yes: in fact, B → C is already present! Set is now {A → BC, B → C} • C is extraneous in A → BC Check if A → C is logically implied by A → B and the other dependencies Yes: using transitivity on A → B and B → C. Can use attribute closure of A in more complex cases • The canonical cover is: A → B, B → C Normalization If a database design is not perfect, it may contain anomalies, which are like a bad dream for any database administrator. Managing a database with anomalies is next to impossible.  Update anomalies − If data items are scattered and are not linked to each other properly, then it could lead to strange situations. For example, when we try to update one data item having its copies scattered over several places, a few instances get updated properly while a few others are left with old values. Such instances leave the database in an inconsistent state.  Deletion anomalies − we tried to delete a record, but parts of it was left undeleted because of unawareness, the data is also saved somewhere else.  Insert anomalies − we tried to insert data in a record that does not exist at all. Normalization: Normalization is a method to remove all these anomalies and bring the database to a consistent state. First Normal Form First Normal Form defines that all the attributes in a relation must have atomic domains. The values in an atomic domain are indivisible units. We re-arrange the relation (table) as below, to convert it to First Normal Form. Each attribute must contain only a single value from its pre-defined domain. SecondNormalForm Before we learn about the second normal form, we need to understand the following −
  • 6. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida • Prime attribute − An attribute, which is a part of the primary-key, is known as a prime attribute. • Non-prime attribute − An attribute, which is not a part of the primary-key, is said to be a non- prime attribute. The relation is in 2NF if every non-prime attribute is fully functionally dependent on primary key attribute. That is, if X → A holds, then there should not be any proper subset Y of X, for which Y → A also holds true. In the above Student_Project relation, the prime key attributes are Stu_ID and Proj_ID. According to the rule, non-key attributes, i.e. Stu_Name and Proj_Name must be dependent upon both and not on any of the prime key attribute individually. But we find that Stu_Name can be identified by Stu_ID and Proj_Name can be identified by Proj_ID independently. This is called partial dependency, which is not allowed in Second Normal Form. We broke the relation in two as in the above picture. So there exists no partial dependency. ThirdNormalForm A relation is in Third Normal Form, if it is in Second Normal form and the following must satisfy − • No non-prime attribute is transitively dependent on prime key attribute. • For any non-trivial functional dependency, X → A, then either − o X is a superkey or, o A is prime attribute. We find that in the above Student_detail relation, Stu_ID is the key and only prime key attribute. We find that City can be identified by Stu_ID as well as Zip itself. Neither Zip is a superkey nor is City a prime attribute. Additionally, Stu_ID → Zip → City, so there exists transitive dependency. To bring this relation into third normal form, we break the relation into two relations as follows −
  • 7. Subject: Database Management System Mukesh Kumar Subject Code: (NCS-502) Assistant Professor (CSE-Deptt) UNIT-3 I.T.S Engineering College, Greater Noida Boyce-CoddNormalForm Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on strict terms. A relation is in BCNF if it is in 3NF and for any non-trivial functional dependency, X → A, X must be a super-key. In the above image, Stu_ID is the super-key in the relation Student_Detail and Zip is the super-key in the relation ZipCodes. So, Stu_ID → Stu_Name, Zip and Zip → City Which confirms that both the relations are in BCNF.