SlideShare a Scribd company logo
1 of 33
Entity Relationship Diagram 
Satya Pal
Database Design Process 
Conceptual 
Model 
Logical 
Model 
External 
Model 
Conceptual 
requirements 
Conceptual 
requirements 
Conceptual 
requirements 
Conceptual 
requirements 
Application 1 
Application 1 
Application 2 Application 3 Application 4 
Application 2 
Application 3 
Application 4 
External 
Model 
External 
Model 
External 
Model 
Internal 
Model
Logical Design: Mapping to a Relational Model 
 Each entity in the ER Diagram becomes a relation. 
 A properly normalized ER diagram will indicate 
where intersection relations for many-to-many 
mappings are needed. 
 Relationships are indicated by common columns 
(or domains) in tables that are related. 
 We will examine the tables for the Diveshop 
derived from the ER diagram
Mapping to Other Models 
 Hierarchical 
 Need to make decisions about access paths 
 Network 
 Need to pre-specify all of the links and sets 
 Object-Oriented 
 What are the objects, datatypes, their methods and the access points for them 
 Object-Relational 
 Same as relational, but what new datatypes might be needed or useful (more on 
OR later)
What is Normalization 
 Normalization theory is based on the observation that relations with certain 
properties are more effective in inserting, updating and deleting data than 
other sets of relations containing the same data 
 Normalization is a multi-step process beginning with an “unnormalized” 
relation 
 Hospital example from Atre, S. Data Base: Structured Techniques for Design, 
Performance, and Management.
Normal Forms 
 First Normal Form (1NF) 
 Second Normal Form (2NF) 
 Third Normal Form (3NF) 
 Boyce-Codd Normal Form (BCNF) 
 Fourth Normal Form (4NF) 
 Fifth Normal Form (5NF)
Unnormalized Relations 
 First step in normalization is to convert the data into a two-dimensional table 
 In unnormalized relations data can repeat within a column
First Normal Form 
 To move to First Normal Form a relation must contain only atomic values at 
each row and column. 
 No repeating groups 
 A column or set of columns is called a Candidate Key when its values can uniquely 
identify the row in the relation.
1NF Storage Anomalies 
 Insertion: A new patient has not yet undergone surgery -- 
hence no surgeon # -- Since surgeon # is part of the key 
we can’t insert. 
 Insertion: If a surgeon is newly hired and hasn’t operated 
yet -- there will be no way to include that person in the 
database. 
 Update: If a patient comes in for a new procedure, and 
has moved, we need to change multiple address entries. 
 Deletion (type 1): Deleting a patient record may also 
delete all info about a surgeon. 
 Deletion (type 2): When there are functional 
dependencies (like side effects and drug) changing one 
item eliminates other information.
Second Normal Form 
 A relation is said to be in Second Normal Form when every nonkey attribute is 
fully functionally dependent on the primary key. 
 That is, every nonkey attribute needs the full primary key for unique identification
Second Normal Form 
Patient # Patient Name Patient Address 
1111 John White 
15 New St. New 
York, NY 
1234 Mary Jones 
10 Main St. Rye, 
NY 
2345 
Charles 
Brown 
Dogwood Lane 
Harrison, NY 
4876 Hal Kane 
55 Boston Post 
Road, Chester, 
5123 Paul Kosher 
Blind Brook 
Mamaroneck, NY 
6845 Ann Hood 
Hilton Road 
Larchmont, NY
Second Normal Form 
Surgeon # Surgeon Name 
145 Beth Little 
189 David Rosen 
243 Charles Field 
311 Michael Diamond 
467 Patricia Gold
1NF Storage Anomalies Removed 
 Insertion: Can now enter new patients without 
surgery. 
 Insertion: Can now enter Surgeons who haven’t 
operated. 
 Deletion (type 1): If Charles Brown dies the 
corresponding tuples from Patient and Surgery tables 
can be deleted without losing information on David 
Rosen. 
 Update: If John White comes in for third time, and 
has moved, we only need to change the Patient table
2NF Storage Anomalies 
 Insertion: Cannot enter the fact that a particular drug 
has a particular side effect unless it is given to a 
patient. 
 Deletion: If John White receives some other drug 
because of the penicillin rash, and a new drug and 
side effect are entered, we lose the information that 
penicillin can cause a rash 
 Update: If drug side effects change (a new formula) 
we have to update multiple occurrences of side 
effects.
Third Normal Form 
 A relation is said to be in Third Normal Form if there 
