Professional Documents
Culture Documents
!"
Entity Relationship Model (ER Model) is a
popular high-level conceptual data model used
for the conceptual design of database
applications.
ER model has three main concepts:
Entities
Attributes
Relationships
Mini World
ER Model
Logical Level
Relational Model
DB
Physical Level
!" #
Entity
!" # $
Attribute
%"
&'(
%"
&)(
%"
&(
$
Super key: any set of attributes such that the values of the
attributes (taken together) uniquely identify one entity in the
entity set
For example, HKID, SID, {NAME, SID}.
Candidate key: Minimal super key -- a super key with no
redundant attributes
For example, HKID, SID.
Primary key: A primary key is one of the candidate keys,
designated by the database designer
For example, SID.
Every primary key is also a candidate key; every candidate key
is also a super key, but not vice versa
10
!" #
+"
TA
Prof.
Student
Learn
# #
&',
'(
+"
13
# #
&-,
'(
+"
14
# #
&,
-(
+"
15
+"
+"
A relationship can have attributes:
For example, HoursPerWeek of WORKS_ON
Its value for each relationship instance describes the number of
hours per week that an EMPLOYEE works on a PROJECT.
A value of HoursPerWeek depends on a particular (employee,
project) combination
17
+"
Constraints on Relationship
(Also known as ratio constraints)
Cardinality Ratio (specifies maximum participation)
One-to-one (1:1)
One-to-many (1:N) or Many-to-one (N:1)
Many-to-many (M:N)
18
+"
. !
The bank is organized into branches. Each branch is located in a
particular city and it identified by a unique name. The bank
monitors the assets of each branch.
Bank customers are identified by their customer-id values. The
bank stores each customers name, and the street and city where
the customer lives. Customers may have accounts and can take
out loans. A customer may be associated with a particular
banker, who may act as a loan officer or personal banker for the
customer.
Bank employees are identified by their employee-id values. The
bank administration stores the name and telephone number of
each employee, the names of the employees dependents, and
the employee-id number of the employees manager. The bank
also keeps track of the employees start date and, thus, length of
employment.