INSS 6511 Lecture 4 Normalization An Normalization example.

Slides:



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

Normalisation.
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Normalization What is it?
NORMALIZATION FIRST NORMAL FORM (1NF): A relation R is in 1NF if all attributes have atomic value = one value for an attribute = no repeating groups =
1 Chapter 4 Logical Database Design and the Relational Model Jason C. H. Chen, Ph.D. Professor of MIS School of Business Administration Gonzaga University.
Chapter 5 Normalization of Database Tables
Normalization of Database Tables Special adaptation for INFS-3200
Normalization of Database Tables
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.
Normalization of Database Tables
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.
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).
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.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Chapter 5 Normalization of Database Tables
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Chapter 4: Logical Database Design and the Relational Model (Part II)
Week 6 Lecture Normalization
INSS 6511 Chapter 5 Normalization An Normalization example.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Avoiding Database Anomalies
Database Systems: Design, Implementation, and Management Tenth Edition
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
The Relational Model and Normalization R. Nakatsu.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 4 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 4 Normalization.
Normalization. We will take a look at –First Normal Form –Second Normal Form –Third Normal Form There are also –Boyce-Codd, Fourth and Fifth normal forms.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
Data Normalization Normal is not something to aspire to, it's something to get away from. ~ Jodie Foster ~
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Schema Refinement and Normal Forms 20131CS3754 Class Notes #7, John Shieh.
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
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.
BIS 360 – Lecture Eight Ch. 12: Database Design and Normalization.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Normalization of Database Tables
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.
Logical Database Design and the Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Normalization Hour1,2 Presented & Modified by Mahmoud Rafeek Alfarra.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
ITD1312 Database Principles Chapter 4C: Normalization.
Copyright © Curt Hill Schema Refinement II 2 nd NF to 3 rd NF to BCNF.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
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.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
INSS 6511 Chapter 5 Normalization An Normalization example.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.
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.
Functional Dependencies
Normalization A337.
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
NORMALIZATION FIRST NORMAL FORM (1NF):
Database Normalization.
Database Normalization
Presentation transcript:

INSS 6511 Lecture 4 Normalization An Normalization example

INSS 6512 Normalization A process for evaluating and correcting table structure Minimize data redundancy Eliminate Anomalies

INSS 6513 Is Normalization Necessary? NO But it is helpful to maintain data integrity and consistency

INSS 6514 Denormalization Reversing normalization i.e from 3 rd NF to 2 nd NF Or 2 nd to 1 st NF