is no transitive functional dependency between 
nonkey attributes 
 When one nonkey attribute can be determined with one or 
more nonkey attributes there is said to be a transitive 
functional dependency. 
 The side effect column in the Surgery table is 
determined by the drug administered 
 Side effect is transitively functionally dependent on drug so 
Surgery is not 3NF
Third Normal Form 
Patient # Surgeon # Surgery Date Surgery Drug Admin 
1111 145 01-Jan-95 Gallstones removal Penicillin 
1111 311 12-Jun-95 
Kidney stones 
removal none 
1234 243 05-Apr-94 Eye Cataract removal Tetracycline 
1234 467 10-May-95 Thrombosis removal none 
2345 189 08-Jan-96 Open Heart Surgery Cephalosporin 
4876 145 05-Nov-95 Cholecystectomy Demicillin 
5123 145 10-May-95 Gallstones Removal none 
6845 243 15-Dec-84 Eye cataract removal none 
6845 243 05-Apr-94 
Eye Cornea 
Replacement Tetracycline
Third Normal Form 
Drug Admin Side Effects 
Cephalosporin none 
Demicillin none 
none none 
Penicillin rash 
Tetracycline Fever
2NF Storage Anomalies Removed 
 Insertion: We can now enter the fact that a particular drug has a particular 
side effect in the Drug relation. 
 Deletion: If John White recieves some other drug as a result of the rash from 
penicillin, but the information on penicillin and rash is maintained. 
 Update: The side effects for each drug appear only once.
Boyce-Codd Normal Form 
 Most 3NF relations are also BCNF relations. 
 A 3NF relation is NOT in BCNF if: 
 Candidate keys in the relation are composite keys (they are not single attributes) 
 There is more than one candidate key in the relation, and 
 The keys are not disjoint, that is, some attributes in the keys are common
Most 3NF Relations are also BCNF – Is this 
one? Patient # Patient Name Patient Address 
1111 John White 
15 New St. New 
York, NY 
1234 Mary Jones 
10 Main St. Rye, 
NY 
2345 
Charles 
Brown 
Dogwood Lane 
Harrison, NY 
4876 Hal Kane 
55 Boston Post 
Road, Chester, 
5123 Paul Kosher 
Blind Brook 
Mamaroneck, NY 
6845 Ann Hood 
Hilton Road 
Larchmont, NY
BCNF Relations 
Patient # Patient Name 
1111 John White 
1234 Mary Jones 
2345 
Charles 
Brown 
4876 Hal Kane 
5123 Paul Kosher 
6845 Ann Hood 
Patient # Patient Address 
1111 
15 New St. New 
York, NY 
1234 
10 Main St. Rye, 
NY 
2345 
Dogwood Lane 
Harrison, NY 
4876 
55 Boston Post 
Road, Chester, 
5123 
Blind Brook 
Mamaroneck, NY 
6845 
Hilton Road 
Larchmont, NY
Fourth Normal Form 
 Any relation is in Fourth Normal Form if it is BCNF and any multivalued 
dependencies are trivial 
 Eliminate non-trivial multivalued dependencies by projecting into simpler 
tables
Fifth Normal Form 
 A relation is in 5NF if every join dependency in the relation is implied by the 
keys of the relation 
 Implies that relations that have been decomposed in previous NF can be 
recombined via natural joins to recreate the original relation.
Effectiveness and Efficiency Issues for DBMS 
 Focus on the relational model 
 Any column in a relational database can be searched for values. 
 To improve efficiency indexes using storage structures such as BTrees and 
Hashing are used 
 But many useful functions are not indexable and require complete scans of 
the the database
Example: Text Fields 
 In conventional RDBMS, when a text field is indexed, only exact matching of 
the text field contents (or Greater-than and Less-than). 
 Can search for individual words using pattern matching, but a full scan is required. 
 Text searching is still done best (and fastest) by specialized text search 
programs (Search Engines) that we will look at more later.
Normalization 
 Normalization is performed to reduce or eliminate Insertion, Deletion or 
Update anomalies. 
 However, a completely normalized database may not be the most efficient or 
effective implementation. 
 “Denormalization” is sometimes used to improve efficiency.
Normalizing to death 
 Normalization splits database information across multiple tables. 
 To retrieve complete information from a normalized database, the JOIN 
operation must be used. 
 JOIN tends to be expensive in terms of processing time, and very large joins 
