Presentation is loading. Please wait.

Presentation is loading. Please wait.

Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Data Modeling 70-451 Management Information Systems Robert.

Similar presentations


Presentation on theme: "Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Data Modeling 70-451 Management Information Systems Robert."— Presentation transcript:

1 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Data Modeling 70-451 Management Information Systems Robert Monroe October 23, 2011

2 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Quiz

3 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Goals For Today By the end of today's class you should be able to: –Explain the difference between an Entity, an Attribute, and a Relationship in an Entity-Relationship Model –Model basic data entities in an organization using Entity- Relationship Diagrams (ERD's) –Assign attributes to those entities –Identify basic relationships between entities

4 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems What Is Data Modeling? Data modeling describes a set of tools and techniques that IS professionals use to describe, define, structure, organize, and manage an organization’s data We will be looking at one specific (but very common) data modeling technique called Entity-Relationship Modeling

5 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Data Modeling In Context Data modeling is usually done during the design phase of an individual IS project Effective data modeling requires the interaction of business analysts and IS professionals Data modeling is done independent of the specific database implementation Enterprise data modeling can be done for an entire organization’s data needs, across applications, projects, and databases. This is known as Enterprise Data Modeling Maintain & Support Impl.Test Develop Design AnalyzePlan

6 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Why Do Data Modeling? Data tends to outlive both IS applications and even business processes –Don’t reinvent what you have already built! –Data integration is the most common way to integrate IS applications – properly defined data models make this integration much, much easier and less error-prone Getting the data structures and relationships right makes it much, much easier to build an efficient and effective information system Data modeling techniques such as E-R Diagrams help IS professionals describe their data models precisely, unambiguously, and with a shared notation

7 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Entity-Relationship (ER) Data Modeling

8 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems ER Modeling Core Elements Entity A person, place, object, event, concept in the user environment about which the organization wishes to maintain data. Attribute A property or characteristic of an entity that is of interest to the organization. Relationship A meaningful association between, or among, entities. Entity Attribute … PersonCar owns Source: [HPM09]

9 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Sample E-R Diagram Source: [HPM09]

10 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems E-R Diagram Notation (Figure 3-2 of text) Entity symbols A special entity that is also a relationship Relationship symbols Attribute symbols Relationship cardinalities specify how many of each entity type is allowed Relationship degrees specify number of entity types involved Source: [HPM09]

11 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Identifying Entities An entity should be: –An object that will have many instances in the database –An object that will be composed of multiple attributes –An object that we are trying to model An entity should NOT be: –A user of the database system –An output of the database system (e.g. a report)

12 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Picking Appropriate Entities Source: [HPM09]

13 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Naming Entities Guidelines for naming entity types: –Use singular nouns –Be concise –Abbreviations are ok, as long as they are standardized –Event entity types should be named for the result of the event –Be consistent Good ExamplesPoor Examples Student Customer Flight Employee Invoice FormerStudentFromOman Customers ClientsWhoCameToBigEvent ObscureRecmdForFrtherAction

14 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems In Class Exercise (Part I): Find the Entities Identify the entities that appear on the report card Source: [HPM09]

15 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Attributes A property or characteristic of an entity type Classifications of attributes: –Identifier Attributes –Required versus Optional –Simple versus Composite –Single-Valued versus Multivalued Attribute –Stored versus Derived Source: [HPM09]

16 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Entity With Simple Attributes Employee FirstName LastName DateOfBirth DateHired

17 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Entity With Composite Attribute Source: [HPM09]

18 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Identifiers (Keys) An attribute (or combination of attributes) that uniquely identifies individual instances of an entity type Can be simple or composite Characteristics of identifiers: –Will not change in value –Will not be null –No intelligent identifiers e.g. containing locations or people that might change –Substitute new, simple keys for long, composite keys

19 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Identifier Examples: Simple and Composite Simple identifiers: –Single attribute uniquely identifies each entity instance –Identifier attribute underlined Composite identifiers: –Multiple attributes required to uniquely identifies each entity instance –Identifier attribute underlined and composite attributes listed below in (parentheses) Source: [HPM09]

20 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Derived Attribute Multivalued Attribute Example: Entity With Multivalued And Derived Attributes Source: [HPM09]

21 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Time-stamping is commonly done with a multi-valued and composite attribute Example: A Multivalued and Composite Attribute Product Product_ID {Price_History (Effective_Date, Price)}

22 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Naming Attributes Guidelines for naming attributes: –Use singular nouns or noun phrases –Names should be unique (at least within an entity type) –Be concise –Follow a standard format –Similar attributes should use the same qualifiers and classes Good ExamplesPoor Examples Date StudentName NumberEnrolled Birth_Date CourseID Employee_ID TheDayThatThisPersonEnrolled Student_Names ClientLastName NumEnrollInSpecificClass

23 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems In Class Exercise (Part II): Find the Attributes Form teams of 2-3 students Identify the attributes of each previously identified entity Source: [HPM09]

24 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Relationships A relationship defines a meaningful association between, or among, entities –Modeled as a line drawn between entities Relationships can have attributes –These describe features pertaining to the association between the entities in the relationship. Two entities can have more than one type of relationship between them (multiple relationships)

25 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Degree of Relationship Defines the number of entity types that participate in it Unary Relationship –One entity type related to itself Binary Relationship –Two entity types related to each other Ternary Relationship –Three entity types related to each other It is possible, but unusual, to have relationship types of larger than 3 entities

26 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Defines the number of entity instances that participate in it One-to-One –Each entity in the relationship will have exactly one related entity One-to-Many –An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity Many-to-Many –Entities on both sides of the relationship can have many related entities on the other side Cardinality of Relationships

27 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Cardinality Constraints The number of instances of one entity that can or must be associated with each instance of another entity –Mandatory one –Mandatory many –Optional one –Optional many

28 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Unary Degree Relationship Source: [HPM09]

29 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Binary Relationships Source: [HPM09]

30 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Binary Relationship With An Attribute The Date_Completed attribute pertains specifically to the employee’s completion of a course It is an attribute of the relationship, not either entity in isolation Source: [HPM09]

31 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Example: Ternary Relationship With Attributes Source: [HPM09]

32 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems E-R Diagram Notation Entity symbols A special entity that is also a relationship Relationship symbols Attribute symbols Relationship cardinalities specify how many of each entity type is allowed Relationship degrees specify number of entity types involved Source: [HPM09]

33 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems In-Class Exercise (Part III) – Create E-R Diagram Produce an E-R diagram capturing –Entities –Attributes –Relationships Source: [HPM05]

34 Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems References [HPM09] Jeffrey Hoffer, Mary Prescott, Fred McFadden, Modern Database Management, 9 th Ed., Pearson - Prentice Hall, 2009, ISBN: 0-13-600391-5.


Download ppt "Carnegie Mellon University ©2006 - 2011 Robert T. Monroe 70-451 Management Information Systems Data Modeling 70-451 Management Information Systems Robert."

Similar presentations


Ads by Google