Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Database Analysis

Chapter 2: Modeling Data in the


Organization
Enterprise Database Modeling

A enterprise data model identifies the highest-level


relationships between the different entities.
Entity-Relationship (ER) Model
• Entity-Relationship (ER) Model is based on the notion of real-world
entities and relationships among them.
• ER Model creates entity set, relationship set, general attributes, and
constraints.
• Entities:Any real-world thing about which an enterprise records data.
• Entity Type–collection of entities.
• Entity instance–person, place, object, event, concept
• Relationship -An association between two or more entities,
• Relationship is modeled as lines between entity types
• Relationship instance–link between entities.
• Associative Entity–combination of relationship and entity.
• Attributes –property or characteristic of an entity or relationship type
A composite attribute
Entity with a multivalued attribute (Skill) and
derived attribute (Years_Employed)

© Prentice Hall, 2002 6


An attribute that is both multivalued and composite

© Prentice Hall, 2002 7


Degree of Relationships: is the number of entity
types .Or No. of entities participating in
relationship.
Degree of Relationships are
– Unary Relationship:One entity related to
another of the same entity type
– Binary Relationship:Entities of two different
types related to each other
– Ternary Relationship:Entities of three different
types related to each other
8
Relationships (cont.)

a) Unary relationships

9
Binary relationships

SHIP
SUPPLIER PART

WORK FOR
EMPLOYEE COMPANY

© Prentice Hall, 2002 10


c) Ternary relationship

11
Cardinality of Relationships
One-to-One (1:1):Each entity in the relationship will have exactly one related
entity

One-to-Many (1:N) OR Many to one (M:1): 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 (M:M OR N:M): Entities on both sides of the relationship can
have many related entities on the other side
a) Mandatory cardinalities

b) One optional, one mandatory

c) Optional cardinalities

13
Cardinalities

Mandatory one

Mandatory many

Optional one

Optional many
14
Difference between Strong vs. Weak
Entities

Strong entity Weak entity

1) exist independently 1. cannot exist on its own


2.has its own unique identifier 2.does not have a unique
identifier

3.represented with single-line 3. represented with double


rectangle line diamond

15
Strong vs. Weak Entities (cont.)

16

You might also like