E VEN M ORE N ORMALIZATION DBS201. Agenda: 1.Foreign Keys 2.FK Example: Customer and Sales Rep 3. Three ways to detect a Foreign Key 4. Normalization.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Advanced Data Modeling
1 Logical Database Design and the Relational Model Modern Database Management.
L ECTURE 11 – D ATA M ODELLING Data Dictionaries Entity Relationship Diagram for Data Modelling Steps to Construct Entity Relationship Diagrams Validation.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Logical Data Modeling Review Lecture for University of Agder, Grimstad DAT202 Databaser (5.5.11) Judith Molka-Danielsen
Systems Development Life Cycle
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
© 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.
Concepts of Database Management Sixth Edition
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
© 2008 Prentice Hall Business Publishing Accounting Information Systems, 11/e Romney/Steinbart1 of 121 C HAPTER 16 Implementing an REA Model in a Relational.
1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology.
CS263:Revision on Normalisation
The Relational Database Model:
Concepts of Database Management Seventh Edition
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Practical tips for creating entity relationship diagrams (ERDs) Chitu Okoli Associate Professor in Business Technology Management John Molson School of.
File and Database Design SYS364. Today’s Agenda WHTSA DBMS, RDBMS, SQL A place for everything and everything in its place. Entity Relationship Diagrams.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
IT354 Database Design Seminar 5: May 19, 2011 Physical Database Design Entity-Relationship Diagrams.
Chapter 5: Logical Database Design and the Relational Model
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
1 A Guide to MySQL 2 Database Design Fundamentals.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Data Models and Relational Databases Chapter 2. Learning Objectives Identify primary and foreign keys for each entity and relevant relationships in the.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Logical Database Design and the Relational Model.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
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.
Introduction Data Modeling and Relational Database Design.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
1 6 Concepts of Database Management, 5 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology Spring 2006.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Microsoft Access 2010 Chapter 11 Database Design.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
Microsoft Access CS 110 Fall Entity Relationship Model Entities Entities Principal data object about which information is to be collectedPrincipal.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
SEEM3430: Information Systems Analysis and Design
Chapter 9 Designing Databases
Relational Model and ER Model: in a Nutshell
Entity relationship diagrams
Presentation transcript:

E VEN M ORE N ORMALIZATION DBS201

Agenda: 1.Foreign Keys 2.FK Example: Customer and Sales Rep 3. Three ways to detect a Foreign Key 4. Normalization Example 5. A first-look at Merging Relations

Foreign Keys Support “1-to-Many” Relationships Foreign Keys Are Used to Look Up Information in another relation

Example

Three ways to detect a Foreign Key 1. A FK occurs when removing a transitive relation from a 2NF relation. 2. Look at an ERD diagram. Every time there is a 1:M relationship and relational integrity is enforced, it means there is a FK. The Foreign Key is on the relation which is on the Many side of the One-to-Many relationship. 3. Examine all tables in the 3NF solution. If the Primary Key of a relation is present in a second relation, then that attribute in the second relation is a Foreign Key. * Foreign keys can be made of attributes that are part of the PK as well as non-key attributes.

Normalization Example: Part#Part_Name Qty used Supplier NameSupplier PhoneModel Description Unit Price PF123Paper spool 2 ABC Plastics Laserjet Printer$ LC432Laserject cartridge 4 Jetson Carbons Laserjet Printer$ MT123120v power unit 1 ACME Power Supply Laserjet Printer$ PF123Paper spool 1 ABC Plastics Colour Printer$89.99 IJ345Ink jet tray 3 Para Inks Colour Printer$67.00 MT123120v power unit 1 ACME Power Supply Colour Printer$ ABC PRINTER COMPANY

Normalization Example: Part#Part_Name Qty used Supplier NameSupplier PhoneModel Description Unit Price PF123Paper spool 2 ABC Plastics Laserjet Printer$ LC432Laserject cartridge 4 Jetson Carbons Laserjet Printer$ MT123120v power unit 1 ACME Power Supply Laserjet Printer$ PF123Paper spool 1 ABC Plastics Colour Printer$89.99 IJ345Ink jet tray 3 Para Inks Colour Printer$67.00 MT123120v power unit 1 ACME Power Supply Colour Printer$ ABC PRINTER COMPANY UNF:[ model#, modelDesc, (part#, part_name, qty, suppName, suppPhone, unitPrice) ]

