Database Design – Lecture 9 Normalization Continued.

Slides:



Advertisements
Similar presentations
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
Advertisements

Chapter 5 Normalization of Database Tables
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Athabasca University Under Development for COMP 200 Gary Novokowsky
Chapter 5 Normalization of Database Tables
Normalization of Database Tables Special adaptation for INFS-3200
Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. 1.
Need for Normalization
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.
Relation StudentAdvisor ( St_id, St_fname, St_lname, St_major, Semester, Adv_fname, Adv_lname, Adv_ , Adv_dept, Adv_id) Primary Key: St_id, Semester.
Normalization of Database Tables
Normalization I.
Normalization of Database Tables
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Chapter 5 Normalization of Database Tables
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
5 Chapter 5 Normalization of Database Tables Example Database Systems: Design, Implementation, and Management, Rob and Coronel Special adaptation for INFS-3200.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
NORMALIZATION N. HARIKA (CSC).
Chapter 5 Normalization of Database Tables
Lecture 12 Inst: Haya Sammaneh
SQL Normalization Database Design Lecture 5. Copyright 2006Page 2 SQL Normalization Database Design 1 st Normal Form 1 st Normal Form 2 nd Normal Form.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
Avoiding Database Anomalies
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Database Systems: Design, Implementation, and Management Tenth Edition
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
Data Normalization Normal is not something to aspire to, it's something to get away from. ~ Jodie Foster ~
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 4 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 4 Normalization.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Data Normalization Normal is not something to aspire to, it's something to get away from. ~ Jodie Foster ~
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
Lecture No 14 Functional Dependencies & Normalization ( III ) Mar 04 th 2011 Database Systems.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design – Lecture 8
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Normalization of Database Tables
Data Analysis Improving Database Design. Normalization The process of transforming a data model into a flexible, stable structure. Reduces anomalies Anomaly.
Chapter 4 Normalization of Database Tables. 2 Database Tables and Normalization Table is basic building block in database design Table is basic building.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
The Normal Forms 3NF and BCNF
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
Logical Database Design and Relational Data Model Muhammad Nasir
Normalization Or theoretical and common sense approaches to redesigning a database.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
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.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
Normalization.
Normalization (Chapter 2)
SEEM3430: Information Systems Analysis and Design
Payroll Management System
Normalization A337.
CS 3630 Database Design and Implementation
Normalization of DB relations examples Fall 2015
Chapter 14 Normalization Pearson Education © 2009.
Presentation transcript:

Database Design – Lecture 9 Normalization Continued

2 Lecture Objectives Review of 1NF, 2NF, 3NF Normalization: Boyce-Codd Normal Form Long Descriptions

3 Normalization Steps 1NF All key attributes are defined No repeating groups All attributes are functionally dependent on the primary key 2NF Table is in 1NF No partial dependencies

4 Normalization Steps 3NF Table is in 2NF No transitive dependencies

5 Boyce-Codd Normal Form (BCNF) If a non key attribute is the determinate of a key attribute, then the table is not in BCNF. A determinant is any attribute whose value directly affects and determines other values within a row. A 3NF table with one candidate key is already in BCNF If a key attribute is the determinate of a key attribute, then the table is not in BCNF.

6 3NF Table Not in BCNF ABcdABcd 1NF Table is not in BCNF because attribute c (a non-key attribute) can identify attribute B (which is part of the primary key) To put table into BCNF, make c a primary key and make B an attribute. You revert to 2NF ABcdABcd 2NF ?

7 3NF Table Not in BCNF AcBdAcBd 1NF Partial dependency exists on attribute C of the composite primary key AcBdAcBd 2NF

8 3NF Table Not in BCNF Write each key component on separate line, then write dependent attributes after each key. AcBdAcBd 2NF 1NF: TABLE1 (A(PK), c(PK), B, d) 2NF: TABLE2 (c(PK), B) TABLE1 (A(PK), c(PK, FK), d) 1NF

9 BCNF Example

10 Long Descriptoins As a general rule, a description type field in a table is variable in length For example: UNIT NUM SIZE (SQ FEET) NUM BEDROOMS NUM BATHROOMS VIEW DESCRIPTION West view Direct south view over busy street Corner unit facing south west overlooking major intersection View of lake

11 Long Descriptions To avoid defining a field of such variable length in a table, create a new table to hold just the description PK of new table will be FK in original table and it will be a 1:1 relationship CONDO (UNIT_NUM (PK), SQ_FT, NUM_BEDRS, NUM_BATHS, DESC_ID (FK)) CONDO_DESC (DESC_ID (PK), VIEW DESCRIPTION)

12 Normalization Steps 1NF All key attributes are defined No repeating groups All attributes are functionally dependent on the primary key 2NF Table is in 1NF No partial dependencies

13 Normalization Steps 3NF Table is in 2NF No transitive dependencies BCNF Table is in 3NF No key attributes dependent on a non-key attribute