SlideShare une entreprise Scribd logo
1  sur  18
9.0 Normalization
DBMS
Bishal
9.1 Introduction
 To reduce redundancy which means that information is
to be stored only once
 Relations are normalized so that when relations in a
database are to be altered during the lifetime of the
database, we do not lose information or introduce
inconsistencies
 Alterations normally needed are
 Insertion should be possible without being forced to leave
blank fields for some attributes.
 Deletion should be possible without losing vital
information unknowingly.
 Updating should be possible without exhaustively
searching all the tuples in the relation.
9.2 Functional Dependency
 Let X and Y be the two attributes of a relation. Given
the value of X, if there is only one value of Y
corresponding to it, then Y is said to be functionally
dependent on X. This is indicated by the notation:
 X  Y
 For example, given the value of item code, there is
only one value of item name for it. Thus item name is
functionally dependent on item code. This is shown as:
 Item code  item name
 Functional dependency may also be based on a
composite attribute. For example, if we write
 X,Z  Y
 It means that there is only one value of Y
corresponding to given values of X,Z. In other words, Y
is functionally dependent on the composite X,Z.
 Student (Roll_no, Name, Address , Dept ,
Year_of_study)
 In this relation, Name is functionally dependent on Roll
no. In fact, given the value of Roll no., the values of all
other attributes can be uniquely determined. Name and
Department are not functionally dependent, because
given the name of a student, one cannot find his
department uniquely. This is due to the fact that there
may be more than one student with the same name.
Name in this case is not a key.
Relation Key:
 Given a relation, if the value of an attribute X uniquely
determines the value of all other attributes in a row, then
X is said to be the key of that relation.
 Sometimes more than one attribute is needed to
uniquely determine other attributes in a relation row. In
that case such a set of attributes is the key.
RollNo
Name
Address
Department
YearOfStudy
9.3 Anomalies in a Database
 STDINF(Name, Course, Phone_No, Major, Prof, Grade)
 Dependencies :
 Name  Phone_No,
 Name  Major,
 Name,Course  Grade
 Course  Prof
Name Course Phone_N
o
Major Prof Grade
Jones 353 237-4539 Comp Sci Smith A
Ng 329 427-7390 Chemistry Turner B
Jones 328 237-4539 Comp Sci Clark B
Martin 456 388-5183 Physics James A
Dulles 293 371-6259 Decision
Sci
Cook C
9.3 Anomalies in a Database
 Here the attribute Phone_No, which is not in any key
of the relation scheme STDINF, is not functionally
dependent on the whole key, but only one part of the
key, namely, the attribute Name. Similarly, the
attributes Major and Prof, which are not in any key of
the relation scheme STDINF either, are fully
functionally dependent on the attributes Name and
Course, respectively.
 Thus the determinants of these functional
dependencies are again not the entire key, but only
part of the key of the relation. Only the attribute Grade
is fully functionally dependent on the key Name
Course.
Redundancy
 The aim of the database system is to reduce
redundancy, meaning that information is to be stored
only once. Storing information several times leads to the
waste of storage space and an increase in the total size
of the data stored.
 Updates to the database with such redundancies have
the potential of becoming inconsistent as explained
below. In the relation of table, the Major and
Phone_No. of a student are stored several times in the
database: once for each course that is or was taken by
a student.
Update Anomalies
 Multiple copies of the same fact may lead to update
anomalies or inconsistencies when an update is
made, and only some of the multiple copies are
updated. Thus, a change in the Phone_No. of Jones
must be made, for consistency, in all tuples pertaining
to the student Jones. If one of the three tuples is not
changed to reflect the new Phone_No. of Jones, there
will be an inconsistency in the data.
Insertion Anomalies
 If this is the only relation in the database showing the
association between a faculty member and the course
he or she teaches, the fact that a given professor is
teaching a given course cannot be entered in the
database unless a student is registered in the course.
Also, if another relation also establishes a relationship
between a course and a professor, who teaches that
course, the information stored in these relations has
to be consistent.
Name
Course
Phone_No
Major
Prof
Grade
Deletion Anomalies
 If the only student registered in a given course