are very expensive.
Downward Denormalization 
Customer 
ID 
Address 
Name 
Telephone 
Order 
Order No 
Date Taken 
Date Dispatched 
Date Invoiced 
Cust ID 
Before: 
Customer 
ID 
Address 
Name 
Telephone 
Order 
Order No 
Date Taken 
Date Dispatched 
Date Invoiced 
Cust ID 
Cust Name 
After:
IS 257 – Fall 
2004 
Upward Denormalization 
Order 
Order No 
Date Taken 
Date Dispatched 
Date Invoiced 
Cust ID 
Cust Name 
Order Price 
Order Item 
Order No 
Item No 
Item Price 
Num 
Ordered 
Order 
Order No 
Date Taken 
Date Dispatched 
Date Invoiced 
Cust ID 
Cust Name 
Order Item 
Order No 
Item No 
Item Price 
Num 
Ordered
Denormalization 
 Usually driven by the need to improve query speed 
 Query speed is improved at the expense of more complex or problematic DML 
(Data manipulation language) for updates, deletions and insertions.
Using RDBMS to help normalize 
 Example database: Cookie 
 Database of books, libraries, publisher and holding information for a shared 
(union) catalog
IS 257 – Fall 
2004 
Cookie relationships
Thank you 
Hope these contents are useful for you to 
grasp the normalization concept

More Related Content

What's hot

Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - Normalization
Nickkisha Farrell
 

What's hot (20)

Sql Server Basics
Sql Server BasicsSql Server Basics
Sql Server Basics
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Normal forms
Normal formsNormal forms
Normal forms
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - Normalization
 
Advanced normalization - Bcnf
Advanced normalization - BcnfAdvanced normalization - Bcnf
Advanced normalization - Bcnf
 
Data Modeling
Data ModelingData Modeling
Data Modeling
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Denormalization
DenormalizationDenormalization
Denormalization
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionary
 
Basic SQL
Basic SQLBasic SQL
Basic SQL
 
Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
normaliztion
normaliztionnormaliztion
normaliztion
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Lecture 07 - Basic SQL
Lecture 07 - Basic SQLLecture 07 - Basic SQL
Lecture 07 - Basic SQL
 
Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 
8 python data structure-1
8 python data structure-18 python data structure-1
8 python data structure-1
 
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in database
 

Similar to Entity relationship diagram - Concept on normalization

b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
Dimara Hakim
 
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
nsrChowdary1
 
Normalization by Ashwin and Tanmay
Normalization by Ashwin and TanmayNormalization by Ashwin and Tanmay
Normalization by Ashwin and Tanmay
Ashwin Dinoriya
 
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
B087PutraMaulanaSyah
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
Joan Ador
 

Similar to Entity relationship diagram - Concept on normalization (20)

2 normalization
2 normalization2 normalization
2 normalization
 
b - Normalizing a Data Model
b - Normalizing a Data Modelb - Normalizing a Data Model
b - Normalizing a Data Model
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.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
 
Normalization by Ashwin and Tanmay
Normalization by Ashwin and TanmayNormalization by Ashwin and Tanmay
Normalization by Ashwin and Tanmay
 
Normalization review
Normalization reviewNormalization review
Normalization review
 
Normalization_review.ppt
Normalization_review.pptNormalization_review.ppt
Normalization_review.ppt
 
Normalization
Normalization Normalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Research gadot
Research gadotResearch gadot
Research gadot
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Normalization in relational database management systems
Normalization in relational database management systemsNormalization in relational database management systems
Normalization in relational database management systems
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Relational Theory for Budding Einsteins -- LonestarPHP 2016
Relational Theory for Budding Einsteins -- LonestarPHP 2016Relational Theory for Budding Einsteins -- LonestarPHP 2016
Relational Theory for Budding Einsteins -- LonestarPHP 2016
 
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
(Chapman & Hall_CRC texts in statistical science series) Peter Sprent, Nigel ...
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
 
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
 
Throw the Semantic Web at Today's Health-care
Throw the Semantic Web at Today's Health-careThrow the Semantic Web at Today's Health-care
Throw the Semantic Web at Today's Health-care
 
Intro to Data warehousing lecture 10
Intro to Data warehousing   lecture 10Intro to Data warehousing   lecture 10
Intro to Data warehousing lecture 10
 

Recently uploaded

Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
HyderabadDolls
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 

Recently uploaded (20)

TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
 

