database principles:database principles: fundamentals of ...pattarachai/db/pdf/ch07.pdf · database...

25
Database Principles: Database Principles: Fundamentals of Design, Implementation, and M t Management Tenth Edition Tenth Edition Chapter 7 Data Modeling with Entity Relationship Data Modeling with Entity Relationship Diagrams Objectives In this chapter, students will learn: The main characteristics of entity relationship components – How relationships between entities are defined, refined, and incorporated into the database refined, and incorporated into the database design process How ERD components affect database design How ERD components affect database design and implementation Th t l ldd t b d i ft i That real-world database design often requires the reconciliation of conflicting goals © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part. 2

Upload: others

Post on 08-Oct-2020

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Database Principles:Database Principles: Fundamentals of Design,

Implementation, and M tManagement

Tenth EditionTenth Edition

Chapter 7Data Modeling with Entity RelationshipData Modeling with Entity Relationship

Diagrams

Objectives

• In this chapter, students will learn:– The main characteristics of entity relationship

components

– How relationships between entities are defined, refined, and incorporated into the databaserefined, and incorporated into the database design process

How ERD components affect database design– How ERD components affect database design and implementation

Th t l ld d t b d i ft i– That real-world database design often requires the reconciliation of conflicting goals

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

2

Page 2: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

The Entity Relationship Model (ERM)

• ER model forms the basis of an ER diagram

• ERD represents conceptual database as viewed by end usery

• ERDs depict database’s main components:E titi– Entities

– Attributes

– Relationships

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

3

Entities

• Refers to entity set and not to single entity occurrence

• Corresponds to table and not to row in prelational environment

• In Chen and Crow’s Foot models entity is• In Chen and Crow s Foot models, entity is represented by rectangle with entity’s name

• The entity name, a noun, is written in capital letters

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

4

Page 3: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Attributes

• Characteristics of entities

• Chen notation: attributes represented by ovals connected to entity rectangle with a liney g– Each oval contains the name of attribute it

representsrepresents

• Crow’s Foot notation: attributes written in tt ib t b b l tit t lattribute box below entity rectangle

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

5

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

6

Page 4: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Attributes (cont’d.)

• Required attribute: must have a value

• Optional attribute: may be left empty

• Domain: set of possible values for an attributeDomain: set of possible values for an attribute– Attributes may share a domain

• Identifiers: one or more attributes that uniquely identify each entity instancey y

• Composite identifier: primary key composed of more than one attributemore than one attribute

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

7

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

8

Page 5: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Attributes (cont’d.)

• Composite attribute can be subdivided

• Simple attribute cannot be subdivided

• Single-value attribute can have only a singleSingle value attribute can have only a single value

M lti l d tt ib t h l• Multivalued attributes can have many values

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

9

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

10

Page 6: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Attributes (cont’d.)

• M:N relationships and multivalued attributes h ld t b i l t dshould not be implemented– Create several new attributes for each of the

original multivalued attributes’ components

– Create new entity composed of originalCreate new entity composed of original multivalued attributes’ components

Derived attribute: value may be calculated from• Derived attribute: value may be calculated from other attributes– Need not be physically stored within database

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

11

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

12

Page 7: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Relationships

• Association between entities

• Participants are entities that participate in a relationshipp

• Relationships between entities always operate in both directionsin both directions

• Relationship can be classified as 1:M

• Relationship classification is difficult to establish if only one side of the relationship is knownif only one side of the relationship is known

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

13

Connectivity and Cardinality

• Connectivity – Describes the relationship classification

• CardinalityCardinality – Expresses minimum and maximum number of

entity occurrences associated with oneentity occurrences associated with one occurrence of related entity

• Established by very concise statements known as business rules

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

14

Page 8: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

15

Existence Dependence

• Existence dependence– Entity exists in database only when it is

associated with another related entity occurrence

• Existence independenceExistence independence– Entity can exist apart from one or more related

entitiesentities

– Sometimes such an entity is referred to as a strong or regular entity

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

16

Page 9: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Relationship Strength

• Weak (non-identifying) relationships– Exists if PK of related entity does not contain PK

component of parent entity

• Strong (identifying) relationshipsExists when PK of related entity contains PK– Exists when PK of related entity contains PK component of parent entity

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

17

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

18

Page 10: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

19

Weak Entities

• Weak entity meets two conditions– Existence-dependent

– Primary key partially or totally derived from y y p y yparent entity in relationship

• Database designer determines whether an• Database designer determines whether an entity is weak based on business rules

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

20

Page 11: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

21

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

22

Page 12: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Relationship Participation

• Optional participation– One entity occurrence does not require

corresponding entity occurrence in particular relationship

• Mandatory participationMandatory participation– One entity occurrence requires corresponding

entity occurrence in particular relationshipentity occurrence in particular relationship

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

23

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

24

Page 13: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

25

Relationship Degree

• Indicates number of entities or participants i t d ith l ti hiassociated with a relationship

• Unary relationshipy p– Association is maintained within single entity

Binar relationship• Binary relationship – Two entities are associated

• Ternary relationship Three entities are associated– Three entities are associated

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

26

Page 14: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

27

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

28

Page 15: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Recursive Relationships

• Relationship can exist between occurrences of th tit tthe same entity set– Naturally found within unary relationshipy y

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

29

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

30

Page 16: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

31

Associative (Composite) Entities

• Also known as bridge entities

• Used to implement M:N relationships

• Composed of primary keys of each of theComposed of primary keys of each of the entities to be connected

M l t i dditi l tt ib t th t l• May also contain additional attributes that play no role in connective process

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

32

Page 17: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

33

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

34

Page 18: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Developing an ER Diagram

• Database design is an iterative process– Create detailed narrative of organization’sCreate detailed narrative of organization s

description of operations

Identify business rules based on description of– Identify business rules based on description of operations

– Identify main entities and relationships from business rules

– Develop initial ERD

– Identify attributes and primary keys that– Identify attributes and primary keys that adequately describe entities

R i d i ERD© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

– Revise and review ERD35

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

36

Page 19: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

37

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

38

Page 20: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

39

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

40

Page 21: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

41

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

42

Page 22: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

43

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

44

Page 23: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

45

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

46

Page 24: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Database Design Challenges:Database Design Challenges: Conflicting Goals

• Database designers must make design icompromises

– Conflicting goals: design standards, processing speed, information requirements

• Important to meet logical requirements andImportant to meet logical requirements and design conventions

D i i f littl l l it d li ll• Design is of little value unless it delivers all specified query and reporting requirements

• Some design and implementation problems do not yield “clean” solutions

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

not yield clean solutions47

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

48

Page 25: Database Principles:Database Principles: Fundamentals of ...pattarachai/DB/PDF/ch07.pdf · Database Principles:Database Principles: Fundamentals of Design, Implementation, and

Summary

• Entity relationship (ER) model – Uses ERD to represent conceptual database as

viewed by end user

– ERM’s main components:• EntitiesEntities

• Relationships

Att ib t• Attributes

– Includes connectivity and cardinality notations

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

49

Summary (cont’d.)

• Connectivities and cardinalities are based on b i lbusiness rules

• M:N relationship is valid at conceptual levelp p– Must be mapped to a set of 1:M relationships

ERDs ma be based on man different ERMs• ERDs may be based on many different ERMs

• UML class diagrams are used to represent the g pstatic data structures in a data model

• Database designers are often forced to make• Database designers are often forced to make design compromises

© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

50