CS54-Data Modeling Using The Entity-Relationship Data B
CS54-Data Modeling Using The Entity-Relationship Data B
Normalized
Tables
Design
Application
1
Database Design and Conceptual Data
Model
2
Database Design and Conceptual
Data Model (contd.)
• Conceptual Design
-Conceptual schema; a permanent description of
database specifications.
- Capture the semantics of the data; description of data,
constraints, relationships
- No storage details needed
3
HISTORY OF DATA MODELS
• Description in high-level model
- Close to the user' view of mini-world
- Abstract concepts
- Means of communication between the non-technical
users and the developer
- Allows user to influence design and is independent of
any particular DBMS.
•Entity Relationship Data Model
- developed by Peter Chen (1983)
- basis for ANSI IRDS (Dolk & Kirsch, 1987; Winkler 1989)
4
Example COMPANY Database
5
Example COMPANY Database
(contd.)
6
Example COMPANY Database
(contd.)
7
ER Model Concepts
(Popular Conceptual model)
•Entities
Specific objects or things in the mini-world that are
represented in the database; for example the EMPLOYEE
John Smith, the Research DEPARTMENT, the ProductX
PROJECT
•Attributes
Properties used to describe an entity (or relationship); for
example an EMPLOYEE entity may have a Name, SSN,
Address, Sex, BirthDate.
8
ER Model Concepts (contd.)
9
ER Model Concepts (contd.)
•Types of Attributes:
- Simple: Each entity has a single atomic value for the
attribute; for example SSN or Sex. (i.e., single-valued)
- Composite: The attribute may be composed of several
components; for example Address(Apt#, House#, Street,
City, State, ZipCode, Country) or Name(FirstName,
MiddleName, LastName). Composition may form a
hierarchy where some components are
themselves composite.
10
ER Model Concepts (contd.)
11
Entity Types and Key Attributes
12
Entity Types and Key Attributes
(contd.)
- A key attribute may be composite. For example,
VehicleRegistrationNumber is a key of the CAR entity
type with components (Number, State).
13
Relationships and Relationship Types
14
Relationships and Relationship Types
(contd.)
-The degree of a relationship type is the number of
participating entity types. Both MANAGES and
WORKS_ON are binary relationships.
15
Structural Constraints and Roles
16
Structural Constraints and Roles
(contd.)
17
Structural Constraints and Roles
(contd.)
18
Structural Constraints and Roles
(contd.)
• Examples:
19
Structural Constraints and Roles
(contd.)
20
Weak Entity Types
21
Weak Entity Types (contd.)
Example:
22
Relationships of Higher Degree
23
Enhanced Entity-Relationship Model
(Concepts/Features)
•Subclass/subtype, superclass/supertype
Specialization -- define subclasses
Generalization -- define superclass
•Constraints on Specialization
Disjointness (Disjoint or Overlap)
Completeness (Total or Partial Specialization)
•Inheritance.
•Hierarchies and Lattices
•Union Types (Categories)
24
Enhanced ER Model (EER)
25
Subclass/Superclass
26
Subclass/Superclass (contd.)
27
Specialization/Gerneralization
Characteristics
28
Specialization/Gerneralization
Characteristics (contd.)
29
Specialization/Generalization
Constriaints
30
Specialization/Generalization
Constriaints (contd.)
31
Specialization Hierarchies and
Lattices
32
Specialization Hierarchies and
Lattices
(contd.)
• Shared Subclass: A subclass with more than one
superclass
• Multiple Inheritance: A shared subclass inheriting
attributes and relationships from multiple (super)
classes
33
Union Type/Categories
34
Coincidences between the ER Model and the
Surface Structure of English
(P. Chen, 1983)
Symbol ER Meaning English Equivalent
Entity Noun
Relationship Verb
Attribute of:
Entity Adjective
Relationship Adverb
35