Relational Design Theory

Slides:



Advertisements
Similar presentations
Normalization Decomposition techniques for ensuring: Lossless joins Dependency preservation Redundancy avoidance We will look at some normal forms: Boyce-Codd.
Advertisements

Spring 2011 Instructor: Hassan Khosravi
Jennifer Widom Relational Design Theory Motivation & overview.
Murali Mani Normalization. Murali Mani What and Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert,
Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover.
Functional Dependency Rajhdeep Jandir. Definition A functional dependency is defined as a constraint between two sets of attributes in a relation from.
Multivalued Dependency Tamer Abuelata. Introduction Goal in Databases: Goal in Databases: BCNF (Boyce Codd Normal Form) BCNF (Boyce Codd Normal Form)
METU Department of Computer Eng Ceng 302 Introduction to DBMS Relational Database Design Algorithms by Pinar Senkul resources: mostly froom Elmasri, Navathe.
Functional Dependencies and Relational Schema Design.
Jennifer Widom Relational Design Theory Boyce-Codd Normal Form.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
SCUJ. Holliday - coen 1784–1 Schedule Today: u Normal Forms. u Section 3.6. Next u Relational Algebra. Read chapter 5 to page 199 After that u SQL Queries.
1 Lecture 7: Normal Forms, Relational Algebra Monday, 10/15/2001.
1 Lecture 10: Database Design Wednesday, January 26, 2005.
Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Jennifer Widom Relational Design Theory Functional Dependencies.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
1 Lecture 9: Database Design Wednesday, January 25, 2006.
Functional Dependencies and Normalization 1 Instructor: Mohamed Eltabakh Part 2.
Lecture 11: Functional Dependencies
COP 6726: New Directions in Database Systems
Normalization Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 19.
Functional Dependency and Normalization
Advanced Normalization
Schedule Today: Next After that Normal Forms. Section 3.6.
Functional Dependency
CPSC-310 Database Systems
Database Design Dr. M.E. Fayad, Professor
Schedule Today: Jan. 23 (wed) Week of Jan 28
Chapter 8: Relational Database Design
3.1 Functional Dependencies
Advanced Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Problems in Designing Schema
11/12/2018.
Relational Design Theory
Relational Design Theory
Relational Design Theory
BCNF and Normalization
Faloutsos & Pavlo SCS /615 Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization.
Module 5: Overview of Normalization
Relational Design Theory
Normalization Murali Mani.
CSCI 4333 Database Design and Implementation – Exercise (3)
Lecture #17: Schema Refinement & Normalization - Normal Forms
Functional Dependencies and Normalization
Review  Only two chapters (6 & 7) Normalization Theory Triggers.
Functional Dependencies and Normalization
Relational Design Theory
Functional Dependencies and Relational Schema Design
Multivalued Dependencies & Fourth Normal Form
Normalization.
Relational Design Theory
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Lecture 8: Database Design
CS 405G: Introduction to Database Systems
Instructor: Mohamed Eltabakh
Boyce-Codd Normal Form
Terminology Product Attribute names Name Price Category Manufacturer
Anomalies Boyce-Codd Normal Form 3rd Normal Form
Database Design Dr. M.E. Fayad, Professor
Database Design Normalisation (2)
Lecture 6: Functional Dependencies
CSCI 6315 Applied Database Systems – Exercise (5)
Lecture 11: Functional Dependencies
Chapter 7a: Overview of Database Design -- Normalization
Functional Dependencies and Normalization
Lecture 09: Functional Dependencies
CS4222 Principles of Database System
Presentation transcript:

Relational Design Theory Boyce-Codd Normal Form

Relational design by decomposition BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties Final set of relations satisfies normal form No anomalies, no lost information Functional dependencies  Boyce-Codd Normal Form Multivalued dependences  Fourth Normal Form

Decomposition of a relational schema BCNF Decomposition of a relational schema

Decomposition Example #1 BCNF Decomposition Example #1 Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority)

Decomposition Example #2 BCNF Decomposition Example #2 Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority)

Relational design by decomposition BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties “Good” decompositions only Into “good” relations

Boyce-Codd Normal Form BCNF Boyce-Codd Normal Form Relation R with FDs is in BCNF if: For each Ᾱ  B, Ᾱ is a key

BCNF? Example #1 Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) SSN  sName, address, GPA GPA  priority HScode  HSname, HScity

BCNF? Example #2 Apply(SSN, cName, state, date, major)

Relational design by decomposition BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties “Good” decompositions only Into “good” relations

BCNF decomposition algorithm Input: relation R + FDs for R Output: decomposition of R into BCNF relations with “lossless join” Compute keys for R Repeat until all relations are in BCNF: Pick any R’ with A  B that violates BCNF Decompose R’ into R1(A, B) and R2(A, rest) Compute FDs for R1 and R2 Compute keys for R1 and R2

BCNF Decomposition Example Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) SSN  sName, address, GPA GPA  priority HScode  HSname, HScity

BCNF decomposition algorithm Input: relation R + FDs for R Output: decomposition of R into BCNF relations with “lossless join” Compute keys for R Repeat until all relations are in BCNF: Pick any R’ with A  B that violates BCNF Decompose R’ into R1(A, B) and R2(A, rest) Compute FDs for R1 and R2 Compute keys for R1 and R2

Does BCNF guarantee a good decomposition? Removes anomalies? Can logically reconstruct original relation? Too few or too many tuples?

Does BCNF guarantee a good decomposition? Removes anomalies? Can logically reconstruct original relation? Too few or too many tuples? Some shortcomings discussed in later video