Southern Methodist University CSE 2337 1 CSE 2337 Introduction to Data Management Chapter 5 Part II.

Slides:



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

Chapter 5 Normalization of Database Tables
Database Tables and Normalization
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
4/30/2015 Database Design:Normalization. 4/30/2015 Functional Dependence An attribute (column) B, is functionally dependent on another attribute A if.
Example 18 SELECT count(*) FROM Part WHERE Class="HW";
Chapter 5 Normalization of Database Tables
Normalization of Database Tables Special adaptation for INFS-3200
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Concepts of Database Management, 4th Edition, Pratt & Adamski
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
SQL – Part II Yong Choi School of Business CSU, Bakersfield.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization of Database Tables
4 Chapter 4 Normalization Hachim Haddouti. 4 Hachim Haddouti, CH4, see also Rob & Coronel 2 In this chapter, you will learn: What normalization is and.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
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.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
NORMALIZATION N. HARIKA (CSC).
Part ( PartNum, Description, OnHand, Class, Warehouse, Price,
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.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Lecture 12 Inst: Haya Sammaneh
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
SQL – Part II Yong Choi School of Business CSU, Bakersfield.
Avoiding Database Anomalies
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
Concepts of Database Management, Fifth Edition
The Relational Model and Normalization R. Nakatsu.
1 A Guide to MySQL 2 Database Design Fundamentals.
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Chapter 5: Normalizing the DB. What to do with a bad database structure? How do we determine the right structure? How do we determine primary keys? Normalization.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
1 A Guide to MySQL 2 Database Design Fundamentals.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design – Lecture 8
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
NORMALIZATION. What is Normalization  The process of effectively organizing data in a database  Two goals  To eliminate redundant data  Ensure data.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
Microsoft Access 2010 Chapter 11 Database Design.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
Normalization ACSC 425 Database Management Systems.
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
1 First Normal Form (1NF) Unnormalized table : Contains a repeating group –Eg: from multi-valued attributes –Eg: from many-many relationship Table in 1NF:
Normalization.
A Guide to SQL, Eighth Edition
Database, tables and normal forms
Normalization Karolina muszyńska
Chapter 11 Database Design
Concepts of Database Management Eighth Edition
Normalization of Database Tables PRESENTED BY TANVEERA AKHTER FOR BCA 2ND YEAR dated:15/09/2015 DEPT. OF COMPUTER SCIENCE.
Normalization – Part II
Example 2 SELECT Customernum, CustomerName, Balance FROM Customer;
Chapter 14 Normalization Pearson Education © 2009.
Presentation transcript:

Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II

Southern Methodist University CSE Overview Functional Dependencies Primary Keys (and others) Normal Forms Problems with un-normalized forms Normalization in the design process

Southern Methodist University CSE NF Review Eliminate repeating groups

Southern Methodist University CSE NF – More Un-normalized to 1NF –Primary key will usually include the original primary key concatenated with the key to the repeating group –The key to the repeating group is the column that distinguished one occurrence of the repeating group from another on a given row.

Southern Methodist University CSE Problems with 1NF Still an issue with Redundancy Problems with update anomalies –Updates –Inconsistent Data –Additions –Deletions

Southern Methodist University CSE Problems with 1NF Update –Information in multiple rows and therefore difficult to update Inconsistency –Because of redundancy, a row that isn’t updated causes inconsistent data Additions –Dummy records are required to add new and unused dependent rows Deletions –May loose information that is still needed

Southern Methodist University CSE NF Problems with 1NF happen (mostly) because a column is dependent on only a portion of the primary key and not the complete primary key for the table Requirements for Second Normal Form –In 1NF –No non-key column is dependent on only a portion of the primary key

Southern Methodist University CSE Dependency Diagram Use arrows to indicate functional dependencies Partial Dependency – dependent on only a portion of the primary key OrderNumOrderDatePartNumDescriptionNumOrderedQuotePrice

Southern Methodist University CSE NF Another definition –In 1NF –No partial dependencies Resolution????? –Take each subset of the columns that make up the PK –Make new table with this subset as the primary key

Southern Methodist University CSE NF for Orders Table (OrderNum, (PartNum, (OrderNum, PartNum (OrderNum, OrderDate) (PartNum, Description) (OrderNum, PartNum, NumOrdered, QuotedPrice)

Southern Methodist University CSE Problems with 2NF Data redundancy

Southern Methodist University CSE Problems with 2NF Consider the table –Customer (customerNum, customerName, balance, creditLimit, repNum, lastName, firstName) Functional Dependencies: –CustomerNum → CustomerName, Balance,CreditLimit, RepNum, LastName, FirstName –RepNum → lastName, FirstName

Southern Methodist University CSE NF and Determinants Determinant – Any column (or collection thereof) that determines another column Third Normal Form (3NF) –2NF –Only determinants in the table are part of they PK

Southern Methodist University CSE NF for Customer Table To resolve redundancy –For each determinant that is not a candidate key, remove columns that are dependent on this column (but not the determinant column itself) –Put all columns (including determinant) in a new table –Make the determinant the primary key for the new table

Southern Methodist University CSE NF For Customer Table

Southern Methodist University CSE NF Technically, our 3NF is really Boyce- Codd Normal Form (BCNF). Codd was the father of RDBMS theory