H10 ERD Basics

Embed Size (px)

Citation preview

  • 8/21/2019 H10 ERD Basics

    1/12

    Entity Relationship Diagrams

    Basic Elements and Rules

  • 8/21/2019 H10 ERD Basics

    2/12

    Introduction to Entity-Relationship (E-R) Modeling

    Notation uses three main constructs

    Data entities

    Relationships

    Attributes

    Entity-Relationship (E-R) Diagram

    A detailed, logical representation of the

    entities, associations and data elementsfor an organization or business

    10.2

  • 8/21/2019 H10 ERD Basics

    3/12

    Entity-Relationship (E-R) ModelingKey Terms

    Entity A person, place, object, event or concept in the

    user environment about which the organizationwishes to maintain data

    Represented by a rectangle in E-R diagrams

    Entity Type A collection of entities that share common

    properties or characteristics

    Attribute A named property or characteristic of an entity

    that is of interest to an organization

    10.3

  • 8/21/2019 H10 ERD Basics

    4/12

    Entity-Relationship (E-R) ModelingKey Terms

    Candidate keys and identifiers

    Each entity type must have an attributeor set of attributes that distinguishes one

    instance from other instances of the sametype

    Candidate key

    Attribute (or combination of attributes) thatuniquely identifies each instance of an entitytype

  • 8/21/2019 H10 ERD Basics

    5/12

    Examples

    Identify a few entity types, instances,attributes and candidate keys for:

    DePaul Campus Connect RegistrationSystem

    Illinois Bureau of Motor Vehicles System

    Amazon.com Product Information

    System

  • 8/21/2019 H10 ERD Basics

    6/12

    Depicting Entities and Attributes

    Draw a portion of the ERD for each of these systems:

    DePaul Campus Connect Registration System

    Illinois Bureau of Motor Vehicles System

    Amazon.com Product Information System

  • 8/21/2019 H10 ERD Basics

    7/12

    Conceptual Data Modeling andthe E-R Diagram

    Goal Capture as much of the meaning of the data as

    possible

    If you know the rules of normalization,referential integrity, foreign keys, etc., this isgood but not as important now. It is much moreimportant to get the organizational data modelcorrect, i.e. to understand the actual datarequirements for the organization.

    Result A better design that is scalable and easier to

    maintain

  • 8/21/2019 H10 ERD Basics

    8/12

    Entity-Relationship (E-R) ModelingKey Terms

    Identifier

    A candidate key that has been selected as theunique identifying characteristic for an entity

    type Selection rules for an identifier

    1. Choose a candidate key that will not change itsvalue

    2. Choose a candidate key that will never be null

    3. Avoid using intelligent keys

    4. Consider substituting single value surrogatekeys for large composite keys

  • 8/21/2019 H10 ERD Basics

    9/12

    Entity-Relationship (E-R) ModelingKey Terms

    Relationship

    An association between the instances ofone or more entity types that is of

    interest to the organization

    Association indicates that an event hasoccurred or that there is a natural linkbetween entity types

    Relationships are always labeled withverb phrases

  • 8/21/2019 H10 ERD Basics

    10/12

    Cardinality

    The number of instances of entity B thatcan be associated with each instance ofentity A

    Minimum Cardinality The minimum number of instances of entity B

    that may be associated with each instance ofentity A

    This is also called modality.

    Maximum Cardinality The maximum number of instances of entity B

    that may be associated with each instance ofentity A

  • 8/21/2019 H10 ERD Basics

    11/12

    Naming and DefiningRelationships

    Relationship name is a verb phrase

    Avoid vague names

    Guidelines for defining relationships

    Definition explains what action is being takenand why it is important

    Give examples to clarify the action

    Optional participation should be explained

    Explain reasons for any explicit maximumcardinality

  • 8/21/2019 H10 ERD Basics

    12/12

    Naming and DefiningRelationships

    Guidelines for defining relationshipsExplain any restrictions on participation in

    the relationship

    Explain extent of the history that is keptin the relationship

    Explain whether an entity instanceinvolved in a relationship instance can

    transfer participation to anotherrelationship instance

    10.12