CSE202 Database Management Systems: Lecture #4
CSE202 Database Management Systems: Lecture #4
Lecture #4
2
Outline
Using high-level conceptual data models for database design
A sample database application
Entity types, entity sets, attributes, and keys
Relationship types, relationship sets, roles, and structural
constraints
Weak entity types
Refining the ER design for the COMPANY database
ER diagrams, naming conventions, and design issues
Example of other Notation: UML class diagrams
Relationship types of degree higher than two
3
Data Modeling Using the Entity-Relationship (ER) Model
Conceptual schema
Conceptual design
Description of data requirements
Includes detailed descriptions of the entity types,
relationships, and constraints
Transformed from high-level data model into
implementation data model
Using High-Level Conceptual Data Models (cont.)
COMPANY
Employees, departments, and projects
Company is organized into departments
Department controls a number of projects
Employee: store each employee’s name, Social Security
number, address, salary, sex (gender), and birth date
Keep track of the dependents of each employee
Entity Types, Entity Sets, Attributes, and Keys
Entity
Thing in real world with independent existence
Attributes
Particular properties that describe entity
Types of attributes:
Composite versus simple (atomic) attributes
Single-valued versus multivalued attributes
Stored versus derived attributes
NULL values
Complex attributes
Entities and Attributes (cont.)
Entity Types, Entity Sets, Keys, and Value Sets
Entity type
Collection (or set) of entities that have the same attributes
Entity Types, Entity Sets, Keys, and Value Sets (cont.)
Relationship
When an attribute of one entity type refers to another entity
type
Represent references as relationships not attributes
Relationship Types, Sets, and Instances
31
Chapter 8 (Elmasri) Outline
Specialization
Process of defining a set of subclasses of an entity type
Defined on the basis of some distinguishing characteristic
of the entities in the superclass
Subclass can define:
Specific attributes
Specific relationship types
Generalization
Disjointness constraint
Specifies that the subclasses of the specialization must be
disjoint
Completeness (or totalness) constraint
May be total or partial
Disjointness and completeness constraints are independent
Specialization and Generalization Hierarchies
and Lattices
Specialization hierarchy
Every subclass participates as a subclass in only one
class/subclass relationship
Results in a tree structure or strict hierarchy
Specialization lattice
Subclass can be a subclass in more than one class/subclass
relationship
Modeling of UNION Types Using Categories
Class
Set or collection of entities
Includes any of the EER schema constructs of group entities
Subclass
Class whose entities must always be a subset of the entities
in another class
Specialization
Set of subclasses that have same superclass
Formal Definitions for the EER Model Concepts (cont.)
Generalization
Generalized entity type or superclass
Formal Definitions for the EER Model Concepts (cont.)
Category
Class that is a subset of the union of n defining superclasses
Relationship type
Any class can participate in a relationship