(C) 2000, The University of Michigan 1 Database Application Design Handout #3 January 21, 2000.

Slides:



Advertisements
Similar presentations
© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
Advertisements

(wrapping up from last week)
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Chapter 8 Normalization. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies.
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 10.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 8.
Chapter Five Data Modeling with the Entity-Relationship 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.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
Chapter Five Data Modeling with the Entity-Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 3 The Relational Model and Normalization
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall 5-1 Chapter Objectives Learn how to transform E-R data models into relational.
Concepts and Terminology Introduction to Database.
(C) 2000, The University of Michigan 1 Database Application Design Handout #4 January 28, 2000.
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
IT420: Database Management and Organization Normalization 31 January 2006 Adina Crăiniceanu
© 2002 by Prentice Hall 1 Database Design David M. Kroenke Database Concepts 1e Chapter 5 5.
Chapter 4 The Relational Model and Normalization.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
The Relational Model and Normalization R. Nakatsu.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
The Relational Model and Normalization The Relational Model Normalization First Through Fifth Normal Forms Domain/Key Normal Form The Synthesis of Relations.
(C) 2000, The University of Michigan 1 Database Application Design Handout #10 March 17, 2000.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
The Entity-Relationship 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.
Database Design – Lecture 8
Chapter 3 The Entity-Relationship Model David M. Kroenke Database Processing © 2000 Prentice Hall.
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
(C) 2000, The University of Michigan 1 Database Application Design Handout #5 February 4, 2000.
Data Analysis Improving Database Design. Normalization The process of transforming a data model into a flexible, stable structure. Reduces anomalies Anomaly.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
(C) 2000, The University of Michigan 1 Database Application Design Handout #2 January 14, 2000.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
Lecture 4: Logical Database Design and the Relational Model 1.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Logical Design & the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Payroll Management System
CMPE 226 Database Systems February 21 Class Meeting
The Relational Model and Normalization
Relational Database.
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Normalization.
Chapter 4 The Relational Model and Normalization
Presentation transcript:

(C) 2000, The University of Michigan 1 Database Application Design Handout #3 January 21, 2000

(C) 2000, The University of Michigan 2 Course information Instructor: Dragomir R. Radev Office: 305A, West Hall Phone: Office hours: Thursdays 3-4 and Fridays 1-2 Course page: Meeting time: Fridays, 2:30 - 5:30 PM, 311 WH

(C) 2000, The University of Michigan 3 The entity-relationship model (cont’d)

(C) 2000, The University of Michigan 4 Recursive relationships DORMITORY 1:N ROOMS-WITH O O

(C) 2000, The University of Michigan 5 Showing properties Properties can be related to entities or to relationships. Example…

(C) 2000, The University of Michigan 6 Weak and strong entities Weak entities: cannot exist in DB unless other entities exist. Employee vs. dependent. EMPLOYEE DEPENDENT 1:N EMPLOYEE-DEPENDENT |O

(C) 2000, The University of Michigan 7 ID-dependent entities Entity in which the identifier of one entity includes the identifier of another entity Example: BUILDING - APARTMENT Identifier of apartment is [BuildingName, ApartmentName] PRODUCT - VERSION, TITLE - EDITION NUMBER

(C) 2000, The University of Michigan 8 More on weak entities STUDENT - ADVISOR (?) Logical dependency. PATIENT - PRESCRIPTION (?) Not all entities that have a minimum cardinality of 1 in relationship to another entity are weak.

(C) 2000, The University of Michigan 9 Subtype entities CLIENT can be INDIVIDUAL-CLIENT, PARTNERSHIP-CLIENT, or CORPORATE-CLIENT Generalization hierarchies IS-A relationships

(C) 2000, The University of Michigan 10 IS-A relationships CLIENT INDIVIDUAL CLIENT PARTNERSHIP CLIENT CORPORATE CLIENT 1 

(C) 2000, The University of Michigan 11 Example E-R Diagram Example: engineering company that analyzes the construction and condition of houses and other buildings and facilities. Entities: Employee, Engineer, Truck, Service, Client, Certification Relationships: Truck-Assgn, Eng-Skill, Qual- Engineer, Client-Service, Service-Provider, Referred-By Properties: Fee

(C) 2000, The University of Michigan 12 Documentation of business rules DB schema: tables, relationships, domains, business rules - the first three can be inferred from the E-R model, but not the business rules. Different ways to enforce business rules (even manual). Still at design stage...

(C) 2000, The University of Michigan 13 Example 1 The Jefferson Dance Club (page 60) Entities? Relationships? What are some design choices??

(C) 2000, The University of Michigan 14 Example 1 (cont’d) Evaluating E-R Data Models Queries: –Who has taught which private lessons? –Which customers have taken a private lesson from Jack? –Who are the full-time teachers? –Which teachers are scheduled to attend the dance on Friday?

(C) 2000, The University of Michigan 15 Example 2 San Juan Sailboat Charters How to select entities? Hint: look for nouns How to choose among alternatives?

(C) 2000, The University of Michigan 16 The relational model and normalization

(C) 2000, The University of Michigan 17 Background Abstraction Portability Ubiquity

(C) 2000, The University of Michigan 18 The relational model Relations (2-D tables) Tuples, attributes Functional dependencies Example: TotalPrice = ItemPrice x Quantity Notation: ID  Major Determinants: expressions on the LHS

(C) 2000, The University of Michigan 19 Groups of attributes as FD (ID, ClassName)  Grade Two cases: –If X  (Y,Z) then X  Y and X  Z –If (X,Y)  Z, nothing can be derived

(C) 2000, The University of Michigan 20 Keys Key: group of attributes that uniquely identifies a row. Example: (ID) vs (ID, Activity) FDs are determined by mental models of the users! Need to ask users! Determinants are not always unique. Keys are!

(C) 2000, The University of Michigan 21 Normalization Modification anomalies –deletion anomaly –insertion anomaly Splitting relations When can splitting a relation create problems? –E.g., student signing up for a non-existing activity –Referential integrity constraints

(C) 2000, The University of Michigan 22 Normal forms Codd (1970) - 1NF, 2NF, 3NF Boyce and Codd - BCNF later - 4NF and 5NF Not all anomalies are eliminated! Fagin (1981) - domain/key normal form (DK/NF)

(C) 2000, The University of Michigan 23 Relationship among normal forms 1NF 2NF 3NF BCNF 4NF 5NF

(C) 2000, The University of Michigan 24 First normal form (1NF) Relation Cells are of single value Repeating groups or arrays are not allowed as values Columns must have unique names Order of columns is insignificant No two rows may be exactly the same Order of rows is insignificant

(C) 2000, The University of Michigan 25 Second normal form (2NF) Key: (ID, Activity) Dependency: Activity  Fee Determinant (Activity) is only part of the key. Fee is partially dependent on the key of the table. Definition of 2NF: all nonkey attributes are dependent on all of the key! Of concern only in relations with composite keys!

(C) 2000, The University of Michigan 26 Readings for next time Kroenke –Chapter 5: The relational model and normalization –Chapter 6: Database design using Entity-Relationship models YRK (optional) –Chapter 3: Installation (MySQL preferred) –Chapter 4: MySQL or Chapter 5: mSQL –Chapter 6: SQL according to MySQL and mSQL