Normalization Data Design - Mr. Ahmad Al-Ghoul

Slides:



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

Using Puppies to Teach Data Design
System Analysis System Analysis - Mr. Ahmad Al-Ghoul System Analysis and Design.
Normalization Rules for Database Tables
ERD diagram Data Design - Mr. Ahmad Al-Ghoul
Normalisation Ensuring data integrity in database design 1.
Athabasca University Under Development for COMP 200 Gary Novokowsky
Modeling the Data: Conceptual and Logical Data Modeling
Chapter 7 Data Design.
Normalization of Database Tables
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
System Analysis and Design
System Analysis and Design
System Analysis System Analysis - Mr. Ahmad Al-Ghoul System Analysis and Design.
System Analysis and Design
NORMALIZATION N. HARIKA (CSC).
Introduction to Databases
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
The Relational Database Model CST272. Return Creating the Unnormalized Table n List the fields n Select a primary key – The field (or concatenation of.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
System Implementation System Implementation - Mr. Ahmad Al-Ghoul System Analysis and Design.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
System Analysis and Design
1 Class Agenda (04/09 through 04/16)  Review HW #8  Present normalization process Enhance conceptual knowledge of database design. Improve practical.
System Analysis System Analysis - Mr. Ahmad Al-Ghoul System Analysis and Design.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Avoiding Database Anomalies
Normalization. Rigorous technique used to break down data represented in a user view into a set of 2- dimensional tables where “all attributes in the.
Normalization - Mr. Ahmad Al-Ghoul Data Design. 2 learning Objectives  Explain the concept of table design  Explain unnormalized design and the first.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
Concepts of Database Management Sixth Edition Chapter 5 Database Design 1: Normalization.
1 A Guide to MySQL 2 Database Design Fundamentals.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
System Analysis System Analysis - Mr. Ahmad Al-Ghoul System Analysis and Design.
System Implementation
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
System Implementation System Implementation - Mr. Ahmad Al-Ghoul System Analysis and Design.
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
Software Engineering Software Engineering - Mr. Ahmad Al-Ghoul.
DAT702 Normal Forms Normalization Rules. Normal Forms Normal Forms, also called Normalization rules, are basically processes or steps taken to allow for.
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Systems Analysis and Design Harry J. Rosenblatt College of the Albemarle Opening slide.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
1 Class Agenda (04/06/2006 and 04/11/2006)  Discuss use of Visio for ERDs  Learn concepts and ERD notation for data generalization  Introduce concepts.
System Planning (Overview of Feasibility) System Planning (Overview of Feasibility) - Mr. Ahmad Al-Ghoul System Analysis and Design.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
Microsoft Access 2010 Chapter 11 Database Design.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
SEEM3430: Information Systems Analysis and Design
MIS 322 – Enterprise Business Process Analysis
Relational Model and ER Model: in a Nutshell
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
System Analysis and Design
A Normalization Example
Database Normalisation
System Analysis and Design
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Normalization Data Design - Mr. Ahmad Al-Ghoul In this sequence we will study a normalization example

learning Objectives Explain the concept of normalization

A Normalization Example The three steps of data normalization are Remove all repeating groups and identify the primary key Ensure that all nonkey attributes are fully dependent on the primary key Remove any transitive dependencies, attributes which are dependent on other nonkey attributes

A Normalization Example To show the normalization process, consider the familiar situation which might depict several entities in a school advising system: ADVISOR, COURSE, and STUDENT The relationships among the three entities are shown in the ERD below [1]

A Normalization Example In this example we will discuss the normalization rules for these three entities, to show how you can design a validate ERD Note that the relationship between student and course is many to many relationship (M:N) which can not create physically and as we said previously we must solve this problem by dividing this relationship to two one to many (1:M) relationship by adding a new entity called Associative entity the STUDENT table contains fields that relate to the ADVISOR and COURSE entities, so you can decide to begin with the initial design for the STUDENT table.

A Normalization Example Unnormalized student table STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, (COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE)) Repeating groups The STUDENT table is unnormalized because it contains a repeating group that represents the courses each student has taken. [1]

A Normalization Example 1NF To convert the STUDENT record to 1NF, you must expand the primary key to include the key of the repeating group STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE)

