1 web-enabled decision support systems entity-relationship modeling prof. name [email protected]...

73
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name [email protected] Position (123) 456-7890 University Name

Upload: anabel-mosley

Post on 28-Jan-2016

232 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

1

Web-Enabled Decision Support Systems

Entity-Relationship Modeling

Prof. Name [email protected] (123) 456-7890University Name

Page 2: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

2

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 3: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

3

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 4: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

4

Introduction

A data model is an integrated collection of concepts that represents real world objects, events, and their relationships– There are two types of data models:

Object-based data models Relation-based data models

– In database design, we develop an object-based model first Entity-relationship model Functional model Object-oriented model

– Then systematically convert the model into a relation-based model More suitable for database implementation

Page 5: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

5

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 6: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

6

The Entity-Relationship Model

An entity-relationship model describes data in terms of the following:– Entities

– Relationship between entities

– Attributes of entities

We graphically display an E-R model using an entity-relationship diagram (E-R diagram)

Page 7: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

7

Entity-Relationship Diagram

Example of an E-R Diagram

Page 8: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

8

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 9: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

9

Entity

An entity is an object that exists and which is distinguishable from other objects – Can be a person, a place, an object, an event, or a concept

– Examples: Person: Student, Employee, Client Object: Couch, Airplane, Machine Place: City, Park, Room, Warehouse Event: War, Marriage, Lease Concept: Project, Account, Course

Entity Representation in an E-R Diagram

Page 10: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

10

Entity (cont.)

An entity type defines a collection of entities that have the same attributes

An entity instance is a single item in this collection

An entity set is a set of entity instances

Example:– Entity type: STUDENT

– Entity instance: Student with ID number 555-55-5555

– Entity set: Collection of all students

Page 11: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

11

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 12: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

12

Attributes

An attribute is a property or characteristic of an entity type– We represent an entity with a set of attributes

– Examples: STUDENT = {Student ID, SSN, Name, Address, Phone, Email, DOB} ORDER = {Order ID, Date of Order, Amount of Order} ACCOUNT = {Account Nr, Account type, Balance} CITY = {Name, State, Population}

– Attributes Types: Simple, composite, single-valued, multi-valued, stored, and derived

Page 13: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

13

Attributes in E-R Diagram

Attributes of the STUDENT Entity Type

Page 14: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

14

Simple and Composite Attributes

A simple or an atomic attribute cannot be further divided into smaller components– Examples:

City State

A composite attribute, however, can be divided into smaller subparts where each subpart represents an independent attribute– Examples:

Name: First Name, Last Name Address: Street, City, State, Zip

Page 15: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

15

Single-Valued and Multi-Valued Attributes

Single-valued attributes have a single value for an entity instance– Examples:

Major Date Of Birth

Multi-valued attributes, on the other hand, may have more than one value for an entity instance– Denoted with a double-lined ellipse

– Example: Languages: Stores the names of the languages that a student speaks

Page 16: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

16

Stored and Derived Attributes

The value of a derived attribute can be determined by analyzing other attributes– Therefore, no need to store them in the database

– Denoted with a dashed ellipse

– Example: Age: Can derived from the current date and the attribute DateOfBirth

An attribute whose value cannot be derived from the values of other attributes is called a stored attribute

Page 17: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

17

Key Attribute

A key attribute (or identifier) is a single attribute or a combination of attributes that uniquely identify an individual instance of an entity type– Underlined in an E-R diagram

– Example: Student: StudentID

The Key Attribute

Page 18: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

18

Candidate Key Attribute

Sometimes no single attribute can uniquely identify an instance of an entity type

A composite key is a composite attribute that uniquely identifies each entity instance

– Example: City: {Name, State}

The Composite Key Attribute

Page 19: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

19

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 20: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

20

Relationships

A relationship is an association among several entities

Examples:– STUDENT “takes” COURSES

– CUSTOMER “has” ACCOUNT

Represented by diamond shaped box connected to relating entities

Relationship between CUSTOMER and ACCOUNT Entities

Page 21: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

21

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 22: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

22

Degree of a Relationship

The number of entity sets that participate in a relationship is called the degree of relationship

Three common degrees in a database: – Unary (degree 1)

An association between two instances of the same entity type R є E1 x E1

– Binary (degree 2) An association between two instances of two different types R є E1 x E2

– Ternary (degree 3) An association between three instances of three different types R є E1 x E2 x E3

Page 23: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

23

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 24: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

24

Cardinality of a Relationship

Maximum cardinality represents the maximum number of instances of entity B that can be associated with any instance of entity A

The Four Types of Relationships between Entity Types

Page 25: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

25

Maximum Cardinality

Relationship types by maximum cardinality:– One-to-One

– One-to-Many (and vice-versa)

– Many-to-Many

Relationship Types Based on Maximum Cardinality

One Many

Page 26: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

26

Minimum Cardinality