discontinues the course, the information as to which
professor is offering the course will be lost, if this is the
only relation in the database showing the association
between a faculty member and the course she or he
teaches. If another relation in the database also
establishes the relationship between a course and a
professor, who teaches that course, the deletion of the
last tuple in STDINF for a given course will not cause the
information about the course's teacher to be lost.
 The problems of database inconsistency and redundancy
of data are similar to the problems that exist in the
hierarchical and network models. These problems are
addressed in the network model by the introduction of
virtual fields and in the hierarchical model by the
Decomposition
 The decomposition of a relation scheme R = (A1
,A2,...,An) is its replacement by a set of relation
schemes {R1,R2,...,Rm} such that R1 ≤ R for 1 ≤ i ≤
m and R1 ∪ R2 ∪ Rm = R
 A relation scheme R can be decomposed into a
collection of relation schemes { R1,R2,R3..., Rm } to
eliminate some of the anomalities contained in the
original relation R. Here the relation schemes R1 (1 ≤
i ≤ m) are subsets of R and the intersection of R1 ∩
Rj for i≠ j need not be empty. Furthermore, the union
of Rj (1 ≤ i ≤ m) is equal to R, i.e. R=R1 R2... Rm
Decomposition
 STUDENT_ INFO (Name, Phone_No, Major)
 TRANSCRIPT (Name, Course, Grade)
 TEACHER (Course, Prof)
 STUDENT_ INFO (Name, Phone_No, Major)
 The first relation scheme gives the phone number and the major of each student, and
such information will be stored only once for each student. Any change in the phone
number will thus require a change in only one tuple of this relation.
 TRANSCRIPT (Name, Course, Grade)
 The second relation scheme stores the grade of each student in each course that the
student is or was enrolled in. The third relation scheme records the teacher of each
course. One of the disadvantages of replacing the original relation scheme STDINF
with the three relation schemes is that the retrieval of certain information requires a
natural join operation to be performed. For instance, to find the majors of a student
who obtained a grade of A in course 353 requires a join to be performed:
(STUDENT_INFO |x| TRANSCRIPT). The same information could be derived from
the original relation STDINF by selection and projection.
Decomposition
 When we replace the original scheme STDINF with the
relation schemes STUDENT_INFO, TRANSCRIPT
and TEACHER, the consistency and referential
integrity constraints have to be enforced. The
referential integrity enforcement implies that if a tuple
in the relation TRANSCRIPT exists, such as (Jones,
353,in prog), a tuple must exist in STUDENT_INFO
with Name = Jones and furthermore, a tuple must exist
in STUDENT_INFO with Course = 353. The attribute
Name, which forms part of the key of the relation
TRANSCRIPT, is a key of the relation
STUDENT_INFO. Such an attribute (or a group of
attributes), which establishes a relationship between
specific tuples (of the same or two distinct relations), is
called a foreign key. Notice that the attribute Course in
relation TRANSCRIPT is also a foreign key, since it is
Decomposition
 the decomposition of STDINF into the relation
schemes STUDENT (Name, Phone_No, Major, Grade)
and COURSE (Course, Prof.) is a bad decomposition
for the following reasons:
 1. Redundancy and update anomaly, because the
data for the attributes Phone_no and Major are
repeated.
 2. Loss of information, because we lose the fact that a
student has a given grade in a particular list.
Database Normalization
 Database normalization is the process of removing
redundant data from your tables in to improve storage
efficiency, data integrity, and scalability.
 In the relational model, methods exist for quantifying
how efficient a database is. These classifications are
called normal forms (or NF), and there are
algorithms for converting a given database between
them.
 Normalization generally involves splitting existing
tables into multiple ones, which must be re-joined or
linked each time a query is issued.
History
 Edgar F. Codd first proposed the process of
normalization and what came to be known as the
1st normal form in his paper A Relational Model
of Data for Large Shared Data Banks Codd
stated:
“There is, in fact, a very simple elimination
procedure which we shall call normalization.
Through decomposition nonsimple domains are
replaced by ‘domains whose elements are
atomic (nondecomposable) values.’”
Normal Form
 Edgar F. Codd originally established three normal
