IT 20303 The Relational DBMS Section 05. Relational Database Theory Normalization for Logical Database Design.

Slides:



Advertisements
Similar presentations
Normalization What is it?
Advertisements

Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Normalisation The theory of Relational Database Design.
Logical Data Modeling Review Lecture for University of Agder, Grimstad DAT202 Databaser (5.5.11) Judith Molka-Danielsen
Normalization of Database Tables
Design Guidelines Normalisation Table Design. Informal Design Guidelines Table Semantics A table should hold information about one and only one entity/concept.
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
The Relational Database Model:
Normalization of Database Tables
SLIDE 1IS 257 – Fall 2004 Database Design: Normalization and The Relational Model University of California, Berkeley School of Information.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 5 Normalization of Database Tables
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Project and Data Management Software
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.
NORMALIZATION N. HARIKA (CSC).
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
LOGICAL DATABASE DESIGN
Introduction to Databases
File and Database Design SYS364. Today’s Agenda WHTSA DBMS, RDBMS, SQL A place for everything and everything in its place. Entity Relationship Diagrams.
Week 6 Lecture Normalization
Chapters 17 & 18 Physical Database Design Methodology.
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
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
Normalization Transparencies
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
The Relational Database Model
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
Designing Databases Systems Analysis and Design, 7e Kendall & Kendall 13 © 2008 Pearson Prentice Hall.
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.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Lecture No 14 Functional Dependencies & Normalization ( III ) Mar 04 th 2011 Database Systems.
Lecture 5 Normalization. Objectives The purpose of normalization. How normalization can be used when designing a relational database. The potential problems.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
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.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
A337 - Reed Smith1 Structure What is a database? –Table of information Rows are referred to as records Columns are referred to as fields Record identifier.
Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
IS 320 Notes for April 15, Learning Objectives Understand database concepts. Use normalization to efficiently store data in a database. Use.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Logical Database Design and Relational Data Model Muhammad Nasir
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
Normalization Karolina muszyńska
Functional Dependencies
Chapter 6 Normalization of Database Tables
Normalization A337.
Chapter 14 Normalization – Part I Pearson Education © 2009.
Relational Database Model
Normalization Dale-Marie Wilson, Ph.D..
DCT 2053 DATABASE CONCEPT Chapter 2.2 CONTINUE
Chapter 17 Designing Databases
Systems Analysis and Design, 7e Kendall & Kendall
Presentation transcript:

IT The Relational DBMS Section 05

Relational Database Theory Normalization for Logical Database Design

Relational Database Theory Normalization –Process of analyzing a grouping of data items Based on inherent characteristics Often applied to existing files or databases

Relational Database Theory Normalization –Principles Data items belong together in a logical group Group of items can be identified by own unique identifier

Relational Database Theory Normalization –Data in the group describes one, and only one, thing –A Bottom-Up approach

Relational Database Theory Why Normalize –Avoid update anomalies Nasty side effects –Minimize storage of redundant data –Support simpler logic for manipulating data

Relational Database Theory Why Not Normalize –Data is never (very rarely) updated –Data warehouse system is seldom normalized

Relational Database Theory Sample Data Not Normalized WARD NAME WARD TYPENO. OF BEDS SENIOR NURSE PATINET NO PATIENT NAME DATE OF BIRTH ListonOrthopedic6J Bryan45812D Carter21/02/ R Willis08/10/ G Barnes17/06/41 GodleeGeneral10V Fox52217M Brown21/02/ R Willis12/03/54

Relational Database Theory How to Normalize Data using Functional Dependencies –Definition of Functional Dependency Given a relation R, attribute Y of R is functionally dependent on attribute X of R, if and only if each X value in R has associated with it precisely one Y-value in R (at any one time)

Relational Database Theory Y of R is Dependent on X of R X (-->)functionally determines Y WARD NAME WARD TYPENO. OF BEDS SENIOR NURSE PATINET NO PATIENT NAME DATE OF BIRTH ListonOrthopedic6J Bryan45812D Carter21/02/65 ListonOrthopedic6J Bryan71384R Willis08/10/46 ListonOrthopedic6J Bryan69355G Barnes17/06/41 GodleeGeneral10V Fox52217M Brown21/02/35 GodleeGeneral10V Fox10823R Willis12/03/54 XY

Relational Database Theory Functional Dependency Diagram of Hospital Ward Example Patient Name Date of Birth Patient No Ward Name Ward Type No of BedsSenior Nurse

Relational Database Theory Table structure based on FD Diagram WARD NAME WARD TYPE NO OF BEDS SENIOR NURSE ListonOrthopedic6J Bryan GodleeGeneral10V Fox WARD PATIENT NO PATIENT NAME DATE OF BIRTH WARD NAME 45812D Carter21/2/65Liston 71384R Willis8/10/46Liston 52217M Brown21/2/85Godlee PATIENT

Relational Database Theory Normalization using Codd’s Rules –Origin Early enthusiasts wanted to use relational theory Sought rules for structuring data in relational model

Relational Database Theory Normalization using Codd’s Rules –Codd and contemporaries developed rules for “Normal Forms” 1NF 2NF 3NF –Normal levels to do in database design Boyce/Codd NF – 3.5NF 4NF 5NF

