2005­02-02 | Database Normalization | © MySQL AB 2005 | www.mysql.com 1 Database Normalization PHP Quebec 2005 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
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normalization of Database Tables
SLIDE 1IS 257 – Fall 2004 Database Design: Normalization and The Relational Model University of California, Berkeley School of Information.
PARTITIONING “ A de-normalization practice in which relations are split instead of merger ”
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.
Bad DB Design Duplicate of data Duplicate of data Updating Updating Deleting Deleting.
NORMALIZATION N. HARIKA (CSC).
SQL, Data Storage Technologies, and Web-Data Integration Week 1.
Normalization.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Chapter 5 Normalization of Database Tables
Week 6 Lecture Normalization
Lecture 12 Inst: Haya Sammaneh
1 © Prentice Hall, 2002 Physical Database Design Dr. Bijoy Bordoloi.
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.
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.
1 Normalization Normalization intro Normalization intro First normal form (1NF) First normal form (1NF) Second normal form (2NF) Second normal form (2NF)
CORE 2: Information systems and Databases NORMALISING DATABASES.
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:
Database Essentials. Key Terms Big Data Describes a dataset that cannot be stored or processed using traditional database software. Examples: Google search.
© Pearson Education Limited, Chapter 15 Physical Database Design – Step 7 (Consider Introduction of Controlled Redundancy) Transparencies.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
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.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Normalization of Database Tables
©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 Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
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.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
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
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
2006­02-08 | Database Normalization | © MySQL AB 2006 | 1 An Introduction to Database Normalization Mike Hillyer – MySQL AB.
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.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
2006­03-08 | Managing Hierarchical Data | © MySQL AB 2005 | 1 Managing Hierarchical Data in MySQL Mike Hillyer - MySQL AB.
INFORMATION TECHNOLOGY – INT211
Database Normalization
Normalization By Jason Park Fall 2005 CS157A.
Normalization A337.
1st, 2nd, and 3rd Normal Forms
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.
Review of Week 3 Relation Transforming ERD into Relations
Presentation transcript:

2005­02-02 | Database Normalization | © MySQL AB 2005 | 1 Database Normalization PHP Quebec 2005 Mike Hillyer – MySQL AB

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

2005­02-02 | Database Normalization | © MySQL AB 2005 | 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…

2005­02-02 | Database Normalization | © MySQL AB 2005 | 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

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

2005­02-02 | Database Normalization | © MySQL AB 2005 | 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!

2005­02-02 | Database Normalization | © MySQL AB 2005 | 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)

2005­02-02 | Database Normalization | © MySQL AB 2005 | 8 Our Table namephone1phone2 1 2 Mike Tom Ray

2005­02-02 | Database Normalization | © MySQL AB 2005 | 9 First Normal Form Remove horizontal redundancies –No two columns hold the same information –No single column holds more than a single item 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

2005­02-02 | Database Normalization | © MySQL AB 2005 | 10 One Solution first_namelast_namephone RaySmith Multiple rows per user s are associated with only one other phone Hard to Search

2005­02-02 | Database Normalization | © MySQL AB 2005 | 11 Satisfying 1NF

2005­02-02 | Database Normalization | © MySQL AB 2005 | 12 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

2005­02-02 | Database Normalization | © MySQL AB 2005 | 13 Joining Tables

2005­02-02 | Database Normalization | © MySQL AB 2005 | 14 Our User Table first_namelast_namecompanydepartment MikeHillyerMySQLDocumentation TomJensenCPNSFinance RaySmithCPNSDocumentation

2005­02-02 | Database Normalization | © MySQL AB 2005 | 15 Second Normal Form Table must be in First Normal Form Remove vertical redundancy –The same value should not repeat across rows Composite keys –All columns in a row must refer to BOTH parts of the key Benefits –Increased storage efficiency –Less data repetition

2005­02-02 | Database Normalization | © MySQL AB 2005 | 16 Satisfying 2NF

2005­02-02 | Database Normalization | © MySQL AB 2005 | 17 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 relate directly to the primary key Benefits –No extraneous data

2005­02-02 | Database Normalization | © MySQL AB 2005 | 18 Satisfying 3NF

2005­02-02 | Database Normalization | © MySQL AB 2005 | 19 Finding Balance

2005­02-02 | Database Normalization | © MySQL AB 2005 | 20 Joining Tables Two Basic Joins –Equi-Join –Outer Join (LEFT JOIN) Equi-Join –SELECT user.first_name, user.last_name, .address FROM user, WHERE user.user_id = .user_id LEFT JOIN –SELECT user.first_name, user.last_name, .address FROM user LEFT JOIN ON user.user_id = .user_id

2005­02-02 | Database Normalization | © MySQL AB 2005 | 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

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

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

2005­02-02 | Database Normalization | © MySQL AB 2005 | 24 Book Draw! Stick around and win a book!