forms: 1NF, 2NF and 3NF. There are now others that
are generally accepted, but 3NF is widely considered
to be sufficient for most applications. Most tables
when reaching 3NF are also in BCNF (Boyce-Codd
Normal Form).

Contenu connexe

Tendances

Mi0034 database management system
Mi0034   database management systemMi0034   database management system
Mi0034 database management systemsmumbahelp
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern  MatchingEfficiency of TreeMatch Algorithm in XML Tree Pattern  Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern MatchingIOSR Journals
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingPrabu U
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseRoshni Singh
 
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
 
Mit202 data base management system(dbms)
Mit202  data base management system(dbms)Mit202  data base management system(dbms)
Mit202 data base management system(dbms)smumbahelp
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal formcollege
 
Query Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionQuery Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionPrabu U
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Multi label text classification
Multi label text classificationMulti label text classification
Multi label text classificationraghavr186
 
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
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Eddyzulham Mahluzydde
 
Phylogenetic tree construction
Phylogenetic tree constructionPhylogenetic tree construction
Phylogenetic tree constructionUddalok Jana
 

Tendances (20)

Mi0034 database management system
Mi0034   database management systemMi0034   database management system
Mi0034 database management system
 
Normalization
NormalizationNormalization
Normalization
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern  MatchingEfficiency of TreeMatch Algorithm in XML Tree Pattern  Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and Hashing
 
Relational model
Relational modelRelational model
Relational model
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
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...
 
Mit202 data base management system(dbms)
Mit202  data base management system(dbms)Mit202  data base management system(dbms)
Mit202 data base management system(dbms)
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
 
Rdbms
RdbmsRdbms
Rdbms
 
Query Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionQuery Processing, Query Optimization and Transaction
Query Processing, Query Optimization and Transaction
 
Fuzzy
FuzzyFuzzy
Fuzzy
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Multi label text classification
Multi label text classificationMulti label text classification
Multi label text classification
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1
 
Phylogenetic tree construction
Phylogenetic tree constructionPhylogenetic tree construction
Phylogenetic tree construction
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 

En vedette

09.02 normalization example
09.02 normalization example09.02 normalization example
09.02 normalization exampleBishal Ghimire
 
Normalization i i
Normalization   i iNormalization   i i
Normalization i iGagan Deep
 
Dbms mini project on Appraisal tracker normalization
Dbms mini project on Appraisal tracker normalizationDbms mini project on Appraisal tracker normalization
Dbms mini project on Appraisal tracker normalizationAarav Singh
 
DBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationDBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationEricka Tagarda
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Oum Saokosal
 
Database Normalization
Database NormalizationDatabase Normalization
Database NormalizationRathan Raj
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
Data base management system
Data base management systemData base management system
Data base management systemNavneet Jingar
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 

En vedette (12)

09.02 normalization example
09.02 normalization example09.02 normalization example
09.02 normalization example
 
Normalization i i
Normalization   i iNormalization   i i
Normalization i i
 
Normalization
NormalizationNormalization
Normalization
 
D B M S Animate
D B M S AnimateD B M S Animate
D B M S Animate
 
Dbms mini project on Appraisal tracker normalization
Dbms mini project on Appraisal tracker normalizationDbms mini project on Appraisal tracker normalization
Dbms mini project on Appraisal tracker normalization
 
DBMS Lecture 8 - Normalization
DBMS Lecture 8 - NormalizationDBMS Lecture 8 - Normalization
DBMS Lecture 8 - Normalization
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Data base management system
Data base management systemData base management system
Data base management system
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 

Similaire à 09.01 normalization

MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptHemaSenthil5
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesnsrChowdary1
 
Chapter-8 Relational Database Design
Chapter-8 Relational Database DesignChapter-8 Relational Database Design
Chapter-8 Relational Database DesignKunal Anand
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designHemaSenthil5
 
