Normalization By Jason Park Fall 2005 CS157A.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Normalization By Jason Park Fall 2005 CS157A. Database Normalization Database normalization is the process of removing redundant data from your tables.
Normalization Lite Pepper. Golden Rule Every attribute must depend upon the key, --- > 1NF the whole key, --- > 2NF and nothing but the key. -  3NF and.
Database Design Normal forms & Normalization Compiled by S. Z.
Functional Dependency CS157a Sec. 2 Koichiro Hongo.
Normalization of Database Tables
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Database Normalization Il-Han Yoo CS 157A Professor: Sin-Min Lee.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Project and Data Management Software
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Bad DB Design Duplicate of data Duplicate of data Updating Updating Deleting Deleting.
NORMALIZATION N. HARIKA (CSC).
Functional Dependency Presenter Usman Saeed. Definition Definition: –constraints on relations() –characteristic of an attribute where values are determined.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Normalization.
Normalization. Database Normalization Database normalization is the process of removing redundant data from your tables in to improve storage efficiency,
Cambridge TEC - Level 3 Certificate/Diploma IT. ICT Dept ScenarioLO1LO2LO3.
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.
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.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
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.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
2005­02-02 | Database Normalization | © MySQL AB 2005 | 1 Database Normalization PHP Quebec 2005 Mike Hillyer – MySQL AB.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
CORE 2: Information systems and Databases NORMALISING DATABASES.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Normalization of Database Tables
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.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Chapter 8: Object-Relational Modeling
Understanding Data Storage
Database, tables and normal forms
Revised: 2 April 2004 Fred Swartz
Normalization Karolina muszyńska
A brief summary of database normalization
INFORMATION TECHNOLOGY – INT211
1st, 2nd, 3rd Normal Forms Boyce-Codd Normal Form
Relational Database Design by Dr. S. Sridhar, Ph. D
Chapter 4 Relational Databases
Chapter 8: Relational Database Design
Database Normalization
Relational Model and ER Model: in a Nutshell
Normalization Referential Integrity
Entity relationship diagrams
Chapter 6 Normalization of Database Tables
1st, 2nd, and 3rd Normal Forms
Database solutions The process of normalization Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms:
Normalization Dale-Marie Wilson, Ph.D..
Normalization.
Normalization of Database Tables Uploaded by: mysoftbooks.ml
Normalization Normalization theory is based on the observation that relations with certain properties are more effective in inserting, updating and deleting.
1st, 2nd, and 3rd Normal Forms
Sampath Jayarathna Cal Poly Pomona
Design tools and techniques for a relational database system
Normalization By Jason Park Fall 2005 CS157A.
Review of Week 3 Relation Transforming ERD into Relations
Database Design Normalisation (2)
Presentation transcript:

Normalization By Jason Park Fall 2005 CS157A

Database Normalization Database normalization is the process of removing redundant data from your tables in to improve storage efficiency, data integrity, and scalability. In the relational model, methods exist for quantifying how efficient a database is. These classifications are called normal forms (or NF), and there are algorithms for converting a given database between them. Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.

History Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form in his paper A Relational Model of Data for Large Shared Data Banks Codd stated: “There is, in fact, a very simple elimination procedure which we shall call normalization. Through decomposition nonsimple domains are replaced by ‘domains whose elements are atomic (nondecomposable) values.’”

Normal Form Edgar F. Codd originally established three normal forms: 1NF, 2NF and 3NF. There are now others that are generally accepted, but 3NF is widely considered to be sufficient for most applications. Most tables when reaching 3NF are also in BCNF (Boyce-Codd Normal Form).

Table 1 Title Author1 Author2 ISBN Subject Pages Publisher Database System Concepts Abraham Silberschatz Henry F. Korth 0072958863 MySQL, Computers 1168 McGraw-Hill Operating System Concepts 0471694665 Computers 944

Table 1 problems This table is not very efficient with storage. This design does not protect data integrity. Third, this table does not scale well.

First Normal Form In our Table 1, we have two violations of First Normal Form: First, we have more than one author field, Second, our subject field contains more than one piece of information. With more than one value in a single field, it would be very difficult to search for all books on a given subject.

First Normal Table Table 2 Title Author ISBN Subject Pages Publisher Database System Concepts Abraham Silberschatz 0072958863 MySQL 1168 McGraw-Hill Henry F. Korth Computers Operating System Concepts 0471694665 944

We now have two rows for a single book We now have two rows for a single book. Additionally, we would be violating the Second Normal Form… A better solution to our problem would be to separate the data into separate tables- an Author table and a Subject table to store our information, removing that information from the Book table:

Subject Table Author Table Book Table Subject_ID Subject 1 MySQL 2 Computers Author Table Author_ID Last Name First Name 1 Silberschatz Abraham 2 Korth Henry Book Table ISBN Title Pages Publisher 0072958863 Database System Concepts 1168 McGraw-Hill 0471694665 Operating System Concepts 944

Each table has a primary key, used for joining tables together when querying the data. A primary key value must be unique with in the table (no two books can have the same ISBN number), and a primary key is also an index, which speeds up data retrieval based on the primary key. Now to define relationships between the tables

Relationships Book_Author Table Book_Subject Table ISBN Author_ID 0072958863 1 2 0471694665 ISBN Subject_ID 0072958863 1 2 0471694665

Second Normal Form As the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, the tables must already be in First Normal Form. The Book Table will be used for the 2NF example

2NF Table Publisher Table Book Table Publisher_ID Publisher Name 1 McGraw-Hill Book Table ISBN Title Pages Publisher_ID 0072958863 Database System Concepts 1168 1 0471694665 Operating System Concepts 944

2NF Here we have a one-to-many relationship between the book table and the publisher. A book has only one publisher, and a publisher will publish many books. When we have a one-to-many relationship, we place a foreign key in the Book Table, pointing to the primary key of the Publisher Table. The other requirement for Second Normal Form is that you cannot have any data in a table with a composite key that does not relate to all portions of the composite key.

Third Normal Form Third normal form (3NF) requires that there are no functional dependencies of non-key attributes on something other than a candidate key. A table is in 3NF if all of the non-primary key attributes are mutually independent There should not be transitive dependencies

Boyce-Codd Normal Form BCNF requires that the table is 3NF and only determinants are the candidate keys

END