2006­02-08 | Database Normalization | © MySQL AB 2006 | www.mysql.com 1 An Introduction to Database Normalization Mike Hillyer – MySQL AB.

Slides:



Advertisements
Similar presentations
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Advertisements

Database Normalization
Normalization By Jason Park Fall 2005 CS157A. Database Normalization Database normalization is the process of removing redundant data from your tables.
Normalization of Database Tables
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normalization of Database Tables
Normalization of Database Tables
INFO 340 Lecture 7 Functional Dependency, Normalization.
Chapter 5 Normalization of Database Tables
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
Bad DB Design Duplicate of data Duplicate of data Updating Updating Deleting Deleting.
Normalization.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Chapter 5 Normalization of Database Tables
Lecture 12 Inst: Haya Sammaneh
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
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.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
Database Systems: Design, Implementation, and Management Tenth Edition
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 A Guide to MySQL 2 Database Design Fundamentals.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
Normalization. We will take a look at –First Normal Form –Second Normal Form –Third Normal Form There are also –Boyce-Codd, Fourth and Fifth normal forms.
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.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
SQL 101 for Web Developers 14 November What is a database and why have one? Tables, relationships, normalization SQL – What SQL is and isn’t – CRUD:
1 Databases November 15, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel, and Goldberg. Published.
1 A Guide to MySQL 2 Database Design Fundamentals.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
Normalization of Database Tables
Functional Dependency, Normalization
©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.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
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.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
Dr. T. Y. Lin | SJSU | CS 157A | Fall 2015 Chapter 3 Database Normalization 1.
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
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
Database Planning Database Design Normalization.
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.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
2006­03-08 | Managing Hierarchical Data | © MySQL AB 2005 | 1 Managing Hierarchical Data in MySQL Mike Hillyer - MySQL AB.
A Guide to SQL, Eighth Edition
Normalization Karolina muszyńska
Database Normalization
Normalization By Jason Park Fall 2005 CS157A.
1st, 2nd, and 3rd Normal Forms
Normalization.
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
Normalization By Jason Park Fall 2005 CS157A.
Presentation transcript:

2006­02-08 | Database Normalization | © MySQL AB 2006 | 1 An Introduction to Database Normalization Mike Hillyer – MySQL AB

2006­02-08 | Database Normalization | © MySQL AB 2006 | 2 About Me Member of the MySQL AB documentation team MySQL Core and Pro Certified MySQL expert at Resident MySQL expert at SearchOpenSource.com Mike Hillyer, BSc

2006­02-08 | Database Normalization | © MySQL AB 2006 | 3 About You Currently use MySQL? Another RDBMS? Are responsible for database design? Will be in the future? Know about database normalization? How many of you…

2006­02-08 | Database Normalization | © MySQL AB 2006 | 4 About This Session Introduction What Is Database Normalization? What are the Benefits of Database Normalization? What are the Normal Forms? First Normal Form Second Normal Form Forming Relationships Third Normal Form Joining Tables De-Normalization Conclusion

2006­02-08 | Database Normalization | © MySQL AB 2006 | 5 What Is Database Normalization? Cures the ‘SpreadSheet Syndrome’ Store only the minimal amount of information. Remove redundancies. Remove anomalies. Restructure data.

2006­02-08 | Database Normalization | © MySQL AB 2006 | 6 What are the Benefits of Database Normalization? Decreased storage requirements! 1 VARCHAR(20) converted to 1 TINYINT UNSIGNED in a table of1 million rows is a savings of~20 MB Faster search performance! –Smaller file for table scans. –More directed searching. Improved data integrity!

2006­02-08 | Database Normalization | © MySQL AB 2006 | 7 What are the Normal Forms? First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF) Fourth Normal Form (4NF) Fifth Normal Form (5NF) Sixth Normal Form (6NF)

2006­02-08 | Database Normalization | © MySQL AB 2006 | 8 Our Table TitleAuthorBioISBNSubjectPagesPublisher Beginning MySQL Database Design and Optimization Chad Russell Jon Stephens Chad Russell is a programmer and network administrator who owns his own Internet hosting company. Jon Stephens is a member of the MySQL AB documentation team MySQL Database Design 520Apress