The minimum cardinality of a relationship is defined as the minimum number of instances of entity B that must be associated with each instance of entity A

Relationship Types Based on Minimum Cardinality

Optional

Mandatory

Page 27: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

27

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 28: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

28

Unary Relationships - Examples

One-to-One

One-to-One

Many-to-Many

Page 29: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

29

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 30: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

30

Binary Relationships - Examples

One-to-One

One-to-Many

Many-to-Many

Page 31: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

31

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 32: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

32

Ternary Relationships - Examples

Musical PerformanceExample

Student “Uses” Equipment for a Project Example

Page 33: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

33

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 34: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

34

Attributes of Relationships

An attribute on a relationship stores information related to the relationship – Much like attributes on entity types

Example of an Attribute of a Relationship

RelationshipAttribute

Page 35: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

35

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 36: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

36

Associative Entities

An associative entity is an entity type that connects the instances of one or more entity types and contains attributes particular to this association – Allows us to store data from relationship attributes more effectively

Relationship meets one of the following conditions: – It is a many-to-many binary relationship

– It is a ternary relationship or a relationship of an even higher degree

Page 37: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

37

Associative Entities – Example 1

Many-to-Many Binary Relationship

Many-to-Many Binary Relationship Converted to an Associated Entity

Page 38: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

38

Associative Entities – Example 2

Ternary Relationship

Ternary Relationship Converted to an Associated Entity

Page 39: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

39

Overview – Part 1

3.1 Introduction 3.2 The Entity-Relationship Model 3.3 Entity 3.4 Attributes 3.5 Relationships 3.6 Degree of a Relationship 3.7 Cardinality of a Relationship 3.8 Unary Relationship 3.9 Binary Relationship 3.10 Ternary Relationships 3.11 Attributes of Relationships 3.12 Associative Entities 3.13 Weak Entity Types

Page 40: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

40

Weak Entity Types

A strong entity type exists independent of other entity types

A weak entity type depends on another entity type

Entity type depends on the identifying owner

Weak Entity in an E-R Diagram

WeakEntity

Page 41: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

41

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 42: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

42

Enhanced E-R Modeling

Enhanced Entity Relationships (EER) is the enhanced version of the original E-R model designed to cope-up with demand of complex database requirements by applications like Multimedia, GIS, and CAD

New modeling constructs incorporated into EER: – Superclass

– Subclass

EER also introduces two processes:– Specialization

– Generalization

Page 43: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

43

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 44: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

44

Entity Attributes

All the instances of an entity type share the same set of attributes, but each single attribute may not be a required attribute for each instance

Example:– Class, GPA not required for PERSON instances that are faculty

E-R Diagram for Entity Type PERSON

Page 45: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

45

Superclass and Subclass

A superclass is an entity type that has one or more distinct subgroups with unique attributes

A subclass is an entity type that shares common attributes or relationships distinct from other subclasses

Notations for Superclass and Subclass Relationships

Page 46: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

46

Superclass and Subclass - Example

Enhanced E-R Diagram for Entity Type PERSON

Page 47: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

47

Superclass and Subclass Relationships

The entity in a subclass is the same entity in the superclass except it has a distinct role

Relationship between superclass and subclass is one-to-one

Every instance in a subclass is a member of superclass and shares its attributes– Attribute inheritance is the property by which subclass entities inherit

attributes of the superclass

Each subclass has attributes and relationships that make it unique

Page 48: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

48

Superclass and Subclass Relationships Example

University Example of Superclass/Subclass Relationships

Page 49: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

49

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 50: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

50

Generalization and Specialization

Specialization and generalization are two processes that help recognize possibilities enabled by superclass/subclass models in the real world

Serve as conceptual models for development of superclass/subclass relationships

Generalization is the process of defining general entity types from a set of specialized entity types by identifying their common characteristics

Specialization is the process of defining one or more subclasses of a superclass by identifying its distinguishing characteristics

Page 51: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

51

Generalization - Example

Entities Before Generalization

Superclass and Subclass EntitiesAfter Generalization

Page 52: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

52

Specialization - Example

Entities Before Specialization

Superclass and Subclass EntitiesAfter Specialization

Page 53: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

53

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 54: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

54

Participation and Disjoint Constraints

Constraints are intuitive and help us manifest business rules and incorporate them into the design of an EER

Participation constraints dictate whether each instance (member) of a superclass must participate as an instance (member) of a subclass – Participation types:

Total participation Partial participation

Disjoint constraints define whether it is possible for an instance of a superclass to simultaneously be a member of one or more subclasses – Rule types::

Disjoint rule Overlap rule

Page 55: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

55

Total Participation Rule

In total participation, each instance of a superclass must be an instance of at least one subclass– Membership is mandatory

DoubleLine

Example of the Total Participation Rule

Page 56: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

56

Partial Participation Rule

In partial participation, an instance of a superclass does not have to be an instance of any of the subclasses– Membership is optional