Entity relationship diagram - Concept on normalization

  • 2. Database Design Process Conceptual Model Logical Model External Model Conceptual requirements Conceptual requirements Conceptual requirements Conceptual requirements Application 1 Application 1 Application 2 Application 3 Application 4 Application 2 Application 3 Application 4 External Model External Model External Model Internal Model
  • 3. Logical Design: Mapping to a Relational Model  Each entity in the ER Diagram becomes a relation.  A properly normalized ER diagram will indicate where intersection relations for many-to-many mappings are needed.  Relationships are indicated by common columns (or domains) in tables that are related.  We will examine the tables for the Diveshop derived from the ER diagram
  • 4. Mapping to Other Models  Hierarchical  Need to make decisions about access paths  Network  Need to pre-specify all of the links and sets  Object-Oriented  What are the objects, datatypes, their methods and the access points for them  Object-Relational  Same as relational, but what new datatypes might be needed or useful (more on OR later)
  • 5. What is Normalization  Normalization theory is based on the observation that relations with certain properties are more effective in inserting, updating and deleting data than other sets of relations containing the same data  Normalization is a multi-step process beginning with an “unnormalized” relation  Hospital example from Atre, S. Data Base: Structured Techniques for Design, Performance, and Management.
  • 6. Normal Forms  First Normal Form (1NF)  Second Normal Form (2NF)  Third Normal Form (3NF)  Boyce-Codd Normal Form (BCNF)  Fourth Normal Form (4NF)  Fifth Normal Form (5NF)
  • 7. Unnormalized Relations  First step in normalization is to convert the data into a two-dimensional table  In unnormalized relations data can repeat within a column
  • 8. First Normal Form  To move to First Normal Form a relation must contain only atomic values at each row and column.  No repeating groups  A column or set of columns is called a Candidate Key when its values can uniquely identify the row in the relation.
  • 9. 1NF Storage Anomalies  Insertion: A new patient has not yet undergone surgery -- hence no surgeon # -- Since surgeon # is part of the key we can’t insert.  Insertion: If a surgeon is newly hired and hasn’t operated yet -- there will be no way to include that person in the database.  Update: If a patient comes in for a new procedure, and has moved, we need to change multiple address entries.  Deletion (type 1): Deleting a patient record may also delete all info about a surgeon.  Deletion (type 2): When there are functional dependencies (like side effects and drug) changing one item eliminates other information.
  • 10. Second Normal Form  A relation is said to be in Second Normal Form when every nonkey attribute is fully functionally dependent on the primary key.  That is, every nonkey attribute needs the full primary key for unique identification
  • 11. Second Normal Form Patient # Patient Name Patient Address 1111 John White 15 New St. New York, NY 1234 Mary Jones 10 Main St. Rye, NY 2345 Charles Brown Dogwood Lane Harrison, NY 4876 Hal Kane 55 Boston Post Road, Chester, 5123 Paul Kosher Blind Brook Mamaroneck, NY 6845 Ann Hood Hilton Road Larchmont, NY
  • 12. Second Normal Form Surgeon # Surgeon Name 145 Beth Little 189 David Rosen 243 Charles Field 311 Michael Diamond 467 Patricia Gold
  • 13. 1NF Storage Anomalies Removed  Insertion: Can now enter new patients without surgery.  Insertion: Can now enter Surgeons who haven’t operated.  Deletion (type 1): If Charles Brown dies the corresponding tuples from Patient and Surgery tables can be deleted without losing information on David Rosen.  Update: If John White comes in for third time, and has moved, we only need to change the Patient table
  • 14. 2NF Storage Anomalies  Insertion: Cannot enter the fact that a particular drug has a particular side effect unless it is given to a patient.  Deletion: If John White receives some other drug because of the penicillin rash, and a new drug and side effect are entered, we lose the information that penicillin can cause a rash  Update: If drug side effects change (a new formula) we have to update multiple occurrences of side effects.
  • 15. Third Normal Form  A relation is said to be in Third Normal Form if there is no transitive functional dependency between nonkey attributes  When one nonkey attribute can be determined with one or more nonkey attributes there is said to be a transitive functional dependency.  The side effect column in the Surgery table is determined by the drug administered  Side effect is transitively functionally dependent on drug so Surgery is not 3NF
  • 16. Third Normal Form Patient # Surgeon # Surgery Date Surgery Drug Admin 1111 145 01-Jan-95 Gallstones removal Penicillin 1111 311 12-Jun-95 Kidney stones removal none 1234 243 05-Apr-94 Eye Cataract removal Tetracycline 1234 467 10-May-95 Thrombosis removal none 2345 189 08-Jan-96 Open Heart Surgery Cephalosporin 4876 145 05-Nov-95 Cholecystectomy Demicillin 5123 145 10-May-95 Gallstones Removal none 6845 243 15-Dec-84 Eye cataract removal none 6845 243 05-Apr-94 Eye Cornea Replacement Tetracycline
  • 17. Third Normal Form Drug Admin Side Effects Cephalosporin none Demicillin none none none Penicillin rash Tetracycline Fever
  • 18. 2NF Storage Anomalies Removed  Insertion: We can now enter the fact that a particular drug has a particular side effect in the Drug relation.  Deletion: If John White recieves some other drug as a result of the rash from penicillin, but the information on penicillin and rash is maintained.  Update: The side effects for each drug appear only once.
  • 19. Boyce-Codd Normal Form  Most 3NF relations are also BCNF relations.  A 3NF relation is NOT in BCNF if:  Candidate keys in the relation are composite keys (they are not single attributes)  There is more than one candidate key in the relation, and  The keys are not disjoint, that is, some attributes in the keys are common
  • 20. Most 3NF Relations are also BCNF – Is this one? Patient # Patient Name Patient Address 1111 John White 15 New St. New York, NY 1234 Mary Jones 10 Main St. Rye, NY 2345 Charles Brown Dogwood Lane Harrison, NY 4876 Hal Kane 55 Boston Post Road, Chester, 5123 Paul Kosher Blind Brook Mamaroneck, NY 6845 Ann Hood Hilton Road Larchmont, NY
  • 21. BCNF Relations Patient # Patient Name 1111 John White 1234 Mary Jones 2345 Charles Brown 4876 Hal Kane 5123 Paul Kosher 6845 Ann Hood Patient # Patient Address 1111 15 New St. New York, NY 1234 10 Main St. Rye, NY 2345 Dogwood Lane Harrison, NY 4876 55 Boston Post Road, Chester, 5123 Blind Brook Mamaroneck, NY 6845 Hilton Road Larchmont, NY
  • 22. Fourth Normal Form  Any relation is in Fourth Normal Form if it is BCNF and any multivalued dependencies are trivial  Eliminate non-trivial multivalued dependencies by projecting into simpler tables
  • 23. Fifth Normal Form  A relation is in 5NF if every join dependency in the relation is implied by the keys of the relation  Implies that relations that have been decomposed in previous NF can be recombined via natural joins to recreate the original relation.
  • 24. Effectiveness and Efficiency Issues for DBMS  Focus on the relational model  Any column in a relational database can be searched for values.  To improve efficiency indexes using storage structures such as BTrees and Hashing are used  But many useful functions are not indexable and require complete scans of the the database
  • 25. Example: Text Fields  In conventional RDBMS, when a text field is indexed, only exact matching of the text field contents (or Greater-than and Less-than).  Can search for individual words using pattern matching, but a full scan is required.  Text searching is still done best (and fastest) by specialized text search programs (Search Engines) that we will look at more later.
  • 26. Normalization  Normalization is performed to reduce or eliminate Insertion, Deletion or Update anomalies.  However, a completely normalized database may not be the most efficient or effective implementation.  “Denormalization” is sometimes used to improve efficiency.
  • 27. Normalizing to death  Normalization splits database information across multiple tables.  To retrieve complete information from a normalized database, the JOIN operation must be used.  JOIN tends to be expensive in terms of processing time, and very large joins are very expensive.
  • 28. Downward Denormalization Customer ID Address Name Telephone Order Order No Date Taken Date Dispatched Date Invoiced Cust ID Before: Customer ID Address Name Telephone Order Order No Date Taken Date Dispatched Date Invoiced Cust ID Cust Name After:
  • 29. IS 257 – Fall 2004 Upward Denormalization Order Order No Date Taken Date Dispatched Date Invoiced Cust ID Cust Name Order Price Order Item Order No Item No Item Price Num Ordered Order Order No Date Taken Date Dispatched Date Invoiced Cust ID Cust Name Order Item Order No Item No Item Price Num Ordered
  • 30. Denormalization  Usually driven by the need to improve query speed  Query speed is improved at the expense of more complex or problematic DML (Data manipulation language) for updates, deletions and insertions.
  • 31. Using RDBMS to help normalize  Example database: Cookie  Database of books, libraries, publisher and holding information for a shared (union) catalog
  • 32. IS 257 – Fall 2004 Cookie relationships
  • 33. Thank you Hope these contents are useful for you to grasp the normalization concept