Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.

Slides:



Advertisements
Similar presentations
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Advertisements

NORMALIZATION. Normalization Normalization: The process of decomposing unsatisfactory "bad" relations by breaking up their attributes into smaller relations.
Normalisation The theory of Relational Database Design.
Functional Dependencies and Normalization for Relational Databases.
The Relational Model System Development Life Cycle Normalisation
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
CS263:Revision on Normalisation
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Normalization I.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Normalization of Database Tables
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
NORMALIZATION N. HARIKA (CSC).
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
Chapter 5 Normalization of Database Tables
Week 6 Lecture Normalization
Lecture 12 Inst: Haya Sammaneh
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Normalization Transparencies
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Functional Dependencies and Normalization for Relational Databases.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
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 10 Normalization Pearson Education © 2009.
©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.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part c): Logical Database Design and the Relational Model Modern Database Management.
Chapter 7 Functional Dependencies Copyright © 2004 Pearson Education, Inc.
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.
IST Database Normalization Todd Bacastow IST 210.
Ch 7: Normalization-Part 1
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Chapter 5 MODULE 6: Normalization © 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Prepared by: KIM GASTHIN M. CALIMQUIM.
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 1 Normalization DB Design Guidelines Presented by: Dr. Samir Tartir.
Lecture 4: Logical Database Design and the Relational Model 1.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
ITD1312 Database Principles Chapter 4C: Normalization.
Logical Database Design and Relational Data Model Muhammad Nasir
Chapter 4 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 4: Logical Database Design and the Relational Model Modern Database Management.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
Normalization.
Chapter 5: Logical Database Design and the Relational Model
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Database Normalization
Chapter 14 Normalization – Part I Pearson Education © 2009.
Normalization Dale-Marie Wilson, Ph.D..
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Presentation transcript:

Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang

Logical Data Model 1.Build a Conceptual Data Model 2.Build and validate logical data model (LDM) Drive relations for LDM Validate relations using normalisation Validate relations against user transactions Check integrity constraints Review LDM with user Merge LDMs into global model

Top-down Modeling Entity - Entity - Entity DATABASE Table - Table – Table - Table - Table Attributes + Constraints Attributes + Constraints Attributes + Constraints Attributes + Constraints Attributes + Constraints

Bottom-up Modeling Entity - Entity - Entity DATABASE Table - Table – Table - Table - Table Attributes + Constraints Attributes + Constraints Attributes + Constraints Attributes + Constraints Attributes + Constraints

Normalizations  A process that assigns attributes to entities in such a way that data redundancies are reduced or eliminated  Enables us to analyse the design of the database  Identify the existence of potential data anomalies result from those redundancies  A step to step process : given a data model and the relevant FDs  Decomposition of relation schema based on knowledge of underlying functional dependencies Results in a relational schema that satisfies certain important criteria: 1NF, 2NF, 3NF, BCNF, 4NF, … E.G., No anomalies, no spurious or invalid data during joins

Update Anomalies  Redundancies Information fact is stored in more than one place  Insertion anomalies Unable to insert a fact into table without having other facts (or inserting nulls)  Deletion anomalies If a set of values becomes empty, we may lose other information as a side effect  Modification anomalies Change the information in one tuple but leave information unchanged in another

Example Real bad design:  Study(Sid,name,Dept,Course_code, Course_name) SidNameDeptC_codeC_Name S01RoseDCO20401DB S01RoseDCO30198Project S02PeterDCO20401DB S03MaryDCO30198Project S04TomDCO20401DB

What are the Anomalies?  Redundancy  Insertion Anomaly  Deletion Anomaly  What is the best design for this information? No anomalies Can reconstruct all original information

Process of Normalization UsersUser’s requirement Forms/ Report Other sources From company Data sources UNF Transfer attributes into table format 1NF Remove repeating group 2NF Remove partial dependencies 3NF Remove transitive dependencies

Normalizations  Unnormalised Form (UNF) can be captured from data entities generated in System Analysis phase sample reports or screens Invoice Stf_name: Rose C W ChangStf_ID. : Dept: SalesDpt_Code: SAL Item CodeItem DescriptionPrice I011Wing-Type-A70 I012Wing-Type-B60 I013Engine-Type-A70 Total 200

First Normal Form  A relation is in first normal form (1NF) if and only if All the key attributes are defined There are no repeating groups in the table All non-primary-key attribute is functionally dependent on the primary key  Problem : attributes not necessary fully functionally dependent

Functional Dependencies  Attribute B is functionally dependent on attribute A if and only if each value of A is associated with precisely one value of B at any one time  E.G. Stf_name is functionally dependent on Stf_ID, Stf_ID  Stf_name  The attribute on the left is a determinant

First Normal Form (1NF)  Eliminate repeating groups of data items UNF1NFStf_IDStf_nameDept_codeDept_name {Item_code Item_descStf_ID Price }Item_code Item_desc Price

Second Normal Form  A relation is in second normal form (2NF) if and only if It is in 1NF All non-primary-key attribute is fully functionally dependent on the primary key, that is, there is no partial dependecy.

Full Functional Dependency  Attribute B is fully functionally dependent (FD) on attribute A if it is functionally dependent on A and NOT functionally dependent on any subset of A  All determinants in each relation are candidate keys

1NF2NFStf_IDStf_nameDept_codeDept_name Stf_IDStf_IDItem_code Item_codeItem_codeItem_desc Item_descPrice Price Second Normal Form (2NF)  Record is in 1NF and no partly dependencies

Third Normal Form  A relation is in third normal form (3NF) if and only if It is in 2NF It contains NO transitive dependencies  transitive dependencies A condition where A, B, and C are attributes of a relation such that if A  B and B  C, then C is transitively dependent on A via B (provided that A is not FD on B or C)

Third Normal Form (3NF)  Record is in 2NF and no transitive dependencies (no fields dependent on nonkey field(s)) 2NF3NF Stf_IDStf_IDDept_code Stf_nameStf_nameDept_nameDept_code Dept_name Stf_IDItem_code Stf_IDItem_codeItem_codeItem_desc Item_codeItem_descPrice Price

E/R Model after Normalization StaffSold Items Item Dept

Normalize it to 3NF

Q & A Readings: Connolly: Ch13, except BCNF, 4NF & 5NF