Normalization Example: Part#Part_Name Qty used Supplier NameSupplier PhoneModel Description Unit Price PF123Paper spool 2 ABC Plastics Laserjet Printer$ LC432Laserject cartridge 4 Jetson Carbons Laserjet Printer$ MT123120v power unit 1 ACME Power Supply Laserjet Printer$ PF123Paper spool 1 ABC Plastics Colour Printer$89.99 IJ345Ink jet tray 3 Para Inks Colour Printer$67.00 MT123120v power unit 1 ACME Power Supply Colour Printer$ ABC PRINTER COMPANY UNF:[ model#, modelDesc, (part#, part_name, qty, suppName, suppPhone, unitPrice) ] 1NF: MODEL [ model#, modelDesc ] MODEL_PART [ model#, part#, part_name, qty, suppName, suppPhone, unitPrice) ]

Normalization Example: Part#Part_Name Qty used Supplier NameSupplier PhoneModel Description Unit Price PF123Paper spool 2 ABC Plastics Laserjet Printer$ LC432Laserject cartridge 4 Jetson Carbons Laserjet Printer$ MT123120v power unit 1 ACME Power Supply Laserjet Printer$ PF123Paper spool 1 ABC Plastics Colour Printer$89.99 IJ345Ink jet tray 3 Para Inks Colour Printer$67.00 MT123120v power unit 1 ACME Power Supply Colour Printer$ ABC PRINTER COMPANY UNF:[ model#, modelDesc, (part#, part_name, qty, suppName, suppPhone, unitPrice) ] 1NF: MODEL [ model#, modelDesc ] MODEL_PART [ model#, part#, part_name, qty, suppName, suppPhone, unitPrice) ] 2NF: MODEL [ model#, modelDesc ] PART [ part#, part_name, unitPrice ] MODEL_PART [ model#, part#, qty, suppName, suppPhone ]

Normalization Example: Part#Part_Name Qty used Supplier NameSupplier PhoneModel Description Unit Price PF123Paper spool 2 ABC Plastics Laserjet Printer$ LC432Laserject cartridge 4 Jetson Carbons Laserjet Printer$ MT123120v power unit 1 ACME Power Supply Laserjet Printer$ PF123Paper spool 1 ABC Plastics Colour Printer$89.99 IJ345Ink jet tray 3 Para Inks Colour Printer$67.00 MT123120v power unit 1 ACME Power Supply Colour Printer$ ABC PRINTER COMPANY UNF:[ model#, modelDesc, (part#, part_name, qty, suppName, suppPhone, unitPrice) ] 1NF: MODEL [ model#, modelDesc ] MODEL_PART [ model#, part#, part_name, qty, suppName, suppPhone, unitPrice) ] 2NF: MODEL [ model#, modelDesc ] PART [ part#, part_name, unitPrice] MODEL_PART [ model#, part#, qty, unitPrice, suppName, suppPhone ] 3NF: MODEL [ model#, modelDesc ] PART [ part#, part_name, unitPrice ] MODEL_PART [model# (FK1), part# (FK2), sup#,(FK3), qty ] SUPPLIER [ supp#, suppName, suppPhone ]

NORMALIZATION - Merging Relations Understanding how to merge relations is important for three reasons: 1. On large projects, the work of several sub-teams comes together during logical design, so there is often a need to merge relations. 2. Integrating existing databases with new information requirements often leads to the need to integrate different views. 3. New data requirements may arise during the life cycle, so there is a need to merge any new relations with what has already been developed.

Merging Relations (view integration) a. As part of the logical design process, normalized relations may have been created from a number of separate ERDs and possibly other user views. There may be bottom-up or parallel database development activities for different areas of the organization as well as top-down ones. b. The result is that some of the relations generated from these various processes may be redundant; that is, they may refer to the same entities. In such cases, we should merge those relations to remove the redundancy.

Some Terms to Remember Synonym - two (or more) attributes that have different names but the same meaning (alias) Homonym - an attribute that may have more than one meaning Transitive Dependency - When two 3NF relations are merged to form a single relation, transitive dependencies may result. Enterprise Key - a primary key whose value is unique across all relations 1. Makes a primary key more like what (in object-oriented databases) is called an object identifier 2. Should be a surrogate key (where the primary key of a relation is a value internal to the database system and has no business meaning). Multiple Entity Sets --> Final Entity Set

Merging Relations (View Integration)