A Normalization Example Choose data items UNF to 1NF Identify keys Split groups Eliminate repeating groups UNF 1NF level 1 2 STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE

A Normalization Example The STUDENT table in 1NF. Notice that the primary key has been expanded to include STUDENT-NUMBER and COURSE-NUMBER. Also, the repeating group has been eliminated. [1]

A Normalization Example 2NF No attribute dependent on a portion of a primary key The student name, total credits, GPA, advisor number, and advisor name all relate only to the student number The course description depends on the course number Grade field depends on the entire primary key

A Normalization Example Does this attribute depend on the whole of the primary key? 1NF to 2NF 2NF 1NF STUDENT-NUMBER STUDENT-NAME TOTAL-CREDITS GPA ADVISOR-NUMBER ADVISOR-NAME COURSE-NUMBER COURSE-DESC NUM-CREDITS GRADE STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME, COURSE-NUMBER, COURSE-DESC, NUM-CREDITS, GRADE

A Normalization Example You would create a new table for each field and combination of fields in the primary key STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER, ADVISOR-NAME) COURSE (COURSE-NUMBER, COURSE-DESC, NUM-CREDITS) GRADE (STUDENT-NUMBER, COURSE-NUMBER, GRADE)

A Normalization Example STUDENT, COURSE, and GRADE tables in 2NF. Notice that all fields are functionally dependent on the entire primary key of their respective tables. [1]

A Normalization Example 3NF Remove any transitive dependencies No attribute dependent on a nonkey attribute The COURSE and GREADE are in 3NF STUDENT is not in 3NF, because the ADVISOR-NAME field depends on the ADVISOR-NUMBER field, which is not part of the STUDENT primary key To convert STUDENT to 3NF, you remove the ADVISOR-NAME field from the STUDENT table and place it into a table with ADVISOR-NUMBER as the primary key

A Normalization Example Is this attribute dependent on any other non-key attribute(s)? 2NF 3NF STUDENT-NUMBER STUDENT-NAME TOTAL-CREDITS GPA ADVISOR-NUMBER ADVISOR-NAME COURSE-NUMBER COURSE-DESC NUM-CREDITS GRADE STUDENT-NUMBER STUDENT-NAME TOTAL-CREDITS GPA ADVISOR-NUMBER ADVISOR-NAME COURSE-NUMBER COURSE-DESC NUM-CREDITS GRADE

A Normalization Example 3NF Table Names STUDENT-NUMBER STUDENT-NAME TOTAL-CREDITS GPA ADVISOR-NUMBER ADVISOR-NAME COURSE-NUMBER COURSE-DESC NUM-CREDITS GRADE STUDENT ADVISOR COURSE GRADE

A Normalization Example 3NF The final 3NF design is STUDENT (STUDENT-NUMBER, STUDENT-NAME, TOTAL-CREDITS, GPA, ADVISOR-NUMBER) ADVISOR (ADVISOR-NUMBER, ADVISOR-NAME) COURSE (COURSE-NUMBER, COURSE-DESC, NUM-CREDITS) GRADE (STUDENT-NUMBER, COURSE-NUMBER, GRADE)

A Normalization Example ADVISOR STUDENT ADVISES RECEIVES is on COURSE SHOWS GRADE Associative entity The ERD for STUDENT, ADVISOR, and COURSE after normalization

A Normalization Example Compare between the ERD before normalization and after After normalization we have four entitles: STUDENT, ADVISOR, COURSE, and GRADE, which is an associative entity You can see that (M:N) relationship between STUDENT and COURSE has been converted into two 1:M relationships One relationship between STUDENT and GRADE and the other relationship between COURSE and GRADE You should know that normal forms beyond 3NF exist, but they rarely are used in business-oriented systems

Sequence Summary 1NF 2NF 3NF All key attributes defined No repeating groups in a table All attributes dependent on a primary key 2NF No attribute dependent on a portion of a primary key Attributes may be functionally dependent on nonkey attributes 3NF Remove any transitive dependencies No attribute dependent on a nonkey attribute

Sequence Summary In this Sequence we have Explained the three steps of data normalization through an example

Reference [1] System Analysis and Design, Sixth Edition Authors: Gary B. Shelly, Thomas J. Cashman and Harry J. Rosenblatt Publisher: SHELLY CASHMAN SEWIES.