Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.

Slides:



Advertisements
Similar presentations
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Advertisements

1 Logical Database Design and the Relational Model Modern Database Management.
CSc-340 6b1 Relational Database Design Chapter 8 [1 of 2] Features of Good Relational Designs Atomic Domains and First Normal Form Decomposition Using.
Systems Development Life Cycle
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
The Database Approach u Emphasizes the integration of data across the organization.
Information Resources Management March 13, Agenda n Administrivia n Normalization n Homework #7 n Mid-Term #2.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 4: Logical Database Design and the Relational Model
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 5: Logical Database Design and the Relational Model
TM 6-1 Copyright © Addison Wesley Longman, Inc. & Dr. Chen, Business Database Systems Logical Database Design and the Relational Database Professor Chen.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: Logical Database Design and the Relational Model Modern Database Management 10.
Chapter 4: Logical Database Design and the Relational Model (Part II)
Week 6 Lecture Normalization
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
Concepts and Terminology Introduction to Database.
Improving the Quality of Database Designs (Adapted from David Kroenke, Dabase Processing)
Chapter 5: Logical Database Design and the Relational Model
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.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Chapter 5 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
© 2005 by Prentice Hall 1 The Database Development Process Dr. Emad M. Alsukhni The Database Development Process Dr. Emad M. Alsukhni Modern Database Management.
Pree Thiengburanathum, CAMT, Chiang Mai University 1 Database System Logical Database Design and the Relational Model November 1 st, 2009 Software Park,
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Logical Database Design and the Relational Model.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part c): Logical Database Design and the Relational Model Modern Database Management.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Normalization Hour1,2 Presented & Modified by Mahmoud Rafeek Alfarra.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: LOGICAL DATABASE.
Chapter 5 MODULE 6: Normalization © 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Prepared by: KIM GASTHIN M. CALIMQUIM.
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 4, Part A: Logical Database Design and the Relational Model
Lecture 4: Logical Database Design and the Relational Model 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
Chapter 4 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 4: Logical Database Design and the Relational Model Modern Database Management.
Copyright © 2016 Pearson Education, Inc. CHAPTER 7: ADVANCED SQL (PART I) Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki.
Lecture # 17 Chapter # 10 Normalization Database Systems.
N ORMALIZATION 1. Chapter 5 R ELATION Definition: A relation is a named, two-dimensional table of data Table consists of rows (records) and columns (attribute.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 4 Logical Database Design and the Relational Model
Normalization Karolina muszyńska
Modern Database Management Jeff Hoffer, Ramesh Venkataraman,
Chapter 5: Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Example Question–Is this relation Well Structured? Student
Unit 4: Normalization of Relations
Relational Database.
Chapter 5: Logical Database Design and the Relational Model
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Presentation transcript:

Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-2 DATA NORMALIZATION  Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of data  The process of decomposing relations with anomalies to produce smaller, well-structured relations

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-3 FUNCTIONAL DEPENDENCIES  Functional Dependency: The value of one set of attributes (the determinant) determines the value of another attribute.  X functionally determines Y: X  Y, where X is called a determinant.  Problem 4-33 (Fig. 4-33), p.195,

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-4 FIGURE 4-2 4

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-5 FIGURE

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-6 CANDIDATE KEYS  Candidate Key: Attribute or a set of attributes that uniquely identifies a row.  Each non-key field is functionally dependent on every candidate key  One of the candidate keys will become the primary key  E.g., perhaps there is both credit card number and SS# in a table…in this case both are candidate keys.  Primary vs. candidate key: Fig. 4-16, p.171 6

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-7 Figure 4.22 Steps in normalization 3 rd normal form is generally considered sufficient

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-8 FIRST NORMAL FORM  A relation is in 1NF if it contains no multivalued attributes; i.e., every attribute value is atomic.  Fig is not in 1 st Normal Form (multivalued attributes)  it is not a relation.  Fig is in 1 st Normal form.  All relations are in 1 st Normal Form. 8

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-9 ANOMALIES ANOMALIES IN EMPLOYEE2 (FIG. 4-2B)  Insertion–can’t enter a new employee without having the employee take a class (or at least empty fields of class information)  Deletion–if we remove employee 140, we lose information about the existence of a Tax Acc class  Modification–giving a salary increase to employee 100 forces us to update multiple records 9 Why do these anomalies exist? Because there are two themes (entity types) in this one relation. This results in data duplication and an unnecessary dependency between the entities.

Chapter 4 Copyright © 2016 Pearson Education, Inc SECOND NORMAL FORM A relation is in 2NF if it is in 1NF and every non-key attribute is fully functionally dependent on the primary key. No partial functional dependencies (i.e., every non-key attribute must be defined by the entire key, not by only part of the key). A B C D: A B  C, A  D. 2NF? Is Fig. 4-23b (p. 181) in 2NF? 10

Chapter 4 Copyright © 2016 Pearson Education, Inc SECOND NORMAL FORM (2NF)  A relation is in 2NF if  Primary key consists of a single attribute; or  Primary key consists of all attributes.  Fig. 4-2b  Fig Fig. 4-7

Chapter 4 Copyright © 2016 Pearson Education, Inc FIGURE

Chapter 4 Copyright © 2016 Pearson Education, Inc FIGURE

Chapter 4 Copyright © 2016 Pearson Education, Inc EMPLOYEE-COURSE RELATIONS IN 2NF EmpIDSalaryDeptNameNameCourseTitleDateCompletedEmpID Both are full functional dependencies

Chapter 4 Copyright © 2016 Pearson Education, Inc THIRD NORMAL FORM  A relation is in 3NF if it is in 2NF and no transitive dependencies exists, where a transitive dependency is a functional dependency between non-key attributes.  A B C D: A B  C, C  D. 2NF? 3NF?  Solution: Non-key determinant with transitive dependencies go into a new table; non-key determinant becomes primary key in the new table and stays as foreign key in the old table. 15

Chapter 4 Copyright © 2016 Pearson Education, Inc Relation with transitive dependency (a) SALES relation with simple data

Chapter 4 Copyright © 2016 Pearson Education, Inc Relation with transitive dependency CustID  Name CustID  Salesperson CustID  Region BUT Salesperson  Region Transitive dependency (not 3 rd NF)

Chapter 4 Copyright © 2016 Pearson Education, Inc Removing a transitive dependency (a) Decomposing the SALES relation

Chapter 4 Copyright © 2016 Pearson Education, Inc Relations in 3NF Now, there are no transitive dependencies… Both relations are in 3 rd NF CustID  Name CustID  Salesperson Salesperson  Region

Chapter 4 Copyright © 2016 Pearson Education, Inc Table with multivalued attributes, not in 1 st normal form Note: This is NOT a relation.

Chapter 4 Copyright © 2016 Pearson Education, Inc Table with no multivalued attributes and unique rows, in 1 st normal form Note: This is a relation, but not a well-structured one.

Chapter 4 Copyright © 2016 Pearson Education, Inc ANOMALIES IN THIS TABLE  Insertion–if new product is ordered for order 1007 of existing customer, customer data must be re-entered, causing duplication  Deletion–if we delete the Dining Table from Order 1006, we lose information concerning this item’s finish and price  Update–changing the price of product ID 4 requires update in multiple records Why do these anomalies exist? Because there are multiple themes (entity types) in one relation. This results in duplication and an unnecessary dependency between the entities.

Chapter 4 Copyright © 2016 Pearson Education, Inc OrderID  OrderDate, CustomerID, CustomerName, CustomerAddress Therefore, NOT in 2 nd Normal Form CustomerID  CustomerName, CustomerAddress ProductID  ProductDescription, ProductFinish, ProductStandardPrice OrderID, ProductID  OrderQuantity Figure 4-27 Functional dependency diagram for INVOICE

Chapter 4 Copyright © 2016 Pearson Education, Inc Partial dependencies are removed, but there are still transitive dependencies Getting it into Second Normal Form Figure 4-28 Removing partial dependencies

Chapter 4 Copyright © 2016 Pearson Education, Inc Transitive dependencies are removed. Figure 4-29 Removing partial dependencies Getting it into Third Normal Form

Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-26