Semantic Management of Deduplicate tuples in the Relational Databases
Semantic Management of Deduplicate tuples in the Relational DatabasesSemantic Management of Deduplicate tuples in the Relational Databases
Semantic Management of Deduplicate tuples in the Relational DatabasesIRJET Journal
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptBelkinAntony1
 
Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxnirajsharmapuneiat
 
Impact of Normalization in Future
Impact of Normalization in FutureImpact of Normalization in Future
Impact of Normalization in Futureijtsrd
 
Chapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxChapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxhaymanot taddesse
 

Similaire à 09.01 normalization (20)

MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
 
Chapter-8 Relational Database Design
Chapter-8 Relational Database DesignChapter-8 Relational Database Design
Chapter-8 Relational Database Design
 
Assignment#11
Assignment#11Assignment#11
Assignment#11
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in design
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Research gadot
Research gadotResearch gadot
Research gadot
 
Semantic Management of Deduplicate tuples in the Relational Databases
Semantic Management of Deduplicate tuples in the Relational DatabasesSemantic Management of Deduplicate tuples in the Relational Databases
Semantic Management of Deduplicate tuples in the Relational Databases
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Bc0041
Bc0041Bc0041
Bc0041
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
Chapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptxChapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptx
 
DBMS 3.pdf
DBMS 3.pdfDBMS 3.pdf
DBMS 3.pdf
 
Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
 
Impact of Normalization in Future
Impact of Normalization in FutureImpact of Normalization in Future
Impact of Normalization in Future
 
Chapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptxChapter Four Logical Database Design (Normalization).pptx
Chapter Four Logical Database Design (Normalization).pptx
 
Cs501 intro
Cs501 introCs501 intro
Cs501 intro
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
 

Plus de Bishal Ghimire

Counseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental HealthCounseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental HealthBishal Ghimire
 
Agile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over ProcessAgile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over ProcessBishal Ghimire
 
Earthquake in Nepal 2015
Earthquake in Nepal 2015Earthquake in Nepal 2015
Earthquake in Nepal 2015Bishal Ghimire
 
07.03 cartesian product
07.03 cartesian product07.03 cartesian product
07.03 cartesian productBishal Ghimire
 
07.02 relational union intersection
07.02 relational union intersection07.02 relational union intersection
07.02 relational union intersectionBishal Ghimire
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebraBishal Ghimire
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebraBishal Ghimire
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinctBishal Ghimire
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organizationBishal Ghimire
 
02.02 querying relational database
02.02 querying relational database02.02 querying relational database
02.02 querying relational databaseBishal Ghimire
 
02.01 relational databases
02.01 relational databases02.01 relational databases
02.01 relational databasesBishal Ghimire
 
01.01 introduction to database
01.01 introduction to database01.01 introduction to database
01.01 introduction to databaseBishal Ghimire
 
00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabusBishal Ghimire
 

Plus de Bishal Ghimire (16)

Counseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental HealthCounseling Ethics in Astrology for better Mental Health
Counseling Ethics in Astrology for better Mental Health
 
Agile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over ProcessAgile Intro to Manifesto - Values 1 - Interaction over Process
Agile Intro to Manifesto - Values 1 - Interaction over Process
 
Earthquake in Nepal 2015
Earthquake in Nepal 2015Earthquake in Nepal 2015
Earthquake in Nepal 2015
 
07.05 division
07.05 division07.05 division
07.05 division
 
07.04 joins
07.04 joins07.04 joins
07.04 joins
 
07.03 cartesian product
07.03 cartesian product07.03 cartesian product
07.03 cartesian product
 
07.02 relational union intersection
07.02 relational union intersection07.02 relational union intersection
07.02 relational union intersection
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
 
07.01 relational algebra
07.01 relational algebra07.01 relational algebra
07.01 relational algebra
 
06.02 sql alias
06.02 sql alias06.02 sql alias
06.02 sql alias
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organization
 
02.02 querying relational database
02.02 querying relational database02.02 querying relational database
02.02 querying relational database
 
02.01 relational databases
02.01 relational databases02.01 relational databases
02.01 relational databases
 