2006­02-08 | Database Normalization | © MySQL AB 2006 | 9 First Normal Form All values must be atomic Each row must be unique –Use a primary key Benefits –Easier to query/sort the data –More scalable –Each row can be identified for updating

2006­02-08 | Database Normalization | © MySQL AB 2006 | 10 Satisfying 1NF ISBNTitlePages Beginning MySQL Database Design and Optimization 520 Book Author_I D First_NameLast_name 1ChadRussell 2JonStephens 3MikeHillyer Author Subject_IDName 1MySQL 2Database Design Subject Publisher_IDNameAddressCityStateZip 1Apress 2560 Ninth Street, Station 219 BerkeleyCalifornia94710 Publisher

2006­02-08 | Database Normalization | © MySQL AB 2006 | 11 Forming Relationships Three Forms –One to (zero or) One –One to (zero or) Many –Many to Many One to One –Same Table? One to Many –Place PK of the One in the Many Many to Many –Create a joining table

2006­02-08 | Database Normalization | © MySQL AB 2006 | 12 Many-to-Many (Joining Tables) ISBNAuthor_ID ISBNSubject_ID Book_Author Book_Subject

2006­02-08 | Database Normalization | © MySQL AB 2006 | 13 One-To-Many ISBNTitlePagesPublisher_ID Beginning MySQL Database Design and Optimization 5201 Book

2006­02-08 | Database Normalization | © MySQL AB 2006 | 14 Second Normal Form Table must be in First Normal Form Composite keys –All columns in a row must refer to the entire key Benefits –Increased storage efficiency –Less data repetition ISBNAuthor_IDSummaryAuthor_URL A great book! Review

2006­02-08 | Database Normalization | © MySQL AB 2006 | 15 Third Normal Form Table must be in Second Normal Form –If your table is 2NF, there is a good chance it is 3NF All columns must depend directly on the primary key “The key, the whole key, and nothing but the key” Benefits –No extraneous data

2006­02-08 | Database Normalization | © MySQL AB 2006 | 16 Satisfying Third Normal Form Publisher_IDNameAddressZip 1Sams Publishing800 East 96th Street46240 Publisher ZipCityState 46240IndianapolisIndiana Zip

2006­02-08 | Database Normalization | © MySQL AB 2006 | 17 Finding Balance

2006­02-08 | Database Normalization | © MySQL AB 2006 | 18 Joining Tables Two Basic Joins –Inner-Join –Outer Join LEFT OUTER JOIN RIGHT OUTER JOIN FULL OUTER JOIN

2006­02-08 | Database Normalization | © MySQL AB 2006 | 19 Inner Join mysql> SELECT First_Name, Last_Name, ISBN -> FROM Author INNER JOIN Book_Author ON Author.Author_ID = Book_Author.Author_ID; | First_Name | Last_Name | ISBN | | Chad | Russell | | | Jon | Stephens | | rows in set (0.05 sec)

2006­02-08 | Database Normalization | © MySQL AB 2006 | 20 LEFT OUTER JOIN mysql> SELECT First_Name, Last_Name, ISBN -> FROM Author LEFT OUTER JOIN Book_Author ON Author.Author_ID = Book_Author.Author_ID; | First_Name | Last_Name | ISBN | | Chad | Russell | | | Jon | Stephens | | | Mike | Hillyer | NULL | rows in set (0.00 sec)

2006­02-08 | Database Normalization | © MySQL AB 2006 | 21 De-Normalizing Tables Use with caution Normalize first, then de-normalize Use only when you cannot optimize Try temp tables, UNIONs, VIEWs, subselects first

2006­02-08 | Database Normalization | © MySQL AB 2006 | 22 Conclusion normalization.html MySQL Database Design and Optimization –Jon Stephens & Chad Russell –Chapter 3 –ISBN –

2006­02-08 | Database Normalization | © MySQL AB 2006 | 23 QUESTIONS? Feel free to ask now or find me after this session!