Agenda and Objectives Agenda ▫Examine normalized and non-normalized ERDs/Tables Objectives ▫Given an ERD, you will be able to determine whether or not.

Slides:



Advertisements
Similar presentations
Normalization Rules for Database Tables
Advertisements

Chapter 5 Normalization of Database Tables
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Normalisation Ensuring data integrity in database design 1.
Athabasca University Under Development for COMP 200 Gary Novokowsky
Logical Data Modeling Review Lecture for University of Agder, Grimstad DAT202 Databaser (5.5.11) Judith Molka-Danielsen
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Entity Relationship Diagrams
CS263:Revision on Normalisation
The Relational Database Model:
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization A337. A337 - Reed Smith2 Structure What is a database? ◦ Tables of information  Rows are referred to as records  Columns are referred.
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
Database – Part 2a Dr. V.T. Raja Oregon State University.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Chapter 4: Logical Database Design and the Relational Model (Part II)
Week 6 Lecture Normalization
Modelling Techniques - Normalisation Description and exemplification of normalisation.Description and exemplification of normalisation. Creation of un-normalised.
Concepts and Terminology Introduction to Database.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Concepts of Database Management, Fifth Edition
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.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
Database Normalization Lynne Weldon July 17, 2000.
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)
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.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Data Models and Relational Databases Chapter 2. Learning Objectives Identify primary and foreign keys for each entity and relevant relationships in the.
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.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
What's a Database A Database Primer Let’s discuss databases n Why they are hard n Why we need them.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
Database Design – Lecture 8
Faculty of Arts Atkinson College ITEC 1010 A F 2002 Welcome Nineteenth Lecture for ITEC A Professor G.E. Denzel.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Normalization Is the gradual and sequential process of efficiently organizing data in a database that follows the rules listed in the previous slide –
Normalizing Your Database CPT 242. Normalization The procedure where the developer analyzes the data and establishes the table structure to create the.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
NORMALIZATION. What is Normalization  The process of effectively organizing data in a database  Two goals  To eliminate redundant data  Ensure data.
1 Class Agenda (04/06/2006 and 04/11/2006)  Discuss use of Visio for ERDs  Learn concepts and ERD notation for data generalization  Introduce concepts.
Data modeling Process. Copyright © CIST 2 Definition What is data modeling? –Identify the real world data that must be stored on the database –Design.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Brian Thoms.  Databases normalization The systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain.
Logical Database Design and the Relational Model.
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
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
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Lecture # 17 Chapter # 10 Normalization Database Systems.
Understanding Data Storage
INLS 623 – Database Normalization
SEEM3430: Information Systems Analysis and Design
Payroll Management System
Database Normalization
Entity relationship diagrams
Normalization A337.
Database Normalization.
Presentation transcript:

Agenda and Objectives Agenda ▫Examine normalized and non-normalized ERDs/Tables Objectives ▫Given an ERD, you will be able to determine whether or not it is in 3NF. ▫Given a non-normalized ERD (or database table), you will be able to revise it to make it 3NF compliant. Resource ▫Normalized_ERDs.pptx

Normalizing Your Database Model IS 310 Dr. Jean A. Pratt

Related Terminology Normalization First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) 1NF: No repeating groups; 1 value/cell 2NF: No partial dependencies 3NF: No transitive dependencies

First Normal Form (1NF) Only those attributes that describe the entity are included in that entity Each entity has a primary key (PK) Each attribute is the smallest unit that would be included in a query Data is not repeated in different entities Each attribute would contain a single value in the database table cell Redundant data is minimized

Multivalued Attributes: AVOID Multivalued attribute ▫An attribute that may take on more than one value for each entity instance  Examples  Skill is a multivalued attribute of Employee  Color may be a multivalued attribute of ToyBlock  Dependent is a multivalued attribute of Employee  Phone/fax number is a multivalued attribute of Employee Repeating group ▫A set of multivalued attributes that are logically related—associated with the same entity instance  Dependent address for each dependent of employee

Example of (almost) 1NF ERD Note that we will still have redundant data (although not multivalued) if students live at the same address. We’ll want to remove that redundancy later.

Resulting 1NF Table STUDENT Student_IDFirst NameLast NameStreetCityStateZipPhone 12345JoeJohnson1234 MainEau ClaireWI SallyShue7484 MainAltoonaWI MollyMae2342 MainMondoviWI JillJohnson1234 MainEau ClaireWI JoeJohnson9898 GrandeElk MoundWI

How to Correct Multivalued or Repeating Attributes 1.Create new entity 2.New entity could be weak/dependent/identifying 3.New entity could independent

Multivalued Attributes: Table Add rows, not columns PHONE Emp IDPhone NumberType H C H C O F O

Identify & Name the 1NF Violations

Resulting Table STUDENT Student Name AddressEmergency Contact Info Joe Johnson1234 Main, Eau Claire, WI 54703Herbert and Gertrude Johnson, 1234 Main, Eau Claire, WI Sally Shue7484 Main, Altoona, WI 54720Simon and Susan Shue, 7484 Main, Altoona, WI Molly Mae2342 Main, Mondovi, WI 54755Albert and Alfreda Mae, 2342 Main, Mondovi, WI 54755, Jill Johnson1234 Main, Eau Claire, WI 54703Herbert and Gertrude Johnson, 1234 Main, Eau Claire, WI Joe Johnson9898 Grande, Elk Mound, WI 54739Louise Johnson, 9898 Grande, Elk Mound, WI