01.01 introduction to database
01.01 introduction to database01.01 introduction to database
01.01 introduction to database
 
00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus00.00 fundamentals of database management syllabus
00.00 fundamentals of database management syllabus
 

Dernier

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Dernier (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

09.01 normalization

  • 2. 9.1 Introduction  To reduce redundancy which means that information is to be stored only once  Relations are normalized so that when relations in a database are to be altered during the lifetime of the database, we do not lose information or introduce inconsistencies  Alterations normally needed are  Insertion should be possible without being forced to leave blank fields for some attributes.  Deletion should be possible without losing vital information unknowingly.  Updating should be possible without exhaustively searching all the tuples in the relation.
  • 3. 9.2 Functional Dependency  Let X and Y be the two attributes of a relation. Given the value of X, if there is only one value of Y corresponding to it, then Y is said to be functionally dependent on X. This is indicated by the notation:  X  Y  For example, given the value of item code, there is only one value of item name for it. Thus item name is functionally dependent on item code. This is shown as:  Item code  item name  Functional dependency may also be based on a composite attribute. For example, if we write  X,Z  Y
  • 4.  It means that there is only one value of Y corresponding to given values of X,Z. In other words, Y is functionally dependent on the composite X,Z.  Student (Roll_no, Name, Address , Dept , Year_of_study)  In this relation, Name is functionally dependent on Roll no. In fact, given the value of Roll no., the values of all other attributes can be uniquely determined. Name and Department are not functionally dependent, because given the name of a student, one cannot find his department uniquely. This is due to the fact that there may be more than one student with the same name. Name in this case is not a key.
  • 5. Relation Key:  Given a relation, if the value of an attribute X uniquely determines the value of all other attributes in a row, then X is said to be the key of that relation.  Sometimes more than one attribute is needed to uniquely determine other attributes in a relation row. In that case such a set of attributes is the key. RollNo Name Address Department YearOfStudy
  • 6. 9.3 Anomalies in a Database  STDINF(Name, Course, Phone_No, Major, Prof, Grade)  Dependencies :  Name  Phone_No,  Name  Major,  Name,Course  Grade  Course  Prof Name Course Phone_N o Major Prof Grade Jones 353 237-4539 Comp Sci Smith A Ng 329 427-7390 Chemistry Turner B Jones 328 237-4539 Comp Sci Clark B Martin 456 388-5183 Physics James A Dulles 293 371-6259 Decision Sci Cook C
  • 7. 9.3 Anomalies in a Database  Here the attribute Phone_No, which is not in any key of the relation scheme STDINF, is not functionally dependent on the whole key, but only one part of the key, namely, the attribute Name. Similarly, the attributes Major and Prof, which are not in any key of the relation scheme STDINF either, are fully functionally dependent on the attributes Name and Course, respectively.  Thus the determinants of these functional dependencies are again not the entire key, but only part of the key of the relation. Only the attribute Grade is fully functionally dependent on the key Name Course.
  • 8. Redundancy  The aim of the database system is to reduce redundancy, meaning that information is to be stored only once. Storing information several times leads to the waste of storage space and an increase in the total size of the data stored.  Updates to the database with such redundancies have the potential of becoming inconsistent as explained below. In the relation of table, the Major and Phone_No. of a student are stored several times in the database: once for each course that is or was taken by a student.
  • 9. Update Anomalies  Multiple copies of the same fact may lead to update anomalies or inconsistencies when an update is made, and only some of the multiple copies are updated. Thus, a change in the Phone_No. of Jones must be made, for consistency, in all tuples pertaining to the student Jones. If one of the three tuples is not changed to reflect the new Phone_No. of Jones, there will be an inconsistency in the data.
  • 10. Insertion Anomalies  If this is the only relation in the database showing the association between a faculty member and the course he or she teaches, the fact that a given professor is teaching a given course cannot be entered in the database unless a student is registered in the course. Also, if another relation also establishes a relationship between a course and a professor, who teaches that course, the information stored in these relations has to be consistent. Name Course Phone_No Major Prof Grade
  • 11. Deletion Anomalies  If the only student registered in a given course discontinues the course, the information as to which professor is offering the course will be lost, if this is the only relation in the database showing the association between a faculty member and the course she or he teaches. If another relation in the database also establishes the relationship between a course and a professor, who teaches that course, the deletion of the last tuple in STDINF for a given course will not cause the information about the course's teacher to be lost.  The problems of database inconsistency and redundancy of data are similar to the problems that exist in the hierarchical and network models. These problems are addressed in the network model by the introduction of virtual fields and in the hierarchical model by the
  • 12. Decomposition  The decomposition of a relation scheme R = (A1 ,A2,...,An) is its replacement by a set of relation schemes {R1,R2,...,Rm} such that R1 ≤ R for 1 ≤ i ≤ m and R1 ∪ R2 ∪ Rm = R  A relation scheme R can be decomposed into a collection of relation schemes { R1,R2,R3..., Rm } to eliminate some of the anomalities contained in the original relation R. Here the relation schemes R1 (1 ≤ i ≤ m) are subsets of R and the intersection of R1 ∩ Rj for i≠ j need not be empty. Furthermore, the union of Rj (1 ≤ i ≤ m) is equal to R, i.e. R=R1 R2... Rm
  • 13. Decomposition  STUDENT_ INFO (Name, Phone_No, Major)  TRANSCRIPT (Name, Course, Grade)  TEACHER (Course, Prof)  STUDENT_ INFO (Name, Phone_No, Major)  The first relation scheme gives the phone number and the major of each student, and such information will be stored only once for each student. Any change in the phone number will thus require a change in only one tuple of this relation.  TRANSCRIPT (Name, Course, Grade)  The second relation scheme stores the grade of each student in each course that the student is or was enrolled in. The third relation scheme records the teacher of each course. One of the disadvantages of replacing the original relation scheme STDINF with the three relation schemes is that the retrieval of certain information requires a natural join operation to be performed. For instance, to find the majors of a student who obtained a grade of A in course 353 requires a join to be performed: (STUDENT_INFO |x| TRANSCRIPT). The same information could be derived from the original relation STDINF by selection and projection.
  • 14. Decomposition  When we replace the original scheme STDINF with the relation schemes STUDENT_INFO, TRANSCRIPT and TEACHER, the consistency and referential integrity constraints have to be enforced. The referential integrity enforcement implies that if a tuple in the relation TRANSCRIPT exists, such as (Jones, 353,in prog), a tuple must exist in STUDENT_INFO with Name = Jones and furthermore, a tuple must exist in STUDENT_INFO with Course = 353. The attribute Name, which forms part of the key of the relation TRANSCRIPT, is a key of the relation STUDENT_INFO. Such an attribute (or a group of attributes), which establishes a relationship between specific tuples (of the same or two distinct relations), is called a foreign key. Notice that the attribute Course in relation TRANSCRIPT is also a foreign key, since it is
  • 15. Decomposition  the decomposition of STDINF into the relation schemes STUDENT (Name, Phone_No, Major, Grade) and COURSE (Course, Prof.) is a bad decomposition for the following reasons:  1. Redundancy and update anomaly, because the data for the attributes Phone_no and Major are repeated.  2. Loss of information, because we lose the fact that a student has a given grade in a particular list.
  • 16. Database Normalization  Database normalization is the process of removing redundant data from your tables in to improve storage efficiency, data integrity, and scalability.  In the relational model, methods exist for quantifying how efficient a database is. These classifications are called normal forms (or NF), and there are algorithms for converting a given database between them.  Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.
  • 17. History  Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form in his paper A Relational Model of Data for Large Shared Data Banks Codd stated: “There is, in fact, a very simple elimination procedure which we shall call normalization. Through decomposition nonsimple domains are replaced by ‘domains whose elements are atomic (nondecomposable) values.’”
  • 18. Normal Form  Edgar F. Codd originally established three normal forms: 1NF, 2NF and 3NF. There are now others that are generally accepted, but 3NF is widely considered to be sufficient for most applications. Most tables when reaching 3NF are also in BCNF (Boyce-Codd Normal Form).