Understand Normalization

Slides:



Advertisements
Similar presentations
CHAPTER OBJECTIVE: NORMALIZATION THE SNOWFLAKE SCHEMA.
Advertisements

Module 2 Designing a Logical Database Model. Module Overview Guidelines for Building a Logical Database Model Planning for OLTP Activity Evaluating Logical.
The Relational Model System Development Life Cycle Normalisation
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Entity-Relationship Model and Diagrams (continued)
The Relational Database Model:
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.
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2007 (Week 3, Tuesday 9/4/2007)
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Week 6 Lecture Normalization
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Software School of Hunan University Database Systems Design Part III Section 5 Design Methodology.
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
DATABASES Pindaro Demertzoglou – Lally School of Management and Technology.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Database Systems: Design, Implementation, and Management Tenth Edition
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
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.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
CORE 2: Information systems and Databases NORMALISING DATABASES.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
What's a Database A Database Primer Let’s discuss databases n Why they are hard n Why we need them.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
©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.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
NORMALIZATION. What is Normalization  The process of effectively organizing data in a database  Two goals  To eliminate redundant data  Ensure data.
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Logical Database Design and the Relational Model.
IST Database Normalization Todd Bacastow IST 210.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Lecture 4: Logical Database Design and the Relational Model 1.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Logical Database Design and Relational Data Model Muhammad Nasir
Data Resource Management Application Layer TPS A RCHITECTURE Data Layer Sales/MarketingHR Finance/Accounting Operations Spreadsheet Data MS Access Accounts.
Lecture # 17 Chapter # 10 Normalization Database Systems.
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Understanding Data Storage
Normalization Karolina muszyńska
A brief summary of database normalization
Chapter 4 Relational Databases
Database Normalization
Entity-Relationship Model and Diagrams (continued)
Chapter 9 Designing Databases
Relational Database Model
BTEC ICT – Unit 18 With Mr Griffiths.
Presentation transcript:

Understand Normalization LESSON 4.1 98-364 Database Administration Fundamentals Understand Normalization

Lesson Overview 4.1. Understand normalization In this lesson, you will review: Normalization Normal Form 1NF—First Normal Form 2NF—Second Normal Form 3NF—Third Normal Form 4NF—Fourth Normal Form 5NF—Fifth Normal Form

Normalization Applying a body of techniques to a relational database to minimize the inclusion of duplicate information. Normalization greatly simplifies query and update management, including security and integrity considerations, although it does so at the expense of creating a larger number of tables. Note: Having student_id data in more then one table is not redundant data. It is required for the related dependency. Why use normalization? It reduces the amount of storage space a database uses and ensures that data is logically stored.

Normal Form An approach to structuring (organizing) information to avoid redundancy and inconsistency and to promote efficient maintenance, storage, and updating. Several “rules” or levels of normalization are accepted, each a refinement of the preceding one. Three forms are commonly used: — First Normal Form (1NF) — Second Normal Form (2NF) — Third Normal Form (3NF)

1NF—First Normal Form Groups of records (such as Student_info) in which each field (column) contains unique value and no repetitive information. This form is the least structured of the forms. Basic rules for a database: — Eliminate duplicative columns from the same table — Create separate tables for each group of related data and identify each row with a unique column (the primary key). Keys are reviewed later in this course.

1NF—First Normal Form (Continued) Table Teacher_classes: Teacher, class1,class2, class3, class4, class5, class6 Is NOT 1NF. In this table, we have duplicated columns: Class1, Class2, Class3 are copies of each other (duplicated columns). 1NF Example: Table Teacher_classes Teacher_ID and Class_ID: In this table, we have no duplicated columns. In this table form, we have Unique IDs. Teacher Class1 Class2 Class3 Jones Eng123 Eng456 Lit100 Teacher ID Class_Id 78v22 12567

2NF—Second Normal Form 2NF more aggressively removes duplicative data. 2NF adds new rules which do the following: — Meet all the requirements of the 1NF — Remove subsets of data that apply to multiple rows of a table and place them in separate tables — Create relationships between these new tables and their predecessors through the use of foreign keys

2NF—Second Normal Form (Continued) Example of Student_ Address table before and after 2NF: Before 2NF Student_ Address Table After 2NF Student_ Address Table And ZIP Table (new table added) In this 2NF, we no longer store city, state, and zip information with every student. This results in a large storage saving when you have 25,000 students. FirstName LastName Address City State ZIP FirstName LastName Address ZIP Ask the students to identify the foreign key for the table in 2NF (ZIP code). City State ZIP

3NF—Third Normal Form 3NF goes one step further. Meets all the requirements of 2NF plus — Removes columns that are not dependent upon the primary key. Any column that is not directly needed is removed from the table. An example would be a tax on sales at a bookstore. Taxes are a calculated transaction, not a fixed amount tied to the student. If the tax rate changes, we need to change the tax rate in only one spot, not in thousands of records.

3NF—Third Normal Form (Continued) Example: Before and after 3NF: Before 3NF: Bookstore sales table After 3NF: Bookstore sales table The table items Sub_Total, Tax, and Total are all calculated fields. Hence, the columns that are not dependent upon the primary key are removed for 3NF. Student-ID Items_Id Quantity Sub-Total Tax Total Student_ID Items_Id Quantity

4NF—Fourth Normal Form Rarely used 4NF has one additional requirement: — Meets all the requirements of 3NF and it has no multivalued dependencies Multivalued dependencies Observe this three-column table labeled A, B, and C. For every value of A, we have respective values for B and C. B and C are independent of each other.  A B C Mary Moon Potatoes John Sports cars Beans sprouts

5NF—Fifth Normal Form Rarely used Also known as join-projection normal form (JPNF), states that no nontrivial join dependencies exist. Any fact should be able to be reconstructed without any anomalous results in any case, regardless of the number of tables being joined. Should have only candidate keys and its primary key should consist of only a single column. Problem — The size of the joins that are required to reconstruct any nontrivial data. Views and procedures can simplify them, but the underlying data still ends up very complex. Performance issues to consider—4NF and 5NF are often academic. In most cases, 3NF is the state normalization for databases.

5NF—Fifth Normal Form (Continued) Only in rare situations does a 4NF table not conform to 5NF. These are situations in which a complex real-world constraint governing the valid combinations of attribute values in the 4NF table is not implicit in the structure of that table. If such a table is not normalized to 5NF, the burden of maintaining the logical consistency of the data within the table must be carried partly by the application responsible for insertions, deletions, and updates to it; and there is a heightened risk that the data within the table will become inconsistent. 5NF design excludes the possibility of such inconsistencies. In general, it is the best practice to keep your database in 3NF.

Lesson Review What is normalization? Why use normalization? What forms are typically used and why? 1. What is Normalization? Normalization is the process of organizing data in a database. 2. Why use Normalization? To reduce the amount of storage space that a database uses and ensure that data is logically stored. 3. What forms are normally used and why? The first three forms (1NF, 2NF, and 3NF) are generally preferred to keep the database in. You have greater risk of data integrity loss when using higher forms. (4NF & 5NF) Reference Notes: First Normal Form (1NF) sets a few basic rules for a database: — Eliminate duplicated columns from the same table. — Create separate tables for each group of related data and identify each row with a unique column (the primary key). Second Normal Form (2NF) = 1NF Plus — Remove subsets of data that apply to multiple rows of a table and place them in separate tables. — Create relationships between these new tables and their predecessors through the use of foreign keys. Third Normal Form (3NF) = 2NF Plus — Remove columns that are not dependent upon the primary key.