DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
+ Review: Normalization and data anomalies CSCI 2141 W2013 Slide set modified from courses.ischool.berkeley.edu/i257/f06/.../Lecture06_257.ppt.
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.
Functional Dependency CS157a Sec. 2 Koichiro Hongo.
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 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization of Database Tables
Normalization I.
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 of Database Tables
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Part ( PartNum, Description, OnHand, Class, Warehouse, Price,
Lecture 12 Inst: Haya Sammaneh
Introduction to Normalization CPSC 356 Database Ellen Walker Hiram College.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
Database Systems: Design, Implementation, and Management Tenth Edition
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
Concepts of Database Management, Fifth Edition
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
The Relational Model and Normalization R. Nakatsu.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
1 A Guide to MySQL 2 Database Design Fundamentals.
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Module III: The Normal Forms. Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form. The database.
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
DatabaseIM ISU1 Chapter 10 Functional Dependencies and Normalization for RDBs Fundamentals of Database Systems.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
Switch off your Mobiles Phones or Change Profile to Silent Mode.
CSC271 Database Systems Lecture # 28.
1 A Guide to MySQL 2 Database Design Fundamentals.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
By Abdul Rashid Ahmad. E.F. Codd proposed three normal forms: The first, second, and third normal forms 1NF, 2NF and 3NF are based on the functional dependencies.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
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,
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: Normalization.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II.
ITD1312 Database Principles Chapter 4C: Normalization.
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
1 First Normal Form (1NF) Unnormalized table : Contains a repeating group –Eg: from multi-valued attributes –Eg: from many-many relationship Table in 1NF:
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
A Guide to SQL, Eighth Edition
Advanced Normalization
Normalization Karolina muszyńska
A brief summary of database normalization
Advanced Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Concepts of Database Management Eighth Edition
Database Normalization
Chapter 6 Normalization of Database Tables
Normalization – Part II
Normalization Dale-Marie Wilson, Ph.D..
Normalization.
Chapter 14 Normalization Pearson Education © 2009.
Presentation transcript:

DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design

DBSQL 4-2 Copyright © Genetic Computer School, Singapore 2009 Chapter 4 Overview Database Design Redundancy Issues Data Anomaly Functional Dependency Theory Normalization Drawbacks of Normalization Denormalization

DBSQL 4-3 Copyright © Genetic Computer School, Singapore 2009 Database Design DBMS is a program or a collection of programs, through which users interact with a database is a software system that enables users to define, create and maintain the database and which provides controlled access to this database.

DBSQL 4-4 Copyright © Genetic Computer School, Singapore 2009 Cont’ Database Processing

DBSQL 4-5 Copyright © Genetic Computer School, Singapore 2009 Database Development Process

DBSQL 4-6 Copyright © Genetic Computer School, Singapore 2009 Redundancy Issues Redundancy is the common problem when implementing a database. It means that duplication of data exists and the same data are stored in more than one place. If those redundant data are to be removed then it is possible that data might be lost, further data complications and problems may lead to anomalies. There are three pre-defined anomalies existing: insertion, deletion and updating of data.

DBSQL 4-7 Copyright © Genetic Computer School, Singapore 2009 Data anomalies Insert Delete Update

DBSQL 4-8 Copyright © Genetic Computer School, Singapore 2009 Functional Dependencies The functional dependency occurs when one attribute in a relation uniquely identifies another attribute. It can be denoted as ‘A  B’ which means that ‘B is functionally dependent upon A’.

DBSQL 4-9 Copyright © Genetic Computer School, Singapore 2009 Cont’ A  B It means: B is functionally dependent on A A determines B A is called determinant B is called object of the determinant

DBSQL 4-10 Copyright © Genetic Computer School, Singapore 2009 FD Inference Rules Subset Property Augmentation Transitivity Secondary rules Union Decomposition Pseudo-transitivity

DBSQL 4-11 Copyright © Genetic Computer School, Singapore 2009 Types of Dependency Functional Partial Transitive It is a candidate key that uniquely identifies a relation This is the situation that exists if it is necessary to only use a subset of the attributes of the composite determinant to identify its object. A transitive dependency exists when there is an intermediate functional dependency. If A  B, B  C and if A  C then it can be stated that the transitive dependency exists.

DBSQL 4-12 Copyright © Genetic Computer School, Singapore 2009 Normalization  Is a formal technique for analyzing relations based on their primary key (or candidate keys in the case of BCNF) and functional dependencies.  Normalization is often executed as a series of steps. Each step corresponds to a specific normal form, which has known properties.

DBSQL 4-13 Copyright © Genetic Computer School, Singapore 2009 Cont’  The technique involves a series of rules that can be tested against individual relations so that a database can be normalized to any degree.

DBSQL 4-14 Copyright © Genetic Computer School, Singapore 2009 Stages of Normalization Process

DBSQL 4-15 Copyright © Genetic Computer School, Singapore 2009 First Normal Form (1NF) A table is said to be in First Normal Formal if it only contains one and only one atomic value. In this stage repeating groups will also be eliminated. Removing repeating groups is the starting point in the quest to create tables that are as free of problems as possible. Tables without repeating groups are said to be in its First Normal Form (1NF).

DBSQL 4-16 Copyright © Genetic Computer School, Singapore 2009 Example Orders (OrderNum, OrderDate, (PartNum, NumOrdered)) Orders OrderNumOrderDatePartNumNumOrdered /20/2008AT9411 DR931 DW /21/2008KL /21/2008KT032 BV062 CD /24/2008DR /25/2008KV292 10/20/ /23/

DBSQL 4-17 Copyright © Genetic Computer School, Singapore 2009 Second Normal Form (2NF) To convert a table into its Second Normal Form, it should first be in its First Normal Form (1NF). A table is said to be in its Second Normal Form if all of its non-key attributes only depends on one key attribute meaning no partial dependencies

DBSQL 4-18 Copyright © Genetic Computer School, Singapore 2009 Example Orders (OrderNum, OrderDate, PartNum, Description, NumOrdered, QuotedPrice)

DBSQL 4-19 Copyright © Genetic Computer School, Singapore 2009 Cont’ Orders (OrderNum, OrderDate) Part (PartNum, Description) OrderLine (OrderNum, PartNum, NumOrdered, QuotedPrice) Part (PartNum, Description) OrderLine (OrderNum, PartNum, NumOrdered, QuotedPrice)

DBSQL 4-20 Copyright © Genetic Computer School, Singapore 2009 Third Normal Form (3NF) The general concept of Third Normal Form (3NF) is to remove transitive dependencies.

DBSQL 4-21 Copyright © Genetic Computer School, Singapore 2009 Example Customer (CustID, CustName, CustAddress, Balance,CustCreditLimit, CustStatus, RepNo, FirstName, LastName) Representative (RepNo, FirstName, LastName) Customer (CustID, CustName, CustAddress, Balance,CustCreditLimit, CustStatus, RepNo)

DBSQL 4-22 Copyright © Genetic Computer School, Singapore 2009 Boyce Codd Normal Form (BCNF)  A relation is in BCNF, if for every non-trivial functional dependency X  A, X is a super key. In other words a relation is in BCNF, if and only if the determinant is a candidate key.  BCNF is a stronger form of normalization than 3NF, which eliminates the first rule of 3NF, which allows the right side of the functional dependency to be a prime attribute.

DBSQL 4-23 Copyright © Genetic Computer School, Singapore 2009 Fourth Normal Form (4NF) A table is in fourth normal form (4NF) when it is third normal form (3NF) and there are no multi-valued dependencies. Multi-valued dependencies A   B

DBSQL 4-24 Copyright © Genetic Computer School, Singapore 2009 Fifth Normal Form The goal of the Fifth Normal Form is to remove join dependency. In normalizing a relation seldom it would reach to this stage.

DBSQL 4-25 Copyright © Genetic Computer School, Singapore 2009 Drawbacks of Normalization It produces a lot of tables Might slow the performance when querying data at multiple tables Query becomes complex

DBSQL 4-26 Copyright © Genetic Computer School, Singapore 2009 Denormalization Denormalization is used primarily to improve performance in cases where a database and the relation itself are over normalized causing an overhead to the query processor.

DBSQL 4-27 Copyright © Genetic Computer School, Singapore 2009 End