Relational Database Theory Customer-Order-Line Item Example –Assume an existing order-entry program and data file: ORD-NOCUST-NOCUST- NAME ADDRPROD-NOPROD- NAME UNIT-PRCQTY TOT-ITEM-PRC…PROD-NOPROD- NAME UNIT-PRCQTYTOT-ITEM- PRC

Relational Database Theory 1NF – Break out repeating groups ORD-NOCUST-NOCUST- NAME ADDRPROD-NOPROD- NAME UNIT-PRCQTY TOT-ITEM-PRC…PROD-NOPROD- NAME UNIT-PRCQTYTOT-ITEM- PRC ORD-NOCUST-NOCUST- NAME ADDR ORD-NOPROD-NOPROD-NAMEUNIT-PRCQTYTOT-ITEM-PRC ORD-NOPROD-NOPROD-NAMEUNIT-PRCQTYTOT-ITEM-PRC ORDER LINEITEM

Relational Database Theory 2NF- Break out attributes dependent on part of the primary key ORD-NOCUST-NOCUST- NAME ADDR ORD-NOPROD-NOPROD-NAMEUNIT-PRCQTYTOT-ITEM-PRC ORD-NOPROD-NOQTYTOT-ITEM-PRC ORDER LINEITEM PROD-NOPROD-NAMEUNIT-PRC PRODUCT

Relational Database Theory 3NF- Break out attributes wholly dependent on another key ORD-NOCUST-NOCUST- NAME ADDR ORD-NOPROD-NOQTYTOT-ITEM-PRC ORDER LINEITEM PROD-NOPROD-NAMEUNIT-PRC PRODUCT ORD-NOCUST-NO ORDER CUST-NOCUST- NAME ADDR CUSTOMER

Relational Database Theory Rules for 1NF, 2NF, & 3NF –1NF Break out repeating groups into a separate entity –2NF Break out attributes that are dependent on part of the primary key into a separate entity Called Partial Dependency –3NF Break out attributes that are wholly dependent on another key (not PK) into a separate entity Called Transitive Dependency

Relational Database Theory Normalization –A relation R is in 3 rd Normal Form (3NF) if and only if the non-key attributes of R (if any) are: Mutually independent, and Fully dependent on the primary key of R

Relational Database Theory Normalization Cont’d –A relation is in 3NF if all the attributes are functionally dependent On the Key On the Whole Key, and On Nothing but the Key –(So Help Me Codd)

Relational Database Theory Reconcile differences between the Data Model and Normalized Data Structures –Data model and normalized data structures must be reconciled –Discard data items from old files that are no longer needed Calculation fields Redundant fields –Resolve discrepancies in data item names –Ensure that new fields are really necessary Use standard naming conventions

Relational Database Theory Example 01: –What happens when a part has more than four suppliers? –What happens when a supplier is dropped? –How do you query the parts with two or more suppliers? –Normalized Table: PART-NOSUPP-1SUPP-2SUPP-3SUPP-4 WDGT01XYZZYFOOBARNULL PART-NOSUPP WDGT01XYZZY WDGT01FOOBAR

Relational Database Theory Example 02: Normalize this table PART-NOSUPPPART_DESCSUPP-ADDRESS WDGT01XYZZYBlue Widget123 Bluejay Way WDGT01FOOBARBlue Widget544 Old Orchard PART-NOPART_DESC WDGT01Blue Widget PART-NOSUPP WDGT01XYZZY WDGT01FOOBAR SUPPSUPP-ADDRESS XYZZY123 Bluejay Way FOOBAR544 Old Orchard

End Section

Relational Database Theory Multiply ways to Normalize Data –Normalization can be accomplished in different ways Well-formed E-R model is normalized Functional dependencies Codd’s Rules for 1NF, 2NF, & 3NF –Discrepancies indicate something is missing or changed –One approach validates or checks another approach

Relational Database Theory Impact of Normalization –Improve the integrity of data Purpose is to eliminate update anomalies –Minimize storage of redundant data –Reduce the complexity of programming logic Emphasis now is on maintainability, simplicity of program Normalized data can minimize complexity of code that manipulates the data –Enhance the stability, “goodness” of database design Normalized data tends to be easier to understand Normalized data can be used by many different applications more easily

Relational Database Theory Impact of Normalization on Performance –Concern that a large number of tables-and table joins-will result in poor performance Join can be a very expensive operation Test to determine frequency of joins, number of tables joined –After database is created and available

Relational Database Theory Impact of Normalization on Performance Cont’d –Requirements for application performance, response time dictate corrective actions –Performance addressed in section on physical database design There are alternatives to de-normalizing data to improve performance

Relational Database Theory Recommendations for Data that is Updated –First Normalize –Don’t be dismayed by too many tables Normalization increases number of tables but improves logic –Normalization is a helpful logical database design technique…for any DBMS

Relational Database Theory Objective of the design process is a “Good” design –The logical database design process Is well understood Uses complementary techniques Can be automated with CASE tools

Relational Database Theory Objective of the design process is a “Good” design cont’d –A “Good” database design Contains all the important entities and data items Has stable primary keys Identifies clearly all relationships Has table structures in 3NF Is understood by designers and users Accurately models the real world, as described in the requirements

Relational Database Theory Questions?