INSS 6515 Anomalies Update—requires update in multiple locations Deletion—A deletion may lose important information Insertion—Requires complete definitions, ie does see page 187 (an employee can not be entered unless he is assigned a project

INSS 6516 Normalization Process 1 st NF 2 nd NF 3 rd NF Almost for 90-98% application 3 rd NF is sufficient

INSS 6517 Dependency When an attribute value depends on attribute B then B is dependent on A A---  B or values of B can be determined by value of A, reverse may or may not be true Ex: ssn--  Name SSN, CID--  Grade

INSS 6518 Un-normalized relation Remove REPEATING groups 1st NF Remove PARTIAL dependency 2nd NF Remove TRANSIENT dependency 3rd NF Every determinant is a candidate key Boyce-CODD NF If we can convert a relation into 3NF almost 90-98% of anomalies are removed

INSS 6519 Un-normalized form A relation is in un-normalized form, if it contains repeating group Typically shown in parentheses Ex: PART NO DESC. VENDOR-NAME ADDRESS UNIT-COST 1234 LOGIC INTEL SAN JOSE chip LSI LOGIC SAN JOSE MEMORY INTEL SAN JOSE chip SUPPLIER (Part_no, Part_DESC, (Vendor_name, Vendor_address, Unit_cost))

INSS Another Way (Part_NO, V_NAME)-> Unit_cost Part_NO->P_Desc (Partial dependency) V-Name->V_DESC (Partial Dependency) Part_NO P-DESCV_NAMEV_ADDRESSUNIT_COST

INSS st NF A relation is in 1 st NF if it does NOT contain any repeating groups (Part_no, Part_DESC, (Vendor_name, Vendor_address, Unit_cost)) 1 st NF..remove repeating groups Break it into TWO relations One without repeating group and ONE with repeating group AND PK of other relation S1 (Part_no, Part_DESC) S2 (Vendor_name, Part_no, Vendor_address, Unit_cost

INSS nd NF A relation is in 2nf NF if it is in 1stNF and it does not contain any partial dependency Partial dependency: A partial dependency exists if an attribute is dependent ONLY on PART of the PK and the WHOLE PK We must examine each relation for partial dependency NOTE: A partial dependency can only exist if there are more than ONE attribute as PK

INSS S1 (Part_no, Part_DESC) S2 (Vendor_name, Part_no, Vendor_address, Unit_cost Note S1 is already in 2 nd NF since there is only attribute as PK In S2: Question is Vendor_address dependent on BOTH vendor_name AND Part_NO? Question is Unit_price dependent on BOTH vendor_name AND Part_NO?

INSS Question is Vendor_address dependent on BOTH vendor_name AND Part_NO? Answer: NO Give me vendor_no and I can find vendor_address, we do NOT need Part_No to know vendor_address, ie Vendor_address depends ONLY Vendor_name, hence the partial dependency

INSS Question is Unit_price dependent on BOTH vendor_name AND Part_NO? YES if you examine the table, price changes with vendor and part_no, ie price depnds on both Part_no AND which vendor supplies it

INSS Remove Partial Dependency VENDOR _ADDRESS VENDOR_name UNIT_PRICE PART# Create TWO tables: One with Partial dependency and other without it S21 (Vendor_name, vendor_address) S22(Vendor_name, Part_no, Unit_price)

INSS rd NF A relation is in 3 rd NF if it is in 2 nd NF and it does not contain any transitive dependency Transitive dependency: A transitive dependency exists when some of the non- key attributes are dependent on other non- key attributes

INSS So far we have three relations that are in at least 2 nd NF S1 (Part_no, Part_DESC) S21 (Vendor_name, vendor_address) S22(Vendor_name, Part_no, Unit_price) S1, S21 & S22 are also in 3 rd NF since there is ONLY ONE non_key attribute and transitive dependency can NOT exist

INSS ERD PARTPART-SUPPLIED VENDOR

INSS Q6/p 175 A Using notation from the book a.(C1, C3)-  C2,C4,C5 (i.e., C2, C4, C5) are functionally dependent on C1 and C3 Above relation is in at least 1stNF, since there are No repeating groups C1  C2 there is PARTIAL dependency since C2 depends on PART of the PK and the whole PK C4--  C5 (transitive dependency since C5 ( a non-PK attribute) depends on another non-PK attribute (C4)

INSS Part b

INSS Part c

INSS Q8/P177 Table P5.8 Sample ITEM Records Attribute Name Sample Value ITEM_ID ITEM_LABELHP DeskJet 895CseHP TonerDT Scanner ROOM_NUMBER BLDG_CODENTC CSF BLDG_NAMENottooclearNottoclearCanseefar BLDG_MANAGERI. B. Rightonit May B. Next

INSS ITEM_DESCRIPTION BLDG_CODE BLDG_NAME BLDG_MANAGER ITEM_ID BLDG_ROOM Problem 8 Solution

INSS ITEM_DESCRIPTION BLDG_CODE BLDG_NAME EMP_FNAME EMP_INITIAL BLDG_NAME BLDG_MANAGER BLDG_CODE EMP_CODE EMP_LNAME Problem 9 Solution: All tables in 3NF ITEM_ID BLDG_ROOM ITEM_DESCRIPTIONITEM_ID BLDG_ROOMBLDG_CODE EMP_CODE

INSS 65126

INSS 65127