Unformatted text preview:

Information Systems Analysis and Design csc340 Information Systems Analysis and Design csc340 XVI The Entity Relationship Model The Entity Relationship Model The Entity Relationship Model Entities Relationships and Attributes Cardinalities Identifiers and Generalization Documentation of E R Diagrams and Business Rules 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 2004 John Mylopoulos The Entity Relationship Model 1 Information Systems Analysis and Design csc340 2004 John Mylopoulos The Entity Relationship Model 2 Information Systems Analysis and Design csc340 Entities Represent classes of objects facts things people that have properties in common and an autonomous existence e g City Department Employee Purchase and Sale An instance of an entity is an object in the class represented by the entity e g Stockholm Helsinki are examples of instances of the entity City 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 e g an employee is represented by a tuple containing the name surname age and other attributes The Constructs of the E R Model AND XOR 2004 John Mylopoulos The Entity Relationship Model 3 Information Systems Analysis and Design csc340 2004 John Mylopoulos The Entity Relationship Model 4 Information Systems Analysis and Design csc340 Relationships Examples of Entities They represent associations 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 of the relationship Residence Note The collection of instances of a relationship is by definition a set not a bag i e no duplicates 2004 John Mylopoulos The Entity Relationship Model 5 2004 John Mylopoulos The Entity Relationship Model 6 Information Systems Analysis and Design csc340 Information Systems Analysis and Design csc340 Example of Instances for Exam Examples of Relationships Exam Note A student can t take more than one exam for a particular course 2004 John Mylopoulos The Entity Relationship Model 7 Information Systems Analysis and Design csc340 2004 John Mylopoulos Information Systems Analysis and Design What Does A Diagram Really Mean Course Course Meets Meets Course Course instances instances Meets instances Meets instances Room Room Room Room instances instances Information Systems Analysis and Design csc340 Recursive Relationships 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 2004 John Mylopoulos The Entity Relationship Model 8 The Entity Relationship Model 9 csc340 Recursive relationships are also possible 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 2004 John Mylopoulos The Entity Relationship Model 10 Information Systems Analysis and Design Ternary Relationships csc340 AND XOR for Relationships Contains Order Order XOR Requests Requests FilledBy Order Order The Entity Relationship Model 11 2004 John Mylopoulos Service Service Shipment Shipment AND Generates Generates 2004 John Mylopoulos Part Part Invoice Invoice Orders either order order aa part or request a service but not both both For any given given order whenever there whenever there is at least least one one invoice there there is is also at least least one one shipment shipment and vice vice versa versa The Entity Relationship Model 12 Information Systems Analysis and Design Shipment Shipment Order Order Invoice Invoice FilledBy FilledBy Invoice Invoice Order Order Generates Generates Describe elementary properties of entities or relationships For example Surname Salary and Age are attributes of Employee while Date and Mark are attributes of relationship Exam between Student and Course An attribute associates with each instance of an entity or relationship one or more values belonging to its domain Attributes may be single valued or multi valued Service Service Contains Contains Part Part Requests Requests 2004 John Mylopoulos csc340 Attributes XOR Requests Requests Generates Generates Information Systems Analysis and Design Part Part Contains FilledBy AND Shipment Shipment csc340 Service Service The Entity Relationship Model 13 Information Systems Analysis and Design csc340 2004 John Mylopoulos The Entity Relationship Model 14 Information Systems Analysis and Design Attribute Examples 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 2004 John Mylopoulos The Entity Relationship Model 15 Information Systems Analysis and Design csc340 2004 John Mylopoulos The Entity Relationship Model 16 Information Systems Analysis and Design csc340 Cardinalities Schema with Attributes These are specified for each entity participating in a relationship and describe the maximum and minimum number of relationship instances that an entity instance can participate in 2004 John Mylopoulos The Entity Relationship Model 17 2004 John Mylopoulos The Entity Relationship Model 18 Information Systems Analysis and Design csc340 Information Systems Analysis and Design Cardinalities cont d csc340 Cardinality Examples 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 entity participation in a relationship is optional If minimum cardinality is 1 entity participation in a relationship is mandatory If maximum cardinality is 1 each instance of the entity is associated at most with a single instance


View Full Document

Toronto CSC 340 - The Entity-Relationship Model

Documents in this Course
Scoping

Scoping

10 pages

Load more
Loading Unlocking...
Login

Join to view The Entity-Relationship Model and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The Entity-Relationship Model and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?