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

Slides:



Advertisements
Similar presentations
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Advertisements

Chapter 5 Normalization of Database Tables
Chapter 3 : Relational Model
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity-Relationship Model
© 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 5-1 COS 346 Day 6.
Entity Relationship (E-R) Modeling
System Analysis - Data Modeling
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke Database Processing Tenth Edition Chapter 5 Data.
Chapter Five Data Modeling with the Entity-Relationship Model.
© 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke Database Processing Chapter 3 Normalization.
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 5-1 COS 346 Day 6.
Data Modeling Entity - Relationship Models. Models Used to represent unstructured problems A model is a representation of reality Logical models  show.
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.
Chapter 4 Entity Relationship (ER) Modeling
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.
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.
Modern Systems Analysis and Design Third Edition
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Chapter 3 The Relational Model and Normalization
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
(C) 2000, The University of Michigan 1 Database Application Design Handout #3 January 21, 2000.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Concepts and Terminology Introduction to Database.
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.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
© 2002 by Prentice Hall 1 Database Design David M. Kroenke Database Concepts 1e Chapter 5 5.
The Relational Model and Normalization R. Nakatsu.
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.
Chapter 3 The Entity-Relationship Model David M. Kroenke Database Processing © 2000 Prentice Hall.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
Chapter 4 The Semantic Object Model David M. Kroenke Database Processing © 2000 Prentice Hall.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
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.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
5. The Relational Model and Normalization 5.1 Relational Model5.2 Normalization 5.3 1NF to 5NF 5.4 Domain/Key Normalization 5.5 Synthesis of Relation 5.6.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
CSIS 115 Database Design and Applications for Business
Entity Relationship (E-R) Modeling
Normalization Karolina muszyńska
Chapter 5: Logical Database Design and the Relational Model
Chapter 9 Designing Databases
The Relational Model and Normalization
Relational Model and ER Model: in a Nutshell
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Database Processing: David M. Kroenke’s Chapter Three:
Chapter 4 Entity Relationship (ER) Modeling
Database Processing: David M. Kroenke’s Chapter Five:
© 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke
Presentation transcript:

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

© 2002 by Prentice Hall 2 David M. Kroenke Database Processing Eighth Edition Chapter 3 The Entity- Relationship Model

© 2002 by Prentice Hall 3 Data Modeling Process of creating a logical representation of the structure of the database The most important task in database development

© 2002 by Prentice Hall 4 Entity-Relationship Model (E-R Model) An Entity-Relationship Model (E-R Model) consists of: –Entities –Attributes –Identifiers –Relationships

© 2002 by Prentice Hall 5 An Entity An entity is an object that can be identified in the users’ work environment & that users want to track. Entities of a given type are grouped into entity classes.

© 2002 by Prentice Hall 6 An Entity Example

© 2002 by Prentice Hall 7 Attributes An attribute describes a characteristic of an entity For example –An entity: Employee –Has attributes: EmployeeName Extension DateOfHire

© 2002 by Prentice Hall 8 Identifier An identifier uniquely identifies a row in a table. For an Employee, the SocialSecurityNumber may serve as the Indentifier.

© 2002 by Prentice Hall 9 Relationships A relationship describes how one or more entities are related with each other.

© 2002 by Prentice Hall 10 Relationship Cardinality Entity-Instance Participation in relationships is shown by –maximum cardinality –minimum cardinality

© 2002 by Prentice Hall 11 Maximum Cardinality The maximum cardinality indicates/depicts the maximum number of instances involved in a relationship. Alternatives include –1:1 (one-to-one) –1:N (one-to-many) –N:M (many-to-many)

© 2002 by Prentice Hall 12 Relationship Examples Showing Maximum Cardinality Alternatives

© 2002 by Prentice Hall 13 Minimum Cardinality The minimum cardinality indicates/depicts whether participation in the relationship is mandatory or optional. Alternatives include –0 (optional) –1 (mandatory)

© 2002 by Prentice Hall 14 A Relationship Example Showing Minimum and Maximum Cardinality

© 2002 by Prentice Hall 15 A Recursive Relationship A recursive relationship is when an entity has a relationship with itself.

© 2002 by Prentice Hall 16 Entity-Relationship Diagram (E-R Diagram) An entity-relationship diagram (E-R Diagram) is a graphical representation of the E-R model using a set of ‘somewhat’ standardized conventions

© 2002 by Prentice Hall 17 An Entity-Relationship Diagram (E-R Diagram) Example

© 2002 by Prentice Hall 18 Weak Entity A weak entity is an entity whose instance survival depends (logically) on an associated instance in another entity

© 2002 by Prentice Hall 19 Subtype Entities Some entities may have many common attributes and a few unique attributes. The common attributes may be grouped together in a supertype entity and the unique attributes may be grouped together in a subtype entity.

© 2002 by Prentice Hall 20 CLIENT with Subtype Entities

