Entity Relationship Model Auto Saved]

Embed Size (px)

Citation preview

  • 8/7/2019 Entity Relationship Model Auto Saved]

    1/15

  • 8/7/2019 Entity Relationship Model Auto Saved]

    2/15

    INTRODUCTION

    E-R model was introduce by P.P CHEN in 1976.

    E-R model is an effective and standard method of

    communication amongest different designers, programmersand end users.

    E-R modeling is a high level conceptual data model developed

    to facilitate database design.

    It is very useful in mapping the meaning and interaction ofreal world enterprise onto a conceptual schema.

  • 8/7/2019 Entity Relationship Model Auto Saved]

    3/15

    E-R model provides the following three main semantic

    concept to the designer:

    ENTITIES: Which are distinct objects in a user enterprise.

    RELATIONSHIP :Which are meaningful interaction among the objects

    ATTRIBUTES: Which describe the entities and relationships. Each such

    attributes is associated with a value set(Also called domain)and can take a value from this value set.

    CONSTRAINTS: On the entities, Relationships and attributes.

  • 8/7/2019 Entity Relationship Model Auto Saved]

    4/15

    ENTITYRELATIONSHIP

    MODEL

    Based on collection of real world objects or concept called

    entities; ex: employee, student

    attribute represents properties of entity; s.s.num

    relationship represents interaction between entities

    overall logical structure represented by E-R diagram

    representing entity sets,

    relationships, attributes

  • 8/7/2019 Entity Relationship Model Auto Saved]

    5/15

    ENTITY: REAL-WORLD OBJECT DISTINGUISHABLE FROM OTHER

    OBJECTS.

    AN ENTITY IS DESCRIBED (IN DB) USING A SET OF ATTRIBUTES.

    ENTITY SET: A COLLECTION OF SIMILAR ENTITIES. E.G., ALLEMPLOYEES.

    ALL ENTITIES IN AN ENTITY SET HAVE THE SAME SET OF ATTRIBUTES.

    (UNTIL WE CONSIDER ISA HIERARCHIES, ANYWAY!)

    EACH ENTITY SET HAS A KEY.

    EACH ATTRIBUTE HAS A DOMAIN.

    REPRESENTATION/SYNTAX:

    ENTITY SET REPRESENTED BY RECTANGLE

    ATTRIBUTE REPRESENTED BY OVAL

    KEY ATTRIBUTE UNDERLINED

    ER ModelDefinitions

  • 8/7/2019 Entity Relationship Model Auto Saved]

    6/15

    RELATIONSHIP: ASSOCIATION AMONG TWO OR MORE ENTITIES.

    E.G., DAN TAKES DATABASE COURSE; ATTISHOO WORKS IN

    PHARMACY DEPARTMENT.

    .RELATIONSHIP CAN ALSO HAVE ATTRIBUTES (THAT APPEARONLY FOR THISRELATIONSHIP SET)

    REPRESENTATION/SYNTAX: A DIAMOND SYMBOL

    . ATTRIBUTES REPRESENTED BY OVAL (SAME AS BEFORE)

    RELATIONSHIP SET:COLLECTION OF SIMILAR RELATIONSHIPS.

    . AN N-ARY RELATIONSHIP SET RRELATES N ENTITY SETS E1 ... EN; EACHRELATIONSHIP IN R INVOLVES ENTITIES E1 E1, ..., EN EN

    . SAME ENTITY SET COULD PARTICIPATE IN DIFFERENTRELATIONSHIP

    SETS, OR IN DIFFERENT ROLES IN SAME SET.

    ER ModelBasics (Contd.)

  • 8/7/2019 Entity Relationship Model Auto Saved]

    7/15

    SYMBOLS OF E-R DIAGRAM

    (Entity set)

    (Relationship)

    (Attributes)

    (Link between attributeand entity set )

  • 8/7/2019 Entity Relationship Model Auto Saved]

    8/15

    SYMBOLS OF E-R DIAGRAM

    (Mandatory one) (Mandatory many)

    (Optional one) (Optional many)

  • 8/7/2019 Entity Relationship Model Auto Saved]

    9/15

    . ATTRIBUTES CAN ONLY BE CONNECTED TO ENTITIES OR

    RELATIONSHIPS.

    . ENTITIES CAN ONLY BE CONNECTED VIA RELATIONSHIPS

    .AS FOR THE EDGES, LETS CONSIDER KINDS OF RELATIONSHIPS

    AND INTEGRITY CONSTRAINTS

    Connectivityinthe E-R Diagram

    PROFESSORS COURSESTEACHES

  • 8/7/2019 Entity Relationship Model Auto Saved]

    10/15

    CUSTOMER

    ORDERPRODUCT

    CUST_ID CUST_NAME

    UNIT_COST

    PROD_DESC

    PROD_ID

    ORD_DATEPROD_ID PROD_QTY

    CUST_ADRESS

    SUBMITS

    REQUESTS

    E-R diagram for M/s ABC & Co

  • 8/7/2019 Entity Relationship Model Auto Saved]

    11/15

    .CAPTURE PROPERTIES OF THE RELATIONSHIP AND ENTITIES

    . EVERY ENTITY SET HAS A KEY ATTRIBUTE

    . NO TWO ELEMENTS CAN HAVE THE SAME VALUE ON THIS ATTRIBUTE EXAMPLE: STUDENT ID

    . DOES EVERY ELEMENT IN THE ENTITY SET APPEAR/PARTICIPATE IN

    THERELATIONSHIP ?

    . MUST EVERY STUDENT TAKE A COURSE ?

    . DEFINE CONSTRAINTS BASED ON PROPERTIES OF THEMAPPING/RELATION BETWEEN ENTITY SETS

    Constraints KeyandParticipation

  • 8/7/2019 Entity Relationship Model Auto Saved]

    12/15

    . BINARY RELATIONSHIPS CAN BE CLASSIFIED AS ONE

    TO-ONE, MANY-TO-ONE, ONE-TO-MANY, MANY-TO

    MANY. WHAT IS THE TYPE OF MAPPING/RELATION

    Propertiesofrelations

    .

    .

    .

    .

    .

    .

    ..

    .

    .

    .

    .

    .

    .

    .

    .

    ..

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    ..

    .

    .

    .

    ..

    .

    .

    1-TO-1 1-TO-MANY MANY-TO-1 MANY-TO-MANY

  • 8/7/2019 Entity Relationship Model Auto Saved]

    13/15

    ADVANTAGES OF E-R DATA MODEL

    STRAIGHT FORWARD RELATIONAL REPRESENTATION: Having designed

    an E-R diagram for a database application, the relational representation

    of the data base model becomes relatively straightforward.EASY CONVERSION FOR E-R TO OTHER DATA MODEL: Conversion from

    E-R diagram to a network or hierarchical data model can easily be

    accomplished.

    GRAPHICAL REPRESENTATION FOR BETTER UNDERSTANDING: An E-R

    model gives graphical and diagrammatical representation of various

    entities, its attributes and relationships between entities. This is turn

    helps in the clear understanding of the data structure and in minimizing

    redundancy and other problems.

  • 8/7/2019 Entity Relationship Model Auto Saved]

    14/15

    DISADVANTAGES OF E-R DATA MODEL

    NO INDUSTRY STANDARD FOR NOTATION: there is no industry

    standard notation for Developing an E-R diagram.POPULAR FOR HIGH-LEVEL DESIGN: The E-R model is especially

    popular for high level data base design.

  • 8/7/2019 Entity Relationship Model Auto Saved]

    15/15