0% found this document useful (0 votes)
12 views

Data Modeling Using ER Model Cont. (Ch3)

Uploaded by

fahim.fardin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Data Modeling Using ER Model Cont. (Ch3)

Uploaded by

fahim.fardin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

CHAPTER 3

Data Modeling Using the


Entity-Relationship (ER) Model (cont.)

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 1- 1


ER Diagram: Relationship
◼ When an attribute of an Entity Type refers to
another Entity Type then some relationship
exists

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 2


Relationship Instance and Degree of
Relationship Type

Entities Entities
e1,e2,.. d1,d2,..

Degree of the Relationship Type


(number of participating entity types)

Two Entity Types: (Employee and


Department) are participating in the
Relationship instances BINARY relationship
(Association of the Entities)
Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 3
Relationships of Higher Degree
◼ Relationship types of degree 2 are called binary
◼ Relationship types of degree 3 are called ternary
and of degree n are called n-ary

◼ In general, an n-ary relationship is not equivalent


to n binary relationships

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 4


Discussion of n-ary relationships (n > 2)
◼ In general, 3 binary relationships can represent different
information than a single ternary relationship

◼ If needed, the binary and n-ary relationships can all be


included in the schema design

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 5


Participation constraint
◼ Rules that determine the minimum and maximum
participation of entities or relationships in a given
relationship set
◼ Total participation (Total
participation)
(Total
participation)
◼ Partial participation

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 6


Example: Relationship Type in ER Diagram

In ER Diagram,

Total participation: double line

Partial participation single line

(Partial (Total
participation) participation)
EMPLOYEE Manages DEPARTMENT

e1 r1
d1
e2 r2
e3 r3
d2
e4 r4
e5 r5
d3
. .
.
. .
.

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 7


Alternative Notation for Relationship
Structural Constraints (min, max):
◼ Specified on each participation of an entity type E in a relationship
type R
◼ Specifies that each entity e in E participates in at least min and at
most max relationship instances in R
◼ Default(no constraint): min=0, max=n (signifying no limit)
◼ Must have minmax, min0, max 1
◼ Only single lines are represented instead of double/single
◼ Examples:
◼ An employee can work for exactly one department but a
department can have any number of employees.
◼ Specify (1,1) for participation of EMPLOYEE in WORKS_FOR
◼ Specify (0,N) for participation of DEPARTMENT in WORKS_FOR
◼ A department has exactly one manager and an employee can
manage at most one department.
◼ Specify (0,1) for participation of EMPLOYEE in MANAGES
◼ Specify (1,1) for participation of DEPARTMENT in MANAGES

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 8


The (min,max) notation for
relationship constraints

Read the min,max numbers next to the entity


type and looking away from the entity type

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 9


COMPANY ER Schema Diagram using
(min, max) notation

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 10


Alternative diagrammatic notation
◼ ER diagrams is one popular example for
displaying database schemas
◼ Many other notations exist in the literature and in
various database design and modeling tools

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 11


Summary of notation for ER diagrams

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 12


Class Diagram: UML (Unified Modeling
Language) Diagram
◼ UML class diagrams is representative of another way of
displaying ER concepts that is used in several commercial
design tools
◼ Represent classes (similar to entity types) as large boxes
with three sections:
1. Top section includes entity type (class) name
2. Second section includes attributes
3. Third section includes class operations (operations are not
in basic ER model)
◼ Relationships (called associations) represented as lines
connecting the classes
◼ Other UML terminology also differs from ER terminology
◼ Used in database design and object-oriented software
design

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 13


UML class diagram for COMPANY
database schema

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 14


Data Modeling Tools (Additional
Material )
◼ A number of popular tools that cover conceptual modeling
and mapping into relational schema design.
◼ Examples: ERWin, S- Designer (Enterprise Application
Suite), ER- Studio, etc.
◼ POSITIVES:
◼ Serves as documentation of application requirements, easy
user interface - mostly graphics editor support
◼ NEGATIVES:
◼ Most tools lack a proper distinct notation for relationships
with relationship attributes
◼ Mostly represent a relational design in a diagrammatic form
rather than a conceptual ER-based design

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 15


Some of the Automated Database
Design Tools (Note: Not all may be on the market now)
COMPANY TOOL FUNCTIONALITY
Embarcadero ER Studio Database Modeling in ER and IDEF1X
Technologies
DB Artisan Database administration, space and security
management
Oracle Developer 2000/Designer 2000 Database modeling, application development
Popkin System Architect 2001 Data modeling, object modeling, process modeling,
Software structured analysis/design
Platinum Enterprise Modeling Suite: Data, process, and business component modeling
(Computer Erwin, BPWin, Paradigm Plus
Associates)
Persistence Pwertier Mapping from O-O to relational model
Inc.
Rational (IBM) Rational Rose UML Modeling & application generation in C++/JAVA
Resolution Ltd. Xcase Conceptual modeling up to code maintenance
Sybase Enterprise Application Suite Data modeling, business logic modeling
Visio Visio Enterprise Data modeling, design/reengineering Visual Basic/C++

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 16


Chapter Summary
◼ ER Model Concepts: Entities, attributes,
relationships
◼ Constraints in the ER model
◼ Using ER in step-by-step mode conceptual
schema design for the COMPANY database
◼ ER Diagrams – Notation
◼ Binary Relationship types and those of higher
degree.
◼ Alternative Notations – introduce UML class
diagrams
Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 17
Extended Entity-Relationship (EER)
Model (in the next chapter)

◼ The entity relationship model in its original form


did not support the specialization and
generalization abstractions
◼ Next chapter illustrates how the ER model can be
extended with
◼ Type-subtype and set-subset relationships
◼ Specialization/Generalization Hierarchies
◼ Notation to display them in EER diagrams

Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei Slide 3- 18

You might also like