Database Tables and Normalization

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

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

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

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

Normalization. VI. Normalization of Database Tables. Need for Normalization. Normalization Process. Review of Functional Dependence Concepts

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

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2

IS 263 Database Concepts

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form

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

Chapter 14 Outline. Normalization for Relational Databases: Outline. Chapter 14: Basics of Functional Dependencies and

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

Redundancy:Dependencies between attributes within a relation cause redundancy.

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)

UNIT 3 DATABASE DESIGN

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

FIT1004 Database Topic 6: Normalisation

ACS-2914 Normalization March 2009 NORMALIZATION 2. Ron McFadyen 1. Normalization 3. De-normalization 3

Database Normalization. (Olav Dæhli 2018)

The strategy for achieving a good design is to decompose a badly designed relation appropriately.

Edited by: Nada Alhirabi. Normalization

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Informal Design Guidelines for Relational Databases

Normalisation Chapter2 Contents

Functional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems

Normalisation. Normalisation. Normalisation

Relational Database design. Slides By: Shree Jaswal

CMP-3440 Database Systems

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002

Database Management Systems

Normalization and Functional Dependencies. CS6302 Database management systems T.R.Lekhaa, AP/IT

Lecture 11 - Chapter 8 Relational Database Design Part 1

E-R Modeling: Table Normalization

Databases 1. Daniel POP

Normalization in DBMS

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

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 8 Data Modeling Advanced Concepts

پوهنتون کابل پوهنحی كمپيوترساینس پوهنیار محمد شعیب "زرین خیل"

Chapter 1 File System and Database

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

RELATIONAL DATABASE DESIGN. Basic Concepts

MODULE: 3 FUNCTIONAL DEPENDENCIES

Lecture5 Functional Dependencies and Normalization for Relational Databases

Relational Database Design (II)

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

Normalization. CMSC 461 Michael Wilson

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design

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

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<

A Guide to SQL, Ninth Edition. Chapter Two Database Design Fundamentals

Normalisation. Connolly, Ch. 13

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

Functional Dependency

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

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Database Systems. Normalization Lecture# 7

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

THE RELATIONAL DATABASE MODEL

DATABASE (2) NORMALIZATION

itxperts shivpuri Page No. 1 Normalization

Normalization. Normal Forms. Normal Forms

From Murach Chap. 9, second half. Schema Refinement and Normal Forms

The Relational Model and Normalization

Dr. Anis Koubaa. Advanced Databases SE487. Prince Sultan University

Unit 3 : Relational Database Design

How to design a database

Chapter 6: Relational Database Design

Relational Design: Characteristics of Well-designed DB

Unit IV. S_id S_Name S_Address Subject_opted

CSIT5300: Advanced Database Systems

CS211 Lecture: Database Design

Chapter 8: Relational Database Design

SQL functions fit into two broad categories: Data definition language Data manipulation language

Exam (Version B) for CSE 480 (2018) KEY

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

Dr. Lyn Mathis Page 1

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

7) To be considered a composite key, a key must contain at least two attributes. Answer: TRUE

CSIT5300: Advanced Database Systems

DATABASE DESIGN I - 1DL300

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

Link download full of Solution Manual:

Concepts from

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

Data Modeling Online Training

Logical Database Design Normalization

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

customer = (customer_id, _ customer_name, customer_street,

Functional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT

Review -Chapter 4. Review -Chapter 5

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization

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

Detailed Data Modelling: Attribute Collection and Normalisation of Data

Transcription:

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 9 Normalizing Database Designs (NORMALIZATION) MDM NUR RAZIA BINTI MOHD SURADI 019-3932846 razia@unisel.edu.my 1 Database Tables and Normalization Normalization Process for evaluating and correcting table structures to minimize data redundancies Reduces data anomalies(inconsistences) Works through a series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) 2 1

Database Tables and Normalization (cont d.) Normalization (continued) 2NF is better than 1NF; 3NF is better than 2NF For most business database design purposes, 3NF is as high as needed in normalization Highest level of normalization is not always most desirable Denormalization produces a lower normal form 3 The Need for Normalization Example: company that manages building projects Charges its clients by billing hours spent on each contract Hourly billing rate is dependent on employee s position Periodically, report is generated that contains information such as displayed in Table 6.1 4 2

5 Database Systems, 10th Edition 6 3