Identify & Name the 1NF Violations

Resulting Table STUDENT Student_IDFirst NameLast NameStreetCityStateZipEmerg Phone ClassesGradesSports & Activities Position 12345JoeJohnson1234 MainEau ClaireWI Biology, English, Algebra A, B, BFootball, Basketball, Baseball, Choir, Tennis QB, Bass, #1 Doubles 23435SallyShue7484 MainAltoonaWI Biology, English, Algebra B, B, ADebate, Band, Tennis Parliament ary, 1 st Flute, #1 Doubles 23424MollyMae2342 MainMondoviWI Chemistry, Art, Math A, B, A, BSpeechImpromptu 12346JillJohnson1234 MainEau ClaireWI Algebra, English, Art A, A, Chess, Tennis President, #1 Singles 12347JoeJohnson9898 Grande Elk MoundWI Math, Trigonomet ry, Chemistry A, A, AChess,VP, #1 Singles

Is This a Good Solution?

Resulting Table STUDENT Student_ID First Name Last Name Class 1Grade 1Class 2Grade 2Class 3Grade 3Sport/A ctivity 1 PositionSport/A ctivity 2 PositionSport/A ctivity 3 Position 12345JoeJohnsonBiologyAEnglishBAlgebraBFootballQBChoirBassTennis#1 Doubles 23435SallyShueBiologyBEnglishBAlgebraADebateParliam entary Band1 st FluteTennis#1 Doubles 23424MollyMaeChemist ry AArtBMathASpeechImprom ptu 12346JillJohnsonAlgebraAEnglishAArtAChessPreside nt Tennis#1 Single 12347JoeJohnsonMathATrigono metry AChemist ry AChessVP

How would you Solve This Problem? EMPLOYEE Emp_IDFnameLnameDependent1Dependent2Dependent3 1JoeJohnsonJohnnyJane 2MaryZabowskiElizabethMadisonLogan 3JoeyChoAnnie 4EllenMaffeyRobertBlaine What about employees with more than 3 children?

Second Normal Form (2NF) Entities meet 1NF requirements PLUS All attributes are functionally dependent upon the entire primary key.

Identify & Name the 2NF Violations

Resulting Table STUDENT Student_IDFirst NameLast NameClassGradesSport or Activity Position 12345JoeJohnsonBiologyAFootballQB 12345JoeJohnsonEnglishBBasketballGuard 12345JoeJohnsonAlgebraBBaseballCatcher 12345JoeJohnsonChoirBass 12345JoeJohnsonTennis#1 Doubles 23424MollyMaeChemistryASpeechImpromptu 23424MollyMaeArtB 23424MollyMaeMathA

Third Normal Form (3NF) Violation Entities meet 2NF requirements BUT One non-key attribute determines another non- key attribute

Completed 3NF ERD

What are the Values for the Associative Entities?

Resulting Relations STUDENT Student_ID First NameLast NameAdd_IDPhoneGuardian_ID 12345JoeJohnson SallyShue MollyMae JillJohnson JoeJohnson CLASS Class_IDName 10Biology 20English 30Algebra 40Chemistry 50Math 60Art 70Trigonometry 80History 90Geography SPORT/ ACTIVITY Event_IDName 100Football 101Debate 102Speech 103Chess 104Choir 105Band 106Basketball 107Tennis 108Baseball 109Hockey ENROLLMENT Enrollment_IDYearSemesterGradeClass_IDStudent_ID FallB FallF FallA SpringB SpringC SpringB PARTICIPATION PartIDPositionStudent_IDEvent_ID 2222 nd Singles Guard Alto QB Forensics Forensics st Doubles st Doubles ADDRESS Add_IDZipStateCityStreet WIEau Claire1234 Main WIAltoona7484 Main WIMondovi2342 Main WIElk Mound9898 Grande GUARDIAN Guardian_ID First NameLast NameAdd_IDPhone 1HerbertJohnson SimonShue AlbertMae LouiseJohnson

Review Know the difference between 1NF, 2NF and 3NF Ensure your ERD (and resulting database) is in at least 2NF 3NF is the standard (with purposeful violations based on performance)

Application to Your Project Define the necessary tables from every DFD data store Create an ERD to model the data storage Normalize the ERD to 3NF Create mock-up relations to test your model Include the ERD and mock-up relations in your final project documentation

Data Modeling Practice 1.A vendor supplies many products. 2.A product is supplied by many vendors. 3.A customer buys one or more products. 4.Each product can be purchased by many customers. 5.An employee can help many customers. 6.A customer is helped by one or more employees. 7.Each employee works in one department. 8.A department has many employees (working in it). 9.Each department is part of many stores. 10.Each store contains many departments. Scenario: Chain stores (e.g., Target) that contain several departments and sell many products to many customers.