Page 57: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

57

Disjoint Rule

The disjoint rule states that if an instance of a superclass is a member of any subclass, then it cannot be a member of more than one subtype

‘D’ = Disjoint

Example of the Disjoint Rule

Page 58: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

58

Overlap Rule

The overlap rule states that if an instance of a superclass is a member of any subclass, then it can be a member of more than one subtype

Example of the Overlap Rule

‘O’ = Overlap

Page 59: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

59

Constraints

Participation Constraints

Total Participation Rule

Partial Participation Rule

Disjoint Constraints

Disjoint Rule

Overlap Rule

Page 60: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

60

Subclass Discriminators

A subclass discriminator is an attribute of a superclass that discriminates a new entry to the superclass into the appropriate subclass

StudentType Subclass Discriminator

Discriminator

Page 61: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

61

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 62: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

62

Superclass/Subclass Hierarchy

A superclass/subclass hierarchy is a hierarchical structure of a superclass and its various subclasses in which each subclass has exactly one superclass

University Example of Superclass/SubclassHierarchy

Page 63: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

63

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 64: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

64

Case Study

EER Diagram for the University Database

Page 65: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

65

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 66: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

66

In-Class Assignment

Draw an E-R diagram representing the following information for the annual Bolder Boulder 10 km race:– Date

– Total number of runners registered (on-line pre-registration is possible)

– Actual number of participants

– Number of: Male runners, female runners

– Name of: Male winner, female winner Male masters winner, female masters winner

– Participant information: Social security number, name, birth date, gender, address, age, and certified

personal record (PR) running times for a 10 km race

Page 67: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

67

Overview – Part 2

3.14 Enhanced Entity-Relationship Modeling 3.15 Superclass, Subclass, and Relationships 3.16 Generalization and Specialization Process 3.17 Participation and Disjoint Constraints 3.18 Superclass/Subclass Hierarchy 3.19 Case Study: Conceptual Design for University Database 3.20 In-Class Assignment 3.21 Summary

Page 68: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

68

Summary

An entity type defines a collection of entities that have the same attributes. – An entity instance is a single item in this collection.– An entity set is a set of entity instances.

An attribute is a property of an entity type that is of interest to an organization.

Single-valued attributes have a single value for an entity instance. – A multi-valued attribute can take more than one value for an entity instance.

A derived attribute is one whose value can be derived from other attributes.

A key attribute is an attribute or a combination of several attributes that uniquely identify an individual instance of an entity type.

Page 69: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

69

Summary (cont.)

The degree of the relationship is the number of entity sets that participate in a relationship.– A unary relationship R is an association between two instances of the same

entity types.

– A binary relationship R is an association between two instances of two different entity types.

– A ternary relationship R is an association between three instances of three different entity types.

The maximum cardinality represents the maximum number of instances of any entity B that can be associated with any instance of any entity A.

The minimum cardinality is the minimum number of instances of entity B that must be associated with each instance of entity A.

Page 70: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

70

Summary (cont.)

An associative entity associates the instances of one or more entity types and contains attributes particular to this association.

A strong entity type exists independent of other entity types.

A weak entity type’s existence depends on another entity type.

The Enhanced Entity Relationships (EER) model is a revised E-R model that extends the original E-R model and supports additional semantic concepts by providing new modeling constructs.

Page 71: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

71

Summary (cont.)

A superclass is an entity type that has one or more distinct sub groups with unique attributes. – The subgroups should be of importance to the organization and are therefore

necessarily represented in a data model.

A subclass is an entity type that shares common attributes or relationships distinct from other subclasses.

Attribute inheritance is the property by which subclass entities inherit values for all attributes of the superclass.

Generalization is the process of defining a general entity type from a set of specialized entity types by identifying their common characteristics.

Specialization is a process of defining one or more subclasses of a superclass by identifying their distinguishing characteristics.

Page 72: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

72

Summary (cont.)

Participation constraints dictate whether every instance of a superclass must participate as an instance of a subclass. – If it is mandatory for a superclass instance to be a member of at least one

subclass, it is known as the total participation rule.

– When some instances of a superclass are free to not participate in any of the subclasses, it is referred to as the partial participation rule.

Disjoint constraints dictate whether it is possible for an instance of a superclass to be a member of one or more subclasses simultaneously. – The disjoint rule states that if the instance of superclass is a member of a

subclass, then it must belong to exactly one subclass.

– The overlap rule states that members of a subclass can belong to more than one subclass.

Page 73: 1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name name@email.com Position (123) 456-7890 University Name

73

Summary (cont.)

A subclass discriminator is an attribute of a superclass that classifies its instance into the appropriate subclass. – The value of a discriminator determines the target subclass for an instance of

a superclass.

A superclass/subclass hierarchy is a hierarchical structure of a superclass and subclasses wherein each subclass has exactly one superclass.