Boyce-Codd normal form (BCNF) Kai Zhu CS157B Professor: Dr. Lee.

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Normalization Decomposition techniques for ensuring: Lossless joins Dependency preservation Redundancy avoidance We will look at some normal forms: Boyce-Codd.
Normalization continued CMSC 461 Michael Wilson. Normalization clarification  Normalization is simply a way of reducing anomalous database behavior 
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 4 Normalization 2NF & 3NF Presented by: Dr. Samir Tartir.
INLS 623 – D ATABASE N ORMALIZATION Instructor: Jason Carter.
Normal Forms By Christopher Archibald October 16 th 2007.
Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. 1.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Database Normalization Il-Han Yoo CS 157A Professor: Sin-Min Lee.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 8 Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Normalization Quiz Tao Li Grant Horntvedt. 1. Which of the following statements is true: a. Normal forms can be derived by inspecting the data in various.
FUNCTIONAL DEPENDENCIES
Lecture 12 Inst: Haya Sammaneh
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
CS 405G: Introduction to Database Systems 18. Normal Forms and Normalization.
Logical Database Design (2 of 3) John Ortiz. Lecture 7Logical Database Design (2)2 Finding All Candidate Keys Let F be a set of FDs satisfied by R(A 1,...,
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Normalization for Relational Databases.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Lecture9:Functional Dependencies and Normalization for Relational Databases Prepared by L. Nouf Almujally Ref. Chapter Lecture9 1.
Design Theory for Relational Databases 2015, Fall Pusan National University Ki-Joune Li.
Further Normalization I
By Abdul Rashid Ahmad. E.F. Codd proposed three normal forms: The first, second, and third normal forms 1NF, 2NF and 3NF are based on the functional dependencies.
Functional Dependencies and Normalization Jose M. Peña
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
THE RELATIONAL MODEL II IST 210: Organization of Data IST210 1.
Lecture9:Functional Dependencies and Normalization for Relational Databases Ref. Chapter Lecture9 1.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
What is normalization ? Proposed by Codd in 1972 Takes a relation through a series of steps to certify whether it satisfies a certain normal form Initially.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Normalization.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) Relational Model James Wang.
The Normal Forms 3NF and BCNF
Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.
Brian Thoms.  Databases normalization The systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
Al-Imam University Girls Education Center Collage of Computer Science 1 nd Semester, 1432/1433H Chapter 10_part2 Functional Dependencies and Normalization.
Normal Forms (Part 1) Steven Le ~ CS157B. Normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying.
Databases : Design of Relational Database Schemas 2007, Fall Pusan National University Ki-Joune Li.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
Advanced Normalization
A brief summary of database normalization
Canonical Cover & Normal Forms
Normal Forms.
Advanced Normalization
Normalization Refine data To attain a good DB design
Canonical Cover & Normal Forms
Database Normalization
Design Theory for Relational Databases
Chapter 14 & Chapter 15 Normalization Pearson Education © 2009.
Table Normal Forms.
Multivalued Dependencies & Fourth Normal Form
Multivalued Dependencies & Fourth Normal Form
Normalization.
Design Theory for Relational Databases
Presentation transcript:

Boyce-Codd normal form (BCNF) Kai Zhu CS157B Professor: Dr. Lee

Functional dependency Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y, also in R, if and only if each X value is associated with precisely one Y value. (written X → Y)

Normalization Normalization is the process of efficiently organizing data in a database Purpose: 1. Eliminate redundant data 2. Ensure data dependencies make sense

1NF Table faithfully represents a relation and has no repeating groups

non-1NF 1NF

2NF A 1NF table is in 2NF if and only if none of its non-prime attributes are functionally dependent on a subset of a candidate key. (A non-prime attribute is one that does not belong to any candidate key.)

An example of a 1NF table that does not meet 2NF is:

Candidate key: {Employee, Skill} The remaining attribute, Current Work Location, is dependent on only part of the candidate key, namely Employee. Therefore the table is not in 2NF.

3NF A 2NF table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e. directly dependent) on every key of R.

An example of a 2NF table that fails to meet the requirements of 3NF is: Candidate key: {Tournament, Year}

It is not 3NF because the non-prime attribute Winner Date of Birth is transitively dependent on the candidate key {Tournament, Year} via the non- prime attribute Winner.

Trivial functional dependency A functional dependency FD: X → Y is called trivial if Y is a subset of X.

BCNF Boyce-Codd normal form (or BCNF) is a normal form used in database normalization. A table is in BCNF if and only if for every one of its non-trivial functional dependencies X → Y, X is a superkey—that is, X is either a candidate key or a superset thereof. (Y is not included in X)

Consider the following non-BCNF table: The candidate keys of the table are: {Person, Shop Type} {Person, Nearest Shop}

It is 3NF, WHY? Recall 3NF prohibits transitive functional dependencies of non-prime attributes on candidate keys. In relation “Nearest shop” table, there are no non-prime attributes: that is, all attributes belong to candidate keys. Therefore the table adheres to both 2NF and 3NF.

Why it is not BCNF? The table does not adhere to BCNF because of the dependency Nearest shop → Shop Type, in which the determining attribute (Nearest shop ) is neither a candidate key nor a superset of a candidate key.

What we can do if we need a relation to be BCNF?

Normalizing…

After normalization Candidate keys are {person, shop} and{shop},respectively.

Thank you