Information Systems Analysis and Design csc340 XV The Entity Relationship Model The Entity Relationship Model Entities Relationships and Attributes Cardinalities Identifiers and Generalization Documentation of E R Diagrams and Business Rules 2002 John Mylopoulos The Entity Relationship Model 1 Information Systems Analysis and Design csc340 The Entity Relationship Model The Entity Relationship ER model is a conceptual data model capable of describing the data requirements for a new information system in a direct and easy to understand graphical notation Data requirements are described in terms of a conceptual or ER schema schema ER schemata are comparable to class diagrams 2002 John Mylopoulos The Entity Relationship Model 2 Information Systems Analysis and Design csc340 The Constructs of the E R Model AND XOR 2002 John Mylopoulos The Entity Relationship Model 3 Information Systems Analysis and Design csc340 Entities These represent classes of objects facts things people that have properties in common and an autonomous existence City Department Employee Purchase and Sale are examples of entities for a commercial organization An instance of an entity is an object in the class represented by the entity Stockholm Helsinki are examples of instances of the entity City and the employees Peterson and Johanson are examples of instances of the Employee entity The E R model is very different from the relational model in which it is not possible to represent an object without knowing its properties an employee is represented by a tuple containing the name surname age and other attributes 2002 John Mylopoulos The Entity Relationship Model 4 Information Systems Analysis and Design csc340 Examples of Entities 2002 John Mylopoulos The Entity Relationship Model 5 Information Systems Analysis and Design csc340 Relationships They represent logical links between two or more entities Residence is an example of a relationship that can exist between the entities City and Employee Exam is an example of a relationship that can exist between the entities Student and Course An instance of a relationship is an n tuple made up of instances of entities one for each of the entities involved The pair Johanssen Stockholm or the pair Peterson Oslo are examples of instances in the relationship Residence 2002 John Mylopoulos The Entity Relationship Model 6 Information Systems Analysis and Design csc340 Examples of Relationships 2002 John Mylopoulos The Entity Relationship Model 7 Information Systems Analysis and Design csc340 Example of Instances for Exam Exam 2002 John Mylopoulos The Entity Relationship Model 8 Information Systems Analysis and Design csc340 What Does An E R Diagram Really Mean Course Course Meets Room Room Course and Room are entities Their instances describe particular courses e g CSC340S and particular rooms e g WB116 Meets is a relationship Its instances describe particular meetings Each meeting has exactly one associated course and room Course Course instances instances Meets Meets instances instances 2002 John Mylopoulos Room Room instances instances The Entity Relationship Model 9 Information Systems Analysis and Design csc340 Recursive Relationships Recursive relationships are also possibl e that is relationships between an entity and itself Note in the second example that the relationship is not symmetric In this case it is necessary to indicate the two roles that the entity involved plays in the relationship 2002 John Mylopoulos The Entity Relationship Model 10 Information Systems Analysis and Design csc340 Ternary Relationships 2002 John Mylopoulos The Entity Relationship Model 11 Information Systems Analysis and Design csc340 AND XOR for Relationships Contains Contains Order Order XOR Requests Requests FilledBy FilledBy Order Order Service Service Shipment Shipment AND Generates Generates 2002 John Mylopoulos Part Part Invoice Invoice Orders either order a part or request a service but not both both For any given order whenever there is at least one invoice there is also at least one shipment and vice versa versa The Entity Relationship Model 12 Information Systems Analysis and Design Shipment Shipment Contains Contains FilledBy FilledBy AND AND Order Order FilledBy FilledBy Invoice Invoice Order Order Part Part XOR Requests Requests Generates Generates Invoice Invoice Shipment Shipment csc340 Contains Contains Requests Requests Generates Generates 2002 John Mylopoulos Service Service Part Part Service Service The Entity Relationship Model 13 Information Systems Analysis and Design csc340 Attributes These describe the elementary properties of entities or relationships For example Surname Salary and Age are possible attributes of the Employee entity while Date and Mark are possible attributes for the relationship Exam between Student and Course An attribute associates with each instance of an entity or relationship a value belonging to a set known as the domain of the attribute The domain contains the admissible values for the attribute 2002 John Mylopoulos The Entity Relationship Model 14 Information Systems Analysis and Design csc340 Attribute Examples 2002 John Mylopoulos The Entity Relationship Model 15 Information Systems Analysis and Design csc340 Composite Attributes It is sometimes convenient to group attributes of the same entity or relationship that have closely connected meanings or uses Such groupings are called composite attributes 2002 John Mylopoulos The Entity Relationship Model 16 Information Systems Analysis and Design csc340 Schema with Attributes 2002 John Mylopoulos The Entity Relationship Model 17 Information Systems Analysis and Design csc340 Cardinalities These are specified for each entity participating in a relationship and describe the maximum and minimum number of relationship occurrences in which an entity occurrence can participate Cardinalities state how many times can an entity instance participate in instances of a given relationship 2002 John Mylopoulos The Entity Relationship Model 18 Information Systems Analysis and Design csc340 Cardinalities cont d In principle a cardinality is any pair of non negative integers n m such that n m or a pair of the form n N where N means any number If minimum cardinality is 0 we say that entity participation in a relationship is optional If minimum cardinality is 1 we say that entity participation in a relationship is mandatory If maximum cardinality is 1 each instance of the entity is associated at most with a single
View Full Document
Unlocking...