1 Normalization Normalization intro Normalization intro First normal form (1NF) First normal form (1NF) Second normal form (2NF) Second normal form (2NF)

Slides:



Advertisements
Similar presentations
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Advertisements

1 SQL Server Management Studio SQL DDL CREATE TABLE Constraints ALTER TABLE DROP TABLE The GUI way Steen Jensen, autumn 2013.
Concepts of Database Management Seventh Edition
Module 2 Designing a Logical Database Model. Module Overview Guidelines for Building a Logical Database Model Planning for OLTP Activity Evaluating Logical.
Normalisation Ensuring data integrity in database design 1.
Modeling the Data: Conceptual and Logical Data Modeling
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 17 Designing Databases
Methodology Logical Database Design for the Relational Model
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalization of Database Tables
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Chapter 5 Normalization of Database Tables
Project and Data Management Software
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Introduction to Databases
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Normalization of Tables “Between two evils, choose neither; between two goods, choose both.” Tryon Edwards.
CSC271 Database Systems Lecture # 30.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
1 © Prentice Hall, 2002 Physical Database Design Dr. Bijoy Bordoloi.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
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.
The Relational Model and Normalization R. Nakatsu.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
1 Definition of a subquery Nested subqueries Correlated subqueries The ISNULL function Derived tables The EXISTS operator Mixing data types: CAST & CONVERT.
1 Intro to JOINs SQL INNER JOIN SQL OUTER JOIN SQL FULL JOIN SQL CROSS JOIN Intro to VIEWs Simple VIEWs Considerations about VIEWs VIEWs as filters ALTER.
Natural vs. Generated Keys. Definitions Natural key—a key that occurs in the data, that uniquely identifies rows. AKA candidate key. Generated key—a key.
Concepts of Database Management Seventh Edition
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Introduction Lesson 1. Skills Matrix Relational Database Management System (RDBMS) Installing and configuring SQL Server. Implementing high availability.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Methodology – Monitoring and Tuning the Operational System.
©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.
A337 - Reed Smith1 Structure What is a database? –Table of information Rows are referred to as records Columns are referred to as fields Record identifier.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 04 – 05 – 2005.
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
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 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Systems Analysis & Design Methods III Classic normalization rules for relational databases III Classic normalization rules for relational databases.
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
Understanding Data Storage
Conceptual and Physical Database Design
Database Normalization
Relational Algebra Chapter 4, Part A
Relational Algebra 461 The slides for this text are organized into chapters. This lecture covers relational algebra, from Chapter 4. The relational calculus.
Database Basics An Overview.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Normalization Referential Integrity
Relational Algebra Chapter 4, Sections 4.1 – 4.2
The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited)
Chapter 17 Designing Databases
Presentation transcript:

1 Normalization Normalization intro Normalization intro First normal form (1NF) First normal form (1NF) Second normal form (2NF) Second normal form (2NF) Third normal form (3NF) Third normal form (3NF) Denormalization Denormalization Beyond normalization Beyond normalization Can be skipped in chapter 8 Can be skipped in chapter 8 Steen Jensen, autumn 2013

2 Normalization - introduction To ensure that the database is constructed appropriately (consistent design), normalization rules are used 6 normalization rules exist (normal forms) – normally only the 3 first are used, which have a practical importance Normalization first originated along with relational databases – E. F. Codd (IBM) in 1969

All attributes must be dependent of the primary key No repeating fields or composite fields Owner1-4 are repeating and are not dependent of the primary Solution: Owner1-4 are deleted, and a new table (entity) is made (CarUser) Car Registration Model Colour NumberDoors Owner1 Owner2 Owner3 Owner4 CarUser Registration UserId SoldDate ManufactureDate User UserId Name Street ….. ZipCode PostalDistrict 3 First normal form (1NF) – example 1

4 First normal form (1NF) – example 2

By compound primary keys all other attributes must be equally dependent of both parts of the key ManufactureDate is only dependent of Registration Solution: ManufactureDate is moved to Car CarUser Registration UserId SoldDate ManufactureDate 5 Second normal form (2NF)

No attribute must be more dependent of other attributes than the primary key Derived data is not allowed User UserId Name Street ….. ZipCode PostalDistrict 6 Third normal form (3NF) – example 1 User UserId Name Street ….. ZipCode District ZipCode PostalDistrict

Derived data is not allowed – just delete the column (attribute) 7 Third normal form (3NF) – example 2

Sometimes denormalization can actually be a good idea: If including extra columns (attributes) can dramatically reduce response time for queries When storing historical data (store data in fewer tables) The fewer tables that have to be joined, the easier for users to do their own reports 8 Denormalization

Even though normalization is important, it isn’t everything! Keep it simple – try avoiding complex solutions Choose the right data types (“wasted space is wasted speed), e.g. To store months (1-12) a tinyint would be ideal (not an int) “Are we going to need that information later?” – if in doubt, just keep it! 9 Beyond normalization

Page 270 – bot – 302top: Other normal forms (beyond third form: academic) Understanding relationships: already covered Diagramming databases + Drawing up a quick example: we use Dia (or similar) 10 Can be skipped in chapter 8

 Take a look at exercise 1 page 302 in SQL Server  Try to make your solution without looking at the answer at the back of the book  When you have finished, compare your solution with the answer on page 788bot – 789top 11

 Take a look at your relational model for Amazon  Try to run your model through the three normal forms  Is it ok, or do you need to change something? 12