Docsity

Entity Relationship Modeling: Understanding Entities, Relationships, and Database Design, Slides of Object Oriented Analysis and Design

Partial preview of the text

Download Entity Relationship Modeling: Understanding Entities, Relationships, and Database Design and more Slides Object Oriented Analysis and Design in PDF only on Docsity!

Entity Relationship Modeling

Objectives:

  • To illustrate how relationships between entities are defined and refined.
  • To know how relationships are incorporated into the database design

process.

  • To describe how ERD components affect database design and

implementation.

docsity.com

1.0 What is Conceptual Database Design?

  • Process of describing the data, relationships

between the data, relationships between the data,

and the constraints on the data.

  • After analysis - Gather all the essential data

required and understand how the data are related

  • The focus is on the data , rather than on the

processes.

  • The output of the conceptual database design is a

Conceptual Data Model ( + Data Dictionary )

docsity.com

2.0 Entity-Relationship (ER) Modeling.

  • ER Modeling is a top-down approach to database

design.

  • Entity Relationship (ER) Diagram
    • A detailed, logical representation of the entities,

associations and data elements for an organization or

business

  • Notation uses three main constructs
    • Data entities
    • Relationships
    • Attributes

Chen Model & Crow’s Foot Model

docsity.com

Person, place, object, event
or concept about which data
is to be maintained
named property or
characteristic of an
entity
Association
between the
instances of one or
more entity types

Represents a set or collection of objects in the real world that share the same properties

Chen Notation

EntityName Verb Phrase (^) AttributeName

docsity.com

2.1 Entities

  • Examples of entities:
    • Person: EMPLOYEE, STUDENT, PATIENT
    • Place: STORE, WAREHOUSE
    • Object: MACHINE, PRODUCT, CAR
    • Event: SALE,REGISTRATION, RENEWAL
    • Concept: ACCOUNT, COURSE
  • Guidelines for naming and defining entity types:
    • An entity type name is a singular noun
    • An entity type should be descriptive and specific
    • An entity name should be concise
    • Event entity types should be named for the result of the event, not
the activity or process of the event.

docsity.com

2.2 Attributes

  • Example of entity types and associated attributes:
STUDENT: Student_ID, Student_Name, Home_Address,
Phone_Number, Major
  • Guidelines for naming attributes:
    • An attribute name is a noun.
    • An attribute name should be unique
    • To make an attribute name unique and clear, each attribute name
should follow a standard format
  • Similar attributes of different entity types should use similar but
distinguishing names.

docsity.com

2.2.2 Referential Attributes

Name IdNum DeptID Email Ali 105 LG [email protected] Mary 106 IT [email protected] John 107 ENG [email protected] Lim 108 IT [email protected] Instance of Lecturer.

Referential attribute: Ties the lecturer entity to another entity that is department.

  • Make Reference to another instance in another table

docsity.com

Example

Staff

StaffID

Name Gender

IC

Staff StaffID Name Gender IC

PK

docsity.com

2.3.1 Degree of Relationships

  • Degree: number of entity types that participate in a relationship
  • Three cases
    • Unary: between two instances of one entity type
    • Binary: between the instances of two entity types
    • Ternary: among the instances of three entity types

docsity.com

2.4 Cardinality and Connectivity

  • Relationships can be classified as either
    • one – to – one
    • one – to – many
    • many – to – many
  • Cardinality : minimum and maximum number of

instances of Entity B that can (or must be)

associated with each instance of entity A.

Connectivity

docsity.com

2.4 Cardinality and Connectivity

Professor teaches Class

Professor teaches Class

1 M

Connectivity

Connectivity

Cardinality

Cardinality docsity.com

2.4.1 Connectivity

  • Chen Model
    • 1 to represent one.
    • M to represent many
  • Crow’s Foot

many

One

One or many

M

Mandatory one , means (1,1)

Optional? – we’ll see after this

docsity.com

The Implemented 1:M relationship between PAINTER and PAINTING

docsity.com

2.5 Binary Relationships

  • 1:1 relationship
    • Should be rare in any relational database design
    • A single entity instance in one entity class is related to a single entity instance in another entity class
    • Could indicate that two entities actually belong in the same table

docsity.com