© 2002 by Prentice Hall 21 E-R Diagram Computer Assisted Software Engineering (CASE) Tools Several Computer Assisted Software Engineering (CASE) Tools exist to help create E-R Diagrams and the resulting physical database elements. Products include: –IEW –IEF –DEFT –ER-WIN –Visio

© 2002 by Prentice Hall 22 E-R Diagram Example: Jefferson Dance Club

© 2002 by Prentice Hall 23 E-R Diagram Example: San Juan Charters

© 2002 by Prentice Hall 24 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization

© 2002 by Prentice Hall 25 The Relational Model Broad, flexible model Basis for almost all DBMS products E.F. Codd defined well-structured “normal forms” of relations, “normalization”

© 2002 by Prentice Hall 26 Components of the Relational Model Relation –A two-dimensional table consisting of rows and columns Tuples –The rows (or records) in a relation Attributes –The columns (or fields) in a relation

© 2002 by Prentice Hall 27 Terminology

© 2002 by Prentice Hall 28 Functional Dependency Functional dependencies are the relationships among the attributes within a relation. If attribute A functional depends on attribute B, then for every instance of B you will know the respective value of A.

© 2002 by Prentice Hall 29 Functional Dependency Notation Major is functionally dependent on SID SID  Major Grade is functionally dependent on the combination of SID and ClassID (SID, ClassID)  Grade

© 2002 by Prentice Hall 30 Functional Dependency – an Example EmployeeNumber  Name EmployeeNumber  Age EmployeeNumber  Sex

© 2002 by Prentice Hall 31 A Key A key is a group of one or more attributes that uniquely identifies a tuple

© 2002 by Prentice Hall 32 A Combination Key Sometimes more than one attribute will be required to uniquely identify a tuple. If a key consists of more than one attribute, it is called a combination (or composite) key.

© 2002 by Prentice Hall 33 Example of a Combination Key

© 2002 by Prentice Hall 34 Normalization Normalization is a process of evaluating and converting a relation to reduce modification anomalies Essentially, normalization detects and eliminates data redundancy

© 2002 by Prentice Hall 35 An Anomaly An anomaly is an undesirable consequence of a data modification.

© 2002 by Prentice Hall 36 Normal Forms Normal forms are state-classes of relations which identify the level of anomaly-avoidance

© 2002 by Prentice Hall 37 Normal Forms Levels 1NF –First Normal Form 2NF –Second Normal Form 3NF –Third Normal Form BCNF –Boyce-Codd Normal Form 4NF –Fourth Normal Form 5NF –Fifth Normal Form DK/NF –Domain/Key Normal Form

© 2002 by Prentice Hall 38 First Normal Form (1NF) To be in First Normal Form (1NF) a relation must have only single-valued attributes -- neither repeating groups nor arrays are permitted

© 2002 by Prentice Hall 39 Second Normal Form (2NF) To be in Second Normal Form (2NF) the relation must be in 1NF and each nonkey attribute must be dependent on the whole key (not a subset of the key)

© 2002 by Prentice Hall 40 Third Normal Form (3NF) To be in Third Normal Form (3NF) the relation must be in 2NF and no transitive dependencies may exist within the relation. A transitive dependency is when an attribute is indirectly functionally dependent on the key (that is, the dependency is through another nonkey attribute)

© 2002 by Prentice Hall 41 Violation of 3NF

© 2002 by Prentice Hall 42 Boyce-Codd Normal Form (BCNF) To be in Boyce-Codd Normal Form (BCNF) the relation must be in 3NF and every determinant must be a candidate key.

© 2002 by Prentice Hall 43 Fourth Normal Form (4NF) To be in Fourth Normal Form (4NF) the relation must be in BCNF and the relation may not contain multi-valued dependencies.

© 2002 by Prentice Hall 44 Fifth Normal Form (5NF) The Fifth Normal Form concerns dependencies that are obscure and beyond the scope of this text.

© 2002 by Prentice Hall 45 Domain/Key Normal Form (DK/NF) To be in Domain/Key Normal Form (DK/NF) every constraint on the relation must be a logical consequence of the definition of keys and domains.

© 2002 by Prentice Hall 46 DK/NF Terminology Constraint –A rule governing static values of attributes Key –A unique identifier of a tuple Domain –A description of an attribute’s allowable values

© 2002 by Prentice Hall 47  DK/NF Example Domain/Key Definition of Example Above 

© 2002 by Prentice Hall 48 DK/NF Example

© 2002 by Prentice Hall 49 DK/NF Example

© 2002 by Prentice Hall 50 Summary of Normal Forms

© 2002 by Prentice Hall 51 Synthesis of Relations A  B and B  Aone-to-one A  B but B not  Amany-to-one A not  B and B not  Amany-to-many

© 2002 by Prentice Hall 52 Summary of Attribute Relationships

© 2002 by Prentice Hall 53 Optimization De-Normalization (a.k.a., Controlled Redundancy)