SlideShare ist ein Scribd-Unternehmen logo
1 von 13
The theory of
Relational Database Design
Prepared by:
AUHAMMAD
MUZAFFAR
Table of Content
 Introduction
 Advantages and Disadvantages of
Normalization
 Update anomalies
 Sample anomalies
 Better design
 Boyce-Codd Normal Form
 Determinants
 Other Normal Forms
 END
Introduction
 Normalisation is a theory for designing
relational schema that “make sense” and
work well.
 Well-normalised tables avoid redundancy
and thereby reduce inconsistencies.
 Redundancy is unnecessary duplication.
 In well-normalised DBs semantic
dependencies are maintained by primary
key uniqueness.
Advantages and
Disadvantages of
Normalization
 Advantages:
 1. You won't have redundancy(same data stored many times in
same/different tables).
 2. You will be away from all the update anomalies and there by you
won't have any loss of data or inefficient data update process.
 3. You will have a well organized database where all the tables are
inter-related maintaining integrity and consistency of data.
 4. Your data all are stored efficiently since there is no redundency.
 5. The entire database system remains consistent over time as the
database grows with least redundancy and much durability.
 Disadvantages:
 1. Maintaining more tables is a bit messier.
 2. Nested queries over multiple tables gets tricky.
Update anomalies
 Undesirable side-effects that occur
when performaing insertion, modification
or deletion operations on badly designed
relational DBs.
SSN
987
654
333
321
678
467
Name
J Smith
M Burke
A Dolan
K Doyle
O O’Neill
R McKay
Dept
1
2
1
1
3
2
DeptMgr
321
467
321
321
678
467
Dept
Name
…
...
Representing
Department info
in the Employee
table causes
problems.
Sample anomalies
 Modification -
 when the manager of a dept changes we have to
change many values.
 If we are not careful the DB will contain
inconsistencies.
 There is no easy way to get the DB to ensure that a
department has only one manager and only one
name.
 Deletion -
 if O O’Neill leaves we delete his tuple and lose
○ the fact that there is a department 3
○ the name of dept 3
○ who is the manager of dept. 3
 Insertion
 how would we create a new department before any
employees are assigned to it ?
Better design
 Separate entities are represented in
separate tables.
SSN
987
654
333
321
678
467
Name
J Smith
M Burke
A Dolan
K Doyle
O O’Neill
R McKay
Dept
1
2
1
1
3
2
Dept
1
2
3
DeptMgr
321
467
678
Dept
Name
…
...
Note that mapping from an ER model
following the steps given will give a well-
normalised DB.
Boyce-Codd Normal Form
 After a lot of other approaches Boyce
and Codd noticed a simple rule for
ensuring tables are well-normalised.
Tables which obey the rule are in BCNF
(Boyce Codd Normal Form).
 BCNF rule:
 Every determinant in a table must be a
candidate key for that table.
Determinants
 A is a determinant of B if each value of
A has precisely one (possibly null)
associated value of B.
Said another way -
 A is a determinant of B if and only if
whenever two tuples agree on their A
value they agree on their B value.
A B
Determinants Continue…
 Note that determinancy depends on
semantics of data
 cannot be decided from individual table
occurences.
 Alternative terminology
 if A (functionally) determines B then
 B is (functionally) dependent on A
Example of Determinants
 SSN determines employee name
 SSN determines employee department
 Dept. No. determines Dept. Name
 Dept. Name determines Dept. No.
 assuming Dept. names are also unique
 Emp. Name does not determine Emp.
Dept
 two John Smiths could be in difft. Depts.
 Emp. Name does not determine SSN.
Other Normal Forms
 First NF - no multi-valued attributes
 all relational DBs are 1NF
 2NF - every non-key attribute is fully
dependent on the primary key
 3NF - eliminate functional dependencies
between non-key attributes
 all dependencies can then be enforced by
uniqueness of keys.
G H J
Table is in 2NF
but not 3NF
END

Weitere ähnliche Inhalte

Was ist angesagt?

Backup and recovery
Backup and recoveryBackup and recovery
Backup and recoverydhawal mehta
 
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Beat Signer
 
Database Administration
Database AdministrationDatabase Administration
Database AdministrationBilal Arshad
 
