













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The Entity-Relationship Model, which is used in the conceptual design of a database. It covers basic concepts, ER schema, constraints, design choices, and steps in designing an ER schema. It also explains how to translate an ER schema into tables. examples and diagrams to illustrate the concepts. It is useful for students studying database design and management.
Typology: Summaries
1 / 21
This page cannot be seen from the preview
Don't miss anything!














Contents
What does Conceptual Design include?
Ideas −→ High-level design
Relational database schema
−→ Relational DBMS
Key attributes of an Entity Type
Relationships, Relationship Types, and Relationship Sets
R ⊆ {(e 1 ,... , en) | e 1 ∈ E 1 ,... , en ∈ En} where (e 1 ,... , en) is a relationship.
EMPLOYEES reports_to supervisor
subordinate
Role labels clarify semantics of a relationship, i.e., the way in which an entity participates in a relationship. ; recursive relationship.
Example of an Entity-Relationship Diagram
offers (^) Price
SAddress
Chain
CAddress
CUSTOMERS
orders
Account (^) PRODUCTS
SUPPLIERS
Quantity
FName LName Prodname
SName
Customers-Suppliers-Products Entity-Relationship Diagram
Constraints on Relationship Types
Limit the number of possible combinations of entities that may participate in a relationship set. There are two types of constraints: cardinality ratio and participation constraints
Very useful concept in describing binary relationship types. For binary relationships, the cardinality ratio must be one of the following types:
EMPLOYEES worksïin^ DEPARTMENTS
Meaning: An employee can work in many departments (≥ 0 ), and a department can have several employees
EMPLOYEES worksïin DEPARTMENTS
Meaning: An employee can work in at most one department (≤ 1 ), and a department can have several employees.
Constraints on Relationship Types (cont.)
A many-one relationship type (and the counterpart one-many) is also often called a functional relationship.
Cardinality ratio of a relationship can affect the placement of a relationship attribute. E.g., in case of a many-one relationship type, one can place a relationship attribute at a participating entity type.
Participation constraint: specifies whether the existence of an entity e ∈ E depends on being related to another entity via the relationship type R.
EMPLOYEES worksïin^ DEPARTMENTS
Instead of a cardinality ratio or participation constraint, more precise cardinality limits (aka degree constraints in textbook) can be associated with relationship types:
E (^1) (min , max ) 1 1 R (min , max ) 2 2 E 2
Each entity e 1 ∈ E 1 must participate in relationship set R at least min 1 and at most max 1 times (analogous for e 2 ∈ E 2 ).
Frequently used cardinalities
Relationship (min 1 , max 1 ) (min 2 , max 2 ) pictorial notation
many-to-many (0, ∗) (0, ∗)
many-to-one (0, 1) (0, ∗)
one-to-one (0, 1) (0, 1)
Enhanced ER Modeling Concepts
Although most properties of entities and relationships can be expressed using the basic modeling constructs, some of them are costly and difficult to express (and to understand). That’s why there are some extensions to the ER model.
Subclasses, Superclasses, and Inheritance
ISA
PERSON
GPA STUDENT Major
SSN Name
Specialization
ISA
EMPLOYEES
SocialSN
HOURLY_EMPS
Name Address
CONTRACT_EMPS
Hours Wages Contractno
HOURLY EMPS is a subclass of EMPLOYEES and thus inherits its attributes and relationships (same for CONTRACT EMPS).
Generalization:
ISA
CAR TRUCK
Tonage MaxSpeed Axels
NoOfPassengers
VEHICLE
VehicleNo (^) Price LicensePlate
Steps in Designing an Entity-Relationship Schema
[Step 1] Identify entity types (entity type vs. attribute)
[Step 2] Identify relationship types
[Step 3] Identify and associate attributes with entity and relationship types
[Step 4] Determine attribute domains
[Step 5] Determine primary key attributes for entity types
[Step 6] Associate (refined) cardinality ratio(s) with relationship types
[Step 7] Design generalization/specialization hierarchies including constraints (includes natural language statements as well)
Translation of ER Schema into Tables
Translating Relationship Types into Tables
Prodname SName Price PC42 Hal-Mart 2, MacIV Sears 2,
.........
Prodname and SName are the primary key attributes of the entity types SUPPLIERS and PRODUCTS.
Translating Subclasses/Superclasses into Tables
Example: Employees(SocialSN, Name, Address) Hourly_Emps(SocialSN, Hours, Wages) Contract_Emps(SocialSN, ContractNo)
Method 2 has no table for the superclass EMPLOYEES.