The Need for Normalization (cont d.) Structure of data set in Figure 6.1 does not handle data very well Table structure appears to work; report is generated with ease Report may yield different results depending on what data anomaly has occurred Relational database environment is suited to help designer avoid data integrity problems 7 The Normalization Process Each table represents a single subject No data item will be unnecessarily stored in more than one table All nonprime attributes in a table are dependent on the primary key Each table is void of insertion, update, and deletion anomalies 8 4

9 The Normalization Process (cont d.) Objective of normalization is to ensure that all tables are in at least 3NF Higher forms are not likely to be encountered in business environment Normalization works one relation at a time Progressively breaks table into new set of relations based on identified dependencies 10 5

11 The Normalization Process (cont d.) Partial dependency Exists when there is a functional dependence in which the determinant is only part of the primary key Transitive dependency Exists when there are functional dependencies such that X Y, Y Z, and X is the primary key 12 6

Conversion to First Normal Form Repeating group Group of multiple entries of same type can exist for any single key attribute occurrence Relational table must not contain repeating groups Normalizing table structure will reduce data redundancies Normalization is three-step procedure 13 Conversion to First Normal Form (cont d.) Step 1: Eliminate the Repeating Groups Eliminate nulls: each repeating group attribute contains an appropriate data value Step 2: Identify the Primary Key Must uniquely identify attribute value New key must be composed Step 3: Identify All Dependencies Dependencies are depicted with a diagram 14 7

15 Conversion to First Normal Form (cont d.) Dependency diagram: Depicts all dependencies found within given table structure Helpful in getting bird s-eye view of all relationships among table s attributes Makes it less likely that you will overlook an important dependency 16 8

17 Conversion to First Normal Form (cont d.) First normal form describes tabular format: All key attributes are defined No repeating groups in the table All attributes are dependent on primary key All relational tables satisfy 1NF requirements Some tables contain partial dependencies Dependencies are based on part of the primary key Should be used with caution 18 9

Conversion to Second Normal Form Step 1: Make New Tables to Eliminate Partial Dependencies Write each key component on separate line, then write original (composite) key on last line Each component will become key in new table Step 2: Reassign Corresponding Dependent Attributes Determine attributes that are dependent on other attributes At this point, most anomalies have been eliminated 19 20 10

Conversion to Second Normal Form (cont d.) Table is in second normal form (2NF) when: It is in 1NF and It includes no partial dependencies: No attribute is dependent on only portion of primary key 21 Conversion to Third Normal Form Step 1: Make New Tables to Eliminate Transitive Dependencies For every transitive dependency, write its determinant as PK for new table Determinant: any attribute whose value determines other values within a row Step 2: Reassign Corresponding Dependent Attributes Identify attributes dependent on each determinant identified in Step 1 Identify dependency Name table to reflect its contents and function 22 11

Conversion to Third Normal Form (continued) Step 3: Remove the Dependent Attributes from Transitive Dependencies Eliminate all dependent attributes in transitive relationship(s) from each of the tables Draw new dependency diagram to show all tables defined in Steps 1 3 Check new tables as well as tables modified in Step 3 Each table has determinant No table contains inappropriate dependencies 23 24 12

Conversion to Third Normal Form (cont d.) A table is in third normal form (3NF) when both of the following are true: It is in 2NF It contains no transitive dependencies 25 Higher-Level Normal Forms Tables in 3NF perform suitably in business transactional databases Higher-order normal forms are useful on occasion Two special cases of 3NF: Boyce-Codd normal form (BCNF) Fourth normal form (4NF) 26 13

The Boyce-Codd Normal Form Every determinant in table is a candidate key Has same characteristics as primary key, but for some reason, not chosen to be primary key When table contains only one candidate key, the 3NF and the BCNF are equivalent BCNF can be violated only when table contains more than one candidate key 27 Fourth Normal Form (4NF) Table is in fourth normal form (4NF) when both of the following are true: It is in 3NF No multiple sets of multivalued dependencies 4NF is largely academic if tables conform to following two rules: All attributes dependent on primary key, independent of each other No row contains two or more multivalued facts about an entity 28 14

29 Example: Normalize the following to the 3rd Normal Forms (3NF). STUDENT(StudentID, StudentName, TotalCredit, GPA, AdvisorID, AdvisorName, (CourseID, CourseDescription, Grade)) 30 15