First Normal Form. Second Normal Form. Third Normal Form. Fourth Normal Form. Fifth Normal Form. Assoc.Prof.Dr.B.

Similar documents
Steps in normalisation. Steps in normalisation 7/15/2014

Chapter 14. Chapter 14 - Objectives. Purpose of Normalization. Purpose of Normalization

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Normalisation. Normalisation. Normalisation

Normalization. Un Normalized Form (UNF) Share. Download the pdf version of these notes.

Chapter 3. The Relational database design

itxperts shivpuri Page No. 1 Normalization

Objectives Definition iti of terms List five properties of relations State two properties of candidate keys Define first, second, and third normal for

Database Design. 6-2 Normalization and First Normal Form. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

IS 263 Database Concepts

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Learning outcomes. On successful completion of this unit you will: 1. Understand data models and database technologies.

CMP-3440 Database Systems

Geodatabase Database Design. Tomislav Sapic GIS Technologist Faculty of Natural Resources Management Lakehead University

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček

Lecture 3. Wednesday, September 3, 2014

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A

A Flat file database. Problems with a flat file database (data redundancy)

Objective To recognize systematic steps required in building database To identify Conceptual, Logical & Physical designs relevance.

Use this task to submit a marriage life event in the UCPath website.

8) A top-to-bottom relationship among the items in a database is established by a

FROM A RELATIONAL TO A MULTI-DIMENSIONAL DATA BASE

Data Warehousing. Overview

Relational Database Components

Chapter 2: Entity-Relationship Model

Test Bank For A Guide To Mysql 1st Edition By Pratt And Last

Test Bank for A Guide to SQL 9th Edition by Pratt

Link download full of Solution Manual:

Normalization (1) IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

COSC Dr. Ramon Lawrence. Emp Relation

Relational Databases and Web Integration. Week 7

KEYS WEAK ENTITY SETS EXAMPLE: WEAK ENTITY SET EXAMPLE: WEAK ENTITY SET. Beers. Ales. Players. Teams ISA. and. Plays-on

Accounting Information Systems, 2e (Kay/Ovlia) Chapter 2 Accounting Databases. Objective 1

Subject Access Request (SAR) application form and guidance

GRADUATE STUDENT EMPLOYEE SELF SERVICE GUIDE

SWEN-220 Mathematical Models of Software

Michael Kifer, Arthur Bernstein, Philip M. Lewis. Solutions Manual

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

Language Graduate Teacher (RMSA)- Kom

How to design a database

1. The process of determining the particular tables and columns that will comprise a database is known as database design.

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early!

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships

BTEC Nationals IT - Unit2 FAQs

Data about data is database Select correct option: True False Partially True None of the Above

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

ch02 True/False Indicate whether the statement is true or false.

Redundancy:Dependencies between attributes within a relation cause redundancy.

How to Create an Express Entry Profile. Here are the steps to create the Express Entry - Expression of Interest (EOI) Profile on IRCC s website:

Unit- III (Functional dependencies and Normalization, Relational Data Model and Relational Algebra)

Database Normalization

Conceptual and Logical Design

Chapter 4 Entity Relationship Modeling In this chapter, you will learn:

The Design and Optimization of Database

Normalization in DBMS

Tutorial OPENRULES. Preparing a Tax Return Using OpenRules Dialog (Dialog1040EZ) Open Source Business Decision Management System. Release 6.

(Refer Slide Time 00:17) Welcome to the course on Digital Image Processing. (Refer Slide Time 00:22)

Chapter 6. Foundations of Business Intelligence: Databases and Information Management VIDEO CASES

E/R Diagrams! Converting E/R Diagrams to Relations!

Normalization and Roberts s Rules. Prepared for CSCI 6442 George Washington University. David C. Roberts

CS 1110, LAB 1: PYTHON EXPRESSIONS.

UNIT 3 DATABASE DESIGN

THE RELATIONAL DATABASE MODEL

Database Technologies. Madalina CROITORU IUT Montpellier

Unit 4 Relational Algebra (Using SQL DML Syntax): Data Manipulation Language For Relations Zvi M. Kedem 1

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

GUIDE TO REGISTRATION

Private Candidates Guide

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

Controller s Office Supplier Training September 12, 2017

Database Management System 15

An Employer s Guide to the

Normalisation Chapter2 Contents

Course on Database Design Carlo Batini University of Milano Bicocca

Relational Database design. Slides By: Shree Jaswal

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

Unit 4 Relational Algebra (Using SQL DML Syntax): Data Manipulation Language For Relations Zvi M. Kedem 1

Logical Database Design Normalization

Entity Relationships and Databases

(Refer Slide Time 3:31)

CS Reading Packet: "Database Processing and Development"

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

Module - P7 Lecture - 15 Practical: Interacting with a DBMS

Normalization Normalization: Fourth Normal Form Pg 1

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

Database Normalization Complete

Enhanced Entity- Relationship Models (EER)

CALL LETTER FOR WRITTEN EXAM (COMPUTER BASED TEST) SIC/PERS.I/11(80)/17 Date:

EmployerAccess. A step-by-step guide for managing your group benefits online. bcbsga.com GAEENBGA 12/17

Chapter 2. DB2 concepts

HIPAA and Research Contracts JILL RAINES, ASSISTANT GENERAL COUNSEL AND UNIVERSITY PRIVACY OFFICIAL

2006 NASCIO Recognition Awards

Use this task to submit an adoption life event in the UCPath website.

CST221, Dr. Zhen Jiang Normalization & design (see Appendix pages 42-55)

Transcription:

First Normal Form Second Normal Form Third Normal Form Fourth Normal Form Fifth Normal Form

Normalizing Data Model

Topic Objectives This topic discusses Normalization. At the end of the topic, you will be able to: define Normalization identify an entity which is in its First Normal Form identify an entity which is in its Second Normal Form identify an entity which is in its Third Normal Form identify an entity which is in its Fourth Normal Form identify an entity which is in its Fifth Normal Form

In this topic, you will see how to systematically assign each attribute to the proper entity.

Normalization In Data Modeling, the term Normalization describes the step-bystep process of assigning attributes to entities. A technique for producing a set of relations with desirable properties,given the data requirements of an enterprise.

Purpose of Normalization Characteristics of a suitable set of relations include: the minimal number of attributes necessary to support the data requirements of the enterprise; attributes with a close logical relationship are found in the same relation; minimal redundancy with each attribute represented only once with the important exception of attributes that form all or part of foreign keys. 6

Purpose of Normalization The benefits of using a database that has a suitable set of relations is that the database will be: easier for the user to access and maintain the data; take up minimal storage space on the computer. 7

Data Redundancy and Update Anomalies Major aim of relational database design is to group attributes into relations to minimize data redundancy. 8

Data Redundancy and Update Anomalies Potential benefits for implemented database include: Updates to the data stored in the database are achieved with a minimal number of operations thus reducing the opportunities for data inconsistencies. Reduction in the file storage space required by the base relations thus minimizing costs. 9

Various authors have identified a number of rules, or principles, of Normalization. Some people claim there are five rules, others identify three or four rules. Everyone aggrees on the first three, and for most business applications, applying the first three principles of Normalization produces a good data model.

The First Three Rules of Normalization As you tentatively assign an attribute to an entity, you can ask three questions to verify that it (attribute) really belongs there:. 1) will it occur just once? 2) is it dependent on the entire Unique Identifier? 3) is it not dependent on another attribute? If the answer to all three questions is Yes then the attribute is in the right place.

Unnormalized Form (UNF) A table that contains one or more repeating groups. To create an unnormalized table Transform the data from the information source (e.g. form) into table format with columns and rows. 12 Pearson Education 2009

First Normal Form (1NF) A relation in which the intersection of each row and column contains one and only one value. 13 Pearson Education 2009

UNF to 1NF Nominate an attribute or group of attributes to act as the key for the unnormalized table. Identify the repeating group(s) in the unnormalized table which repeats for the key attribute(s). 14 Pearson Education 2009

UNF to 1NF Remove the repeating group by Entering appropriate data into the empty columns of rows containing the repeating data ( flattening the table). Or by Placing the repeating data along with a copy of the original key attribute(s) into a separate relation. 15 Pearson Education 2009

First Normal Form Rule 1: will it occur just once? Here are some examples of attributes that probably meet this first rule: CUSTOMER number first name last name FILM title studio PROJECT start date PART name If we were to ask a business person, Can a customer have more than one customer number? or Can a part have more than one name? they would probably say No.

Someone might argue that a film could be released under different titles, or could be re-released by a studio other than the one which released it the first time. If this is true, then we must ask our business contact whether they would consider that to be the same film, or two different films.

Here are some examples of attributes which are misplaced, since they obviously violate the rule against repeating data items: CUSTOMER payment amount FILM star actor name PROJECT phone number internal report PART colour The amount of a payment is not a fact that occurs once, for all time, per customer. It is misplaced; there must be another entity representing payments, where each row has a payment amount. The same is true for the attributes. They belong to some other entity.

If the proper entity already exists, then all you have to do is move the misplaced attribute. If there is no proper entity, you have discovered a new one. You should go back to the beginning with that new entity, properly name it, and determine its relationships and Unique Identifier. PAYMENT amount

If you have an entity, DEPARTMENT, which of the following attributes clearly violates the rule against repeating data items? A. name DEPARTMENT name manager number parent department date of hire B. manager number C. parent department D. date of hire The date of hire would occur many times for a DEPARTMENT.

Second Normal Form Rule 2: is it dependent on the entire Unique Identifier? Here are some examples of attributes which depend on (are facts about) their entire UID, where # denotes the UID. MARRIAGE # * husband name # * wife name wedding date photographer COURSE SESSION # * course number # * session number starting date classroom

The wedding date and location, the person who officiated, the photographer, etc., are not facts about the husband alone, or the wife alone, but about the combination of them. Likewise, the time and location of a course session are not about the course alone, but about about a course and its specific session. MARRIAGE # * husband name # * wife name wedding date photographer COURSE SESSION # * course number # * session number starting date classroom

Here are some examples of attributes which are facts about only part of the entity s UID: MARRIAGE # * husband name # * wife name date of birth colour of hair COURSE SESSION # * course number # * session number title description

The date of birth should probably be two separate attributes, one for each spouse. Then it would be completely apparent that those attributes belonged to a different entity. The title and description of a course are very likely the same for every session. In this case, these attributes belong to the COURSE entity, not COURSE SESSION. MARRIAGE # * husband name # * wife name date of birth colour of hair COURSE SESSION # * course number # * session number title description

Third Normal Form Rule 3: is it not dependent on another attribute? A closely related question is, Does this attribute depend on something other than its entity s UID?

Here are examples of attributes which are facts about something other than the UID, and therefore fail the third rule of normalization: COURSE SESSION # * course number # * session number starting time classroom number of seats DENTAL TREATMENT # treatment number date of treatment dentist dentist address

The number of seats is a fact about the classroom, but not about the UID of the COURSE SESSION entity. If there is not another entity for CLASSROOM, then there should be, and number of seats should be one of its attributes. COURSE SESSION # * course number # * session number starting time classroom number of seats DENTAL TREATMENT # treatment number date of treatment dentist dentist address

In DENTAL TREATMENT, the dentist s address is not really a fact about the treatment number. COURSE SESSION # * course number # * session number starting time classroom number of seats DENTAL TREATMENT # treatment number date of treatment dentist dentist address

Fourth Normal Form Rule 4: will it not occur several times? This rule forbids the multi-valued relation between the UID and attribute.

Fourth Normal Form Rule 4: will it not occur several times? This rule forbids the multi-valued relation between the UID and attribute. If the attribute will occur several times then it should belong to another entity.

Fourth Normal Form EXAMPLE; Let us say that a BANK wants to keep record about sponsor under an entity called CUSTOMER. CUSTOMER # customer id * first name * surname * sponsor

Fourth Normal Form EXAMPLE; Let us say that a BANK wants to keep record about sponsor under an entity called CUSTOMER. CUSTOMER # customer id * first name * surname * sponsor What if a CUSTOMER has more than one SPONSOR.

Fourth Normal Form EXAMPLE; If a CUSTOMER has got more than one sponsor (even if only few times) it must belong to different entity. CUSTOMER # customer id * first name * surname * sponsor sponsored by the sponsor of SPONSOR # sponsor id * name

Fourth Normal Form Difference of violation between 1st Normal Form and 4 th Normal Form; Repetition of attribute in 1 st Normal Form is many times Repetition of attribute in 4 th Normal Form is only few times. PAYMENT * amount Violation of 1 st Normal Form CUSTOMER # customer id * first name * surname * sponsor Violation of 4 th Normal Form

Fourth Normal Form CUSTOMER 1234 Muhammad Said 1245 Hassan Mazza 2356 Omar Azizi SPONSOR 1 British Airways 2 AKBANK 3 KAA University 4 Ministry of Educa Multi-valued relation (even if the occurrence is few times) is not allowed. CUSTOMER_SPONSOR 1234 1 1234 2 1245 1 1245 3

Fourth Normal Form We rarely operate this rule. If applied in all cases, the number of tables in database increases tremendously.

Fourth Normal Form Which of the following attributes violates 4 th Normal Form? DEFENDANT # defendant number first name last name address A. address B. Surname C. first name D. None

Fifth Normal Form In 5 th Normal form; If you have more than 3 candidate UIDs, You should have a different entity for each UID and this should not cause redundancy in data.

Fifth Normal Form You can ask a question like following for 5 th Normal Form. Has this entity got at least 3 candidate UIDs and can we construct different entities for each candidate UID without data redundancy (repetition).

Fifth Normal Form In practice, this is very difficult. Think of a global information system developed for central government.

Fifth Normal Form Following example has got 3 candidate UIDs. Try to define 3 entities corresponding to UIDs EMPLOYEE? badge number? social security number? tax number first name surname date of birth

Fifth Normal Form Following example has got 3 candidate UIDs. Try to define 3 entities corresponding to UIDs???????? # badge number??? EMPLOYEE? badge number? social security number? tax number first name surname date of birth??????? # tax number?????????? # social security number??????

Summary of Normalization: Each fact (attribute) must be a fact about the entity, the whole entity, and nothing but the entity If each attribute of every entity passes this test, then the E-R Diagram is fully normalized.

Try to stay in first 3 normal forms

Do not exaggerate!