Query processing strategies in distributed database
Query processing strategies in distributed databaseQuery processing strategies in distributed database
Query processing strategies in distributed databaseShreerajKhatiwada
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency controlDhani Ahmad
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Database Security And Authentication
Database Security And AuthenticationDatabase Security And Authentication
Database Security And AuthenticationSudeb Das
 
RDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & PitfallsRDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & PitfallsShyam Anand
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbmsDilouar Hossain
 
Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering julia121214
 
Type of database models
Type of database modelsType of database models
Type of database modelsSanthiNivas
 

Was ist angesagt? (20)

Normalization
NormalizationNormalization
Normalization
 
DBA
DBADBA
DBA
 
Database management system basic, database, database management, learn databa...
Database management system basic, database, database management, learn databa...Database management system basic, database, database management, learn databa...
Database management system basic, database, database management, learn databa...
 
Backup and recovery
Backup and recoveryBackup and recovery
Backup and recovery
 
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
 
Database Administration
Database AdministrationDatabase Administration
Database Administration
 
Query processing strategies in distributed database
Query processing strategies in distributed databaseQuery processing strategies in distributed database
Query processing strategies in distributed database
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency control
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Database Security And Authentication
Database Security And AuthenticationDatabase Security And Authentication
Database Security And Authentication
 
RDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & PitfallsRDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & Pitfalls
 
Database anomalies
Database anomaliesDatabase anomalies
Database anomalies
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbms
 
Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Type of database models
Type of database modelsType of database models
Type of database models
 

Ähnlich wie Normalisation muzz

Dwh lecture 07-denormalization
Dwh   lecture 07-denormalizationDwh   lecture 07-denormalization
Dwh lecture 07-denormalizationSulman Ahmed
 
Dwh lecture-07-denormalization
Dwh lecture-07-denormalizationDwh lecture-07-denormalization
Dwh lecture-07-denormalizationSulman Ahmed
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems incMuthu Natarajan
 
Database Design Process
Database Design ProcessDatabase Design Process
Database Design Processmussawir20
 
Intro to Data warehousing Lecture 04
Intro to Data warehousing   Lecture 04Intro to Data warehousing   Lecture 04
Intro to Data warehousing Lecture 04AnwarrChaudary
 
Dwh lecture slidesweek7&8
Dwh lecture slidesweek7&8Dwh lecture slidesweek7&8
Dwh lecture slidesweek7&8Shani729
 
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
 
Adeshhazra_DBMS_ca1_bca4thsem.pdf
Adeshhazra_DBMS_ca1_bca4thsem.pdfAdeshhazra_DBMS_ca1_bca4thsem.pdf
Adeshhazra_DBMS_ca1_bca4thsem.pdfDwipayanSaha1
 
Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)Naman Joshi
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredDanish Mehraj
 

Ähnlich wie Normalisation muzz (20)

Access 05
Access 05Access 05
Access 05
 
Dwh lecture 07-denormalization
Dwh   lecture 07-denormalizationDwh   lecture 07-denormalization
Dwh lecture 07-denormalization
 
Dwh lecture-07-denormalization
Dwh lecture-07-denormalizationDwh lecture-07-denormalization
Dwh lecture-07-denormalization
 
Normalization,ddl,dml,dcl
Normalization,ddl,dml,dclNormalization,ddl,dml,dcl
Normalization,ddl,dml,dcl
 
Rdbms xp 03
Rdbms xp 03Rdbms xp 03
Rdbms xp 03
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
Normalization
NormalizationNormalization
Normalization
 
RDBMS concepts
RDBMS conceptsRDBMS concepts
RDBMS concepts
 
Database Design Process
Database Design ProcessDatabase Design Process
Database Design Process
 
Intro to Data warehousing Lecture 04
Intro to Data warehousing   Lecture 04Intro to Data warehousing   Lecture 04
Intro to Data warehousing Lecture 04
 
Normalization,ddl,dml,dcl
Normalization,ddl,dml,dclNormalization,ddl,dml,dcl
Normalization,ddl,dml,dcl
 
DBMS summer 19.pdf
DBMS summer 19.pdfDBMS summer 19.pdf
DBMS summer 19.pdf
 
Dwh lecture slidesweek7&8
Dwh lecture slidesweek7&8Dwh lecture slidesweek7&8
Dwh lecture slidesweek7&8
 
DBMS Part-4.pdf
DBMS Part-4.pdfDBMS Part-4.pdf
DBMS Part-4.pdf
 
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
 
Adeshhazra_DBMS_ca1_bca4thsem.pdf
Adeshhazra_DBMS_ca1_bca4thsem.pdfAdeshhazra_DBMS_ca1_bca4thsem.pdf
Adeshhazra_DBMS_ca1_bca4thsem.pdf
 
Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)Introduction to DBMS(For College Seminars)
Introduction to DBMS(For College Seminars)
 
Chapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptxChapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptx
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 

Kürzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Normalisation muzz

  • 1. The theory of Relational Database Design Prepared by: AUHAMMAD MUZAFFAR
  • 2. Table of Content  Introduction  Advantages and Disadvantages of Normalization  Update anomalies  Sample anomalies  Better design  Boyce-Codd Normal Form  Determinants  Other Normal Forms  END
  • 3. Introduction  Normalisation is a theory for designing relational schema that “make sense” and work well.  Well-normalised tables avoid redundancy and thereby reduce inconsistencies.  Redundancy is unnecessary duplication.  In well-normalised DBs semantic dependencies are maintained by primary key uniqueness.
  • 4. Advantages and Disadvantages of Normalization  Advantages:  1. You won't have redundancy(same data stored many times in same/different tables).  2. You will be away from all the update anomalies and there by you won't have any loss of data or inefficient data update process.  3. You will have a well organized database where all the tables are inter-related maintaining integrity and consistency of data.  4. Your data all are stored efficiently since there is no redundency.  5. The entire database system remains consistent over time as the database grows with least redundancy and much durability.  Disadvantages:  1. Maintaining more tables is a bit messier.  2. Nested queries over multiple tables gets tricky.
  • 5. Update anomalies  Undesirable side-effects that occur when performaing insertion, modification or deletion operations on badly designed relational DBs. SSN 987 654 333 321 678 467 Name J Smith M Burke A Dolan K Doyle O O’Neill R McKay Dept 1 2 1 1 3 2 DeptMgr 321 467 321 321 678 467 Dept Name … ... Representing Department info in the Employee table causes problems.
  • 6. Sample anomalies  Modification -  when the manager of a dept changes we have to change many values.  If we are not careful the DB will contain inconsistencies.  There is no easy way to get the DB to ensure that a department has only one manager and only one name.  Deletion -  if O O’Neill leaves we delete his tuple and lose ○ the fact that there is a department 3 ○ the name of dept 3 ○ who is the manager of dept. 3  Insertion  how would we create a new department before any employees are assigned to it ?
  • 7. Better design  Separate entities are represented in separate tables. SSN 987 654 333 321 678 467 Name J Smith M Burke A Dolan K Doyle O O’Neill R McKay Dept 1 2 1 1 3 2 Dept 1 2 3 DeptMgr 321 467 678 Dept Name … ... Note that mapping from an ER model following the steps given will give a well- normalised DB.
  • 8. Boyce-Codd Normal Form  After a lot of other approaches Boyce and Codd noticed a simple rule for ensuring tables are well-normalised. Tables which obey the rule are in BCNF (Boyce Codd Normal Form).  BCNF rule:  Every determinant in a table must be a candidate key for that table.
  • 9. Determinants  A is a determinant of B if each value of A has precisely one (possibly null) associated value of B. Said another way -  A is a determinant of B if and only if whenever two tuples agree on their A value they agree on their B value. A B
  • 10. Determinants Continue…  Note that determinancy depends on semantics of data  cannot be decided from individual table occurences.  Alternative terminology  if A (functionally) determines B then  B is (functionally) dependent on A
  • 11. Example of Determinants  SSN determines employee name  SSN determines employee department  Dept. No. determines Dept. Name  Dept. Name determines Dept. No.  assuming Dept. names are also unique  Emp. Name does not determine Emp. Dept  two John Smiths could be in difft. Depts.  Emp. Name does not determine SSN.
  • 12. Other Normal Forms  First NF - no multi-valued attributes  all relational DBs are 1NF  2NF - every non-key attribute is fully dependent on the primary key  3NF - eliminate functional dependencies between non-key attributes  all dependencies can then be enforced by uniqueness of keys. G H J Table is in 2NF but not 3NF
  • 13. END