Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.

Similar presentations


Presentation on theme: "DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter."— Presentation transcript:

1 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter Five: Data Modeling with the Entity-Relationship Model Part One A Database Processing: Fundamentals, Design, and Implementation

2 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-2 Three Schema Model ANSI/SPARC (1975) Data modeling framework describing its –role –purpose

3 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-3 Three Schema Model (cont.) External Schema Conceptual Schema Internal Schema

4 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-4 External Schema The User View Representation of how users view the database

5 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-5 Conceptual Schema –A logical view that describes All the data All relationships –Independent of the physical –Usually contains many different external schemas

6 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-6 Internal Schema Representation of Conceptual Schema –as physically stored on a particular product –many different internal schemas possible

7 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-7 E-R Model Set of concepts and graphical symbols Can be used to create schemas –Plans, or –Blueprints

8 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-8 Four Versions of the E-R Model Original E-R model Peter Chen (1976) Extended E-R model: most widely used model Information Engineering (IE) (1990) IDEF1X national standard (1993) Unified Modeling Language (UML) (1980s)

9 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-9 Elements of the E-R Model Entities Attributes Relationships

10 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-10 Entities – Something Users Want to Track Entity CLASS Entity INSTANCE Entity identifier –Nonunique –Unique(possible candidate key)

11 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-11 Entity Example An Entity Class Two Entity Instance s

12 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-12 Attribute – Properties That Describe an Entity’s Characteristics Composite attributes Single-valued attributes Multi-valued attributes Attribute domain Name fname mname lname Phone PERSON SSN

13 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-13 Entity Attribute Display in Data Models

14 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-14 Identifiers Are attributes that name, or identify, entity instances. May consist of one or more of the entity’s attributes. Composite identifiers: Have two or more attributes Are transformed –Entities have identifiers (data model). –Tables (or relations) have keys (physical implementation).

15 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-15 Entities and Tables Relationship Differences –Entities – No Foreign Keys –Tables – Foreign Keys required Early design process uncertainties –Existence of entities –Relationships between entities

16 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-16 Relationships – an Association Between Entities Degree – The number of entity classes in relationship –Binary –Ternary –Unary(recursive)

17 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-17 Binary Relationship

18 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-18 Ternary Relationship

19 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-19 UNARY STUDENT Roommate

20 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-20 Cardinality Cardinality means “count” Maximum cardinality Minimum cardinality

21 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-21 Maximum Cardinality The maximum number of entity instances that can participate in a relationship. Three types –One-to-One [1:1] –One-to-Many [1:N] –Many-to-Many [N:M]

22 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-22 The Three Types of Maximum Cardinality

23 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-23 Maximum Cardinality 1:M

24 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-24 Parent and Child Entities In a one-to-many relationship: –Parent entity on the one side (STATE) –Child entity on the many side (ALUMN) STATEALUMN Alumn_Location

25 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-25 HAS-A Relationships Maximum Cardinality An state has, possibly many alumns. An alumn may have a maximum of one assigned state. STATEALUMN Alumn_Location

26 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-26 Minimum Cardinality The minimum number of entity instances that must participate in a relationship. Minimums are generally stated as either zero or one: –Zero [0] (optional), no entity instance required –One [1] (mandatory), at least one entity instance required

27 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-27 Indicating Minimum Cardinality Zero [0] - place an oval next to the optional entity. One [1] - place a vertical hash mark next to the required entity.

28 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-28 Reading Minimum Cardinality An state is not required to be assigned an alumn. An alumn is required to be assigned to at least one state. STATEALUMN Alumn_Location

29 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-29 The Three Types of Minimum Cardinality

30 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-30 Write four cardinality statements that describe the following Binary Relationships. FACULTYCOMPUTER1:11:1 Computer_Assignment READING LEFT TO RIGHT A Faculty is required to have a minimum of zero (oval mark) Computers. A Faculty has a maximum of 1 (diamond) Computer.

31 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-31 Write four cardinality statements that describe the following Binary Relationships. FACULTYCOMPUTER1:11:1 Computer_Assignment READING RIGHT TO LEFT 3. A Computer is assigned to a maximum of 1 (diamond) Faculty. 4. A Computer is required to be assigned to a minimum of 1 (slash mark) faculty.

32 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-32 Degree =? Cardinalities of the Relationship? FACULTYCOMPUTER1:11:1 Is assigned The degree is two. READING LEFT TO RIGHT The maximum cardinality is 1:1. The minimum cardinality is optional-mandatory.

33 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-33 Write four cardinality statements that describe the following Binary Relationships. COORDINATOR FACULTY 1:M1:M supervises

34 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-34 Write four cardinality statements that describe the following Binary Relationships. STUDENT CLASS N:MN:M Enrolls in

35 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-35 Read Top to Bottom (same meaning as horizontal) FACULTY COORDINATOR 1:M1:M supervises

36 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-36 Data Modeling Notation (a) and (b) NOT Equivalent Statements

37 DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-37 David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Five Part One A


Download ppt "DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter."

Similar presentations


Ads by Google