Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 65

1

Data Modeling & Database Design


Chapter 3
ER Modeling The method
Major Themes
Presentation Layer ER Diagram Part 1
Presentation Layer ER Model Complete
Design-Specific ER Model Part 1
Design-Specific ER Model Complete


2
Conceptual-
Modeling
Grammar
Conceptual-
Modeling
Scripts
Conceptual Modeling Context
Figure 2.1 Wand and Weber (2002) Framework For Research in Conceptual Modeling
Individual DIfference Factors
Task Factors
Social Agenda Factors
Conceptual-Modeling
Method
Conceptual Modeling Framework
3
4
Application of ER Modeling Grammar
Presentation Layer ER Model/Schema
Presentation Layer
Constraint Specifications
Presentation Layer
ER Diagram
Design-Specific ER Model/Schema
Design-Specific
ER Diagram
Design-Specific
Constraint Specifications
Figure 3.1 Conceptual modeling method using the ER modeling grammar
Conceptual modeling method using
the ER modeling grammar
S
u
m
m
a
r
y

o
f

P
r
e
s
e
n
t
a
t
i
o
n

L
a
y
e
r

E
R

D
i
a
g
r
a
m

N
o
t
a
t
i
o
n

5
R
R
m n
Cardinality Ratio of m:n
Chen's Notation
E1 Optionally Related To E2
(Partial Participation of E1 in R)
E2 Mandatorily Related to E1
(Total Participation of E2 in R)
[Existence Dependency of E2 in R]
E1 E2
E1 E2
R
E1 E2
Cardinality Ratio of m:n
Crow's Foot Notation
6
Figure 3.2 Summary of Presentation Layer ER diagram notation
Inclusive arc Exclusive arc Either/Both
Presentation Layer ER Model
(An End-User Communication/Presentation Device)
Not a Science !

Art? Engineering? - Artistic engineering or Engineered art !

Heuristic (Intuitive), iterative process

Recursive incremental refinement

Target Audience: End-user community

Technology-independent
7
The synthesis approach to generate an
initial set of entity types and attributes
List all discernable data elements treat them as attributes.

Group these attributes based on apparent commonalities.

Designate each cluster of attributes as an entity type.

Review leftover data elements and investigate the possibility
that some of them serve as links among the entity types
previously identified.

Designate these links as relationship types.
8
Begin by searching for things that can be labeled by
singular nouns (a thing, person, concept , event or place)
sort of, super-nouns and call these things entity types.

Gather properties that appear to belong to individual
entity types and label them as attributes of a particular
entity type.

Be sensitive throughout the process to the identification
of relationships among the various entity types.
9
The analysis approach to generate an
initial set of entity types and attributes
Development of
Presentation Layer ER Model
Divide story into meaningful chunks and identify relationship(s)
among entity types i.e., both cardinality constraint(s) and
participation constraints.

Version 0 of ER diagram results a punctuated equilibrium

Go back and read the story (strike out story lines already captured
if need be) and refine entity types and relationship types of the ER
diagram based on additional facts discerned

Gather business rules that cant be captured in the ERD into a list
of Semantic Integrity Constraints a supplement to the ERD

Repeat last two steps (as many times as necessary) until all aspects
of the story (i.e., the business rules) have been accounted for in
the ER model
10
?!
11
Bearcat, Incorporated
12
Bearcat Incorporated is a manufacturing company
that has several plants in the northeastern part of the
United States. These plants are responsible for
leading different projects that the company might
undertake, depending on a plants function. A certain
plant might even be associated with several projects
but a project is always under the control of just one
plant. Some plants do not undertake any projects at
all. If a plant is closed down, the projects undertaken
by that plant cannot be canceled. The project
assignments from a closed plant must be temporarily
removed in order to allow the project to be transferred
to another plant.
Data Modeling & DB Design: Chapter 3 {Umanath & Scamell
(0,n) (1,1) 13
Box 1

Bearcat Incorporated is a manufacturing company that has several plants in the
northeastern part of the United States. These plants are responsible for leading
different projects that the company might undertake, depending on a plants function.
A certain plant might even be associated with several projects but a project is always
under the control of just one plant. Some plants do not undertake any projects at all.
If a plant is closed down, the projects undertaken by that plant cannot be canceled.
The project assignments from a closed plant must be temporarily removed in order to
allow the project to be transferred to another plant.

PLANT
PROJECT
Undertaken_by
n
1

PLANT & PROJECT
Undertaken_by
(0,n)
(1,1)
14
Employees work in these plants and each employee works in only one
plant. A plant could employ many employees but must have at least 100
employees. A plant with employees cannot be closed down. Every plant
is managed by an employee who works in the same plant; but every
employee is not a plant manager nor can an employee manage more than
one plant. Company policy dictates that every plant must have a
manager. Therefore, an employee currently managing a plant cannot be
deleted from the database. If a plant is closed down, the employee no
longer manages the plant but becomes an employee of another plant.
Some employees are assigned to work on projects and in some cases
might even be assigned to work on several projects simultaneously. For
a project to exist, it must have at least one employee assigned to it.
Projects might need several employees depending on their size and
scope. As long as an employee is assigned to a project, his or her record
cannot be removed from the database. However, once a project ends it is
removed from the system and all assignments of employees to that
project must be removed.
15
Box 2




Employees work in these plants and each employee works in only one plant. A plant
could employ many employees but must have at least 100 employees. A plant with
employees cannot be closed down. Every plant is managed by an employee who
works in the same plant; but every employee is not a plant manager nor can an
employee manage more than one plant. Company policy dictates that every plant
must have a manager. Therefore, an employee currently managing a plant cannot be
deleted from the database. If a plant is closed down, the employee no longer manages
the plant but becomes an employee of another plant. Some employees are assigned to
work on projects and in some cases might even be assigned to work on several
projects simultaneously. For a project to exist, it must have at least one employee
assigned to it. Projects might need several employees depending on their size and
scope. As long as an employee is assigned to a project, his or her record cannot be
removed from the database. However, once a project ends it is removed from the
system and all assignments of employees to that project must be removed.

1
EMPLOYEE PLANT
PROJECT
Works_in
Managed_by
Undertaken_by
Assigned
n
n
m n
1
1
1

(1,n)
(1,1)
(0,1)
(1,1)
(1,m)
(0,n)
16
Some of the employees also supervise
other employees but all employees need
not be supervised the employees that are
supervised, are supervised by just one
employee. An employee can be a
supervisor of several employees, but no
more than 20. The Human Resources
Department uses a default employee
number to replace a supervisor who leaves
the company. It is not possible for an
employee to be his or her own supervisor.
17
Box 3



Some of the employees also supervise other employees but all employees need not be
supervised the employees that are supervised, are supervised by just one employee.
An employee can be a supervisor of several employees, but no more than 20. The
Human Resources Department uses a default employee number to replace a supervisor
who leaves the company. It is not possible for an employee to be his or her own
supervisor.

EMPLOYEE
Supervised_by 20 1
Supervisee Supervisor

(0,20) (0,1)
18
1
EMPLOYEE PLANT
PROJECT
Works_in
Managed_by
Undertaken_by
Assigned
n
n
m n
1
1
1
Supervised_by
20
1
Supervisee
S
u
p
e
r
v
is
o
r
As of now . . .
19
All plants of Bearcat Incorporated have a plant name, number, budget, and building. A plant has
three or more buildings. Each plant can be identified by either its name or number. Bearcat
Incorporated operates seven plants and these plants are numbered 10 through 20. However,
either the plant number or plant name must always be recorded.

The name of an employee of Bearcat Incorporated consists of the first name, middle initial, last
name, and a nametag. Employee number is used to identify employees in the company. However,
name can also be used as an identifier. Both employee number and employee name must be
recorded. Where two or more employees have the same name, a one-position numeric nametag
is used so that up to ten otherwise duplicate names can be distinguished from one another.
Sometimes the middle initial of an employee may not be available. While the address, gender
(male or female), and date hired of each employee must be recorded, salary information is
optional. Salaries at Bearcat Incorporated range from $35,000 to $90,000. Also, the salary of an
employee cannot exceed the salary of the employees supervisor.

The start date of an employee as a manager of a plant should also be gathered. There is also the
requirement that the number of employees working in each plant be available; this can be
computed.


Projects have unique names and numbers and their location must be specified. Every project
must have a project number but sometimes may not have a project name. Project numbers range
from 1 to 40; Bearcat Incorporateds projects are located in the cities of Stafford, Bellaire,
Sugarland, Blue Ash, and Mason. The amount of time an employee has been assigned to a
particular project should be recorded for accounting purposes.
20
As of now . . .
n
1
EMPLOYEE PLANT
PROJECT
Works_in
Managed_by
Undertaken_by
Assigned
manager
Supervised_by
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
n
n
m n
Name_tag
No_of_dependents
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Supervisee
Supervisor
20
1
EMPLOYEE PLANT
PROJECT
Works_in
Managed_by
Undertaken_by
Assigned
manager
Supervised_by
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
n
n
m n
Name_tag
No_of_dependents
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Supervisee
Supervisor
20
EMPLOYEE
DEPENDENT
BCU_ACCOUNT
Dependent_of
Held_by_D
Supervised_by
n
n
1
1
1
Held_by_E
1
m
21
Box 4
Data Modeling & DB Design: Chapter 3 {Umanath & Scamell
22
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
Note: Role names included in every relationship edge
As of now . . .
Major Themes
Presentation Layer ER Diagram Part 1
Presentation Layer ER Model Complete
Design-Specific ER Model Part 1
Design-Specific ER Model Complete


23
24
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
Note: Role names included in every relationship edge
As of now . . .
Start day
25
Business rule: Joint-account
between an employee and a
dependent is not permitted
(the concept of an individual
account)
Note: The exclusive arc indicates that the relationship types Held_by_E and Held_by_D are
mutually exclusive; i.e., Held_by_E and Held_by_D are manditorily exclusive.
20
EMPLOYEE
DEPENDENT
BCU_ACCOUNT
Dependent_of
Held_by_D
Supervised_by
n
n
1
1
1
Held_by_E
1
m
Box 5/7
26

20
EMPLOYEE
DEPENDENT
BCU_ACCOUNT
Dependent_of
Held_by_D
Supervised_by
n
n
1
1
1
Held_by_E
1
m

Business rule: If an account
belongs to an employee, it must
also belong to a dependent (the
concept of joint-account)
Note: The inclusive arc indicates that the relationship types Held_by_E and Held_by_D are
mutually inclusive; i.e., Held_by_E and Held_by_D are mandatorily inclusive.
Box 6
27
Business rule: Every BCU account
must belong to somebody - either
an employee or/and a dependent
Note: The Either both hashline indicates that
the relationship types Held_by_E and
Held_by_D are either
1. optionally mutually inclusive; (if a joint
account)
2. optionally mutually exclusive. i.e., (If
individual account)
20
EMPLOYEE
DEPENDENT
BCU_ACCOUNT
Dependent_of
Held_by_D
Supervised_by
n
n
1
1
1
Held_by_E
1
m
28
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.3 Presentation Layer ER diagram for Bearcat, Incorporated
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
Business rule: Every BCU account
must belong to somebody - either an
employee or/and a dependent.
Note: Role names included in
every relationship edge
Business rule: Either Pl_name
or Pnumber must be present.
Please Note !!
Not reflected in ERD:

Business Rule: Every BCU account must belong to at
least an employee or a dependent, and if held jointly,
must belong to an employee and his/her dependent
not an employee nor the dependent of any other
employee.

Added to the Semantic Integrity Constraints


29
30












Bearcat Incorporated sponsors recreational opportunities for the dependents of
employees in order to nurture the hobbies of the dependents. Some dependents need
not have a hobby, however, it is possible that some dependents may have several
hobbies. Because some hobbies are not as popular as others, every hobby need not
have participants. If a dependent is no longer in the database, all records of the
participation of that dependent in hobbies should not exist in the database either.
Finally, as long as at least one dependent participates in a hobby, that hobby should
continue to exist.

HOBBY Participates
n m
EMPLOYEE
Dependent_of
DEPENDENT
n
1

Note: The relationship shown models the italicized text
Presentation Layer
Semantic Integrity Constraints

Semantic integrity constraints are grouped into the
following categories:
Attribute level business rules
Entity level business rules
Business rules governing entity deletion
Miscellaneous business rules
Ambiguities requiring clarification
31
Start Night
32

Attribute-Level Business Rules (Domain Constraints)
1) Each plant has a plant number that ranges from 10 to 20.
2) The gender of each employee or dependent is either
male or female.
3) Project numbers range from 1 to 40.
4) Project locations are confined to the cities of Bellaire,
Blue Ash, Mason, Stafford, & Sugarland.
5) Account types are coded as C checking account, S
savings account, I investment account.
6) A hobby can be either I indoor activity or O outdoor
activity.
7) A hobby can be a G group activity or I individual
activity.

Table 3.1: Semantic integrity constraints for
the Presentation Layer ER Model
33

Entity-Level Business Rules (apply to individual entity instance)
1) A mother or daughter dependent must be a female, a father or son
dependent must be a male, and a spouse dependent can be either
male or female.
2) An employee cannot be his or her own supervisor.
3) A dependent may have a joint account only with an employee of
Bearcat Incorporated to whom he or she is related.
4) Every plant is managed by an employee who works in the same
plant.
Miscellaneous Business Rules (apply to multiple entity types or
multiple entity instances within a given entity type)
1. Each plant has at least three buildings.
2. Each plant must have at least 100 employees.
3. The salary of an employee cannot exceed the salary of the
employees supervisor.
Table 3.1: Semantic integrity constraints (contd.)
A plant with employees cannot be closed down.

If an employee is deleted, all BCU accounts of that particular employee must
be deleted.

If a plant is closed down, the projects undertaken by that plant cannot be
canceled. The project assignments from a closed plant must be temporarily
removed in order to allow the project to be transferred to another plant.

The Human Resources Department uses a designated default employee
number to replace a supervisor who leaves the company.

An employee currently managing a plant cannot be deleted from the
database.

If a plant is closed down, the employee no longer manages the plant but
becomes an employee of another plant.

34
Business Rules Governing Entity Deletion
If an employee leaves the company, all dependents and BCU accounts of the
employee must be removed.

As long as a dependent has a BCU account, deletion of the dependent is
prohibited.

As long as an employee is assigned to a project, his or her record cannot be
removed from the database.

If a project is deleted, all assignments of employees to that project must be
deleted.

If a dependent is deleted, all records of the participation of that dependent in
hobbies must be deleted.

A hobby with at least one dependent participating in it cannot be deleted.

35
Business Rules Governing Entity Deletion (Contd.)
36
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.3
Presentation Layer ER diagram for Bearcat, Incorporated Stage 1
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
Deletion constraints yet
to be incorporated!!
37
R
C
C
C
C
R
R
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1
1
1
1
1
m
worker
managed by
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.4
Presentation Layer ER diagram for Bearcat, Incorporated Stage 2
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
R D
C
N
R
Deletion constraints in place!!
38
R
C
C
C
C
R
R
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1
1
1
1
1
m
worker
managed by
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.4
Presentation Layer ER diagram for Bearcat, Incorporated Stage 2
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
R D
C
N
R
Deletion constraints in place!!
If a plant is closed down, the projects undertaken by that plant cannot be
canceled. The project assignments from a closed plant must be temporarily
removed in order to allow the project to be transferred to another plant.
Note: Honoring this rule entails relaxation of the requirement (Section 3.1) that a
project is always under control of a plant.

Total participation of plant in Undertaken_by

*
If an employee leaves the company, all dependents and BCU
accounts of the employee must be removed.

**
As long as a dependent has a BCU account, deletion of the
dependent is prohibited.
Note: Rule * cannot be honored for dependents that have an
account at BCU because Rule ** prohibits deletion of such
dependents.

39
Deletion Rules conflicts
40
R
C
C
C
C
R
R
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.4
Presentation Layer ER diagram for Bearcat, Incorporated Stage 2
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
R D
C
N
R
1. deletion rule on undertaken_by conflicts with the
participation constraint of PROJECT

2. Contradicting deletion rules on DEPENDENT
41
R
C
C
C
C
R
R
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Figure 3.5
Presentation Layer ER diagram for Bearcat, Incorporated - Final
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
managed by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
R D
C
N
C
Conflicting deletion constraints resolved!!
1. Set Project participation to Partial
2. Cascade delete of BCU_ACCOUNT
42
Table 3.1b Semantic integrity constraints for the Presentation Layer ER Model - Final
Attribute-Level Business Rules
1. Each plant has a plant number that ranges from 10 to 20.
2. The gender of each employee or dependent is either male or female.
3. Project numbers range from 1 to 40.
4. Project locations are confined to the cities of Bellaire, Blue Ash, Mason, Stafford, and
Sugarland.
5. Account types are coded as C checking account, S savings account, I investment
account.
6. A hobby can be either I indoor activity or O outdoor activity.
7. A hobby can be a G group activity or I individual activity.

Entity-Level Business Rules
1. A mother or daughter dependent must be a female, a father or son dependent must be a male,
and a spouse dependent can be either male or female.
2. An employee cannot be his or her own supervisor.
3. A dependent may have a joint account only with an employee of Bearcat Incorporated to
whom he or she is related.
4. Every plant is managed by an employee who works in the same plant.

Miscellaneous Business Rules

1. Each plant has at least three buildings.
2. Each plant must have at least 100 employees.
3. The salary of an employee cannot exceed the salary of the employees supervisor.
Major Themes
Presentation Layer ER Diagram Part 1
Presentation Layer ER Model Complete
Design-Specific ER Model Part 1
Design-Specific ER Model Complete


43
44
Application of ER Modeling Grammar
Presentation Layer ER Model/Schema
Presentation Layer
Constraint Specifications
Presentation Layer
ER Diagram
Design-Specific ER Model/Schema
Design-Specific
ER Diagram
Design-Specific
Constraint Specifications
Figure 3.1: Conceptual modeling method using the ER modeling grammar

Not an Art any more more of an Engineering

Systematic process

Target Audience: Database Designer/Administrator

Still Technology-independent


45
Design-specific ER Model
(Technology-Independent Modeling Tool)
Design-Specific ER model
{List of tasks}
1) Introduce a technically more precise notation, viz.,
[min, max] notation - for expressing the structural
constraints of a relationship type
2) Transform ER constructs preparatory to logical
model mapping
1) Decomposition of Multi-valued attribute
2) Decomposition of m:n cardinality constraint (ratio)
3) Compile a list of attributes & attribute charteristics
4) Map attribute characteristics [Data Type, Size] to
the ER diagram
5) Generate an updated list of Semantic Integrity
Constraints

46
47
Example: Cardinality Ratio of m:n
c1

c2

c3
c4
c5

e1

e2


e3

e4

r1
r2
r3
r4
r5
r6
CERTIFICATION
Certificate
Instance Diagram
EMPLOYEE
CERTIFICATION EMPLOYEE Held_by_E
n m
(a)
'Look Across' (Chen's) Notation for a Binary Relationship
CERTIFICATION EMPLOYEE Held_by_E
(0,n)
(b)
'Look Near' ([min, max]) Notation for a Binary Relationship
(1,m)
Note: One relationship instance
cannot connect more than one
pair of the entity types
A technically more precise [min, max] notation for
the structural constraints of a relationship type

48
BCU_ACCOUNT EMPLOYEE Held_by_E
1 m
(a)
'Look Across' (Chen's) Notation for a Binary Relationship
(c)
'Look near' (min, max) notation for a binary relationship
BCU_ACCOUNT EMPLOYEE Held_by_E
(0,m) (1,1)
49
R
C
C
C
N
C
R
n
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BANK ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1
1
1
1
1
m
worker
employer
Controlled
Assignee
Assignment
Usage
Account Holder
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
20
1
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
manager
Account of
Supervised_by
Held_by_E
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Account_id
n
n
n
m
n
m n
HOBBY
Participates
Participant
n
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
1
1 1
1
1
1
1
m
worker
m
anaged by
employer
Responsible
Controlled
Assignee
Assignment
Usage
Account Holder
Belongs to
Holder of
Supervisee
Supervisor
Depends_on
Having
Dependent
R D
C
N
C
Figure 3.5 Presentation Layer ER diagram
for Bearcat, Incorporated - Final
D
R EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Assigned
Dependent_of
Held_by_D
(1, 1)
Supervised_by
(100, n)
(1,1)
(0,1)
(0, n)
(1, m)
(0,1)
(0,n)
(0, n)
(1, 1)
(0, 1)
(0, 20)
(0, n)
(0,1)
Held_by_E
(0,m)
(0,1)
Fname
Gender
Emp#
Salary
Address
Name
Lname
Minit
Date_hired
Pl_name
Pnumber
Budget
Building
No_of_employees
Mgr_start_dt
Hours
Plocation
Pnumber
Pr_name
Related_how
Gender
Birthdate
Dname
Balance
Account_id
Acct_type
Account#
C
C
C
C
N
R
C
HOBBY
Participates
(0,m)
(0, n)
C
R
Annual_cost
Hrs_per_wk
Hb_name
Gi_activity
Io_activity
Name_tag
No_of_dependents
- - - - - - - -
Dependent
N
Figure 3.5 Design Specific ER diagram for
Bearcat, Incorporated - Final
50
Compile a list of attributes & attribute charteristics
Entity/Relationship
Type Name Attribute Name Data Type Size Domain Constraint
PLANT Pl_name Alphabetic 30
PLANT Pnumber Numeric 2 Integer values from 10 to 20.
PLANT Budget Numeric 7
PLANT Building Alphabetic 20
PLANT No_of_employees Numeric 7
EMPLOYEE Emp# Alphanumeric 6 ANNNNN, where A can be letter and NNNNN is a combination of five digits
EMPLOYEE Fname Alphabetic 15
EMPLOYEE Minit Alphabetic 1
EMPLOYEE Lname Alphabetic 15
EMPLOYEE Name_tag Numeric 1 Integer values from 1 to 9.
EMPLOYEE Address Alphanumeric 50
EMPLOYEE Gender Alphabetic 1 M or F
EMPLOYEE Date_hired Date 8
EMPLOYEE Salary Numeric 6 Ranges from $35,000 to $90,000
EMPLOYEE No_of_dependents Numeric 2
Managed_by Mgr_start_dt Date 8
DEPENDENT Dname Alphabetic 15
DEPENDENT Related_how Alphabetic 12
DEPENDENT Birthdate Date 8
PROJECT Pr_name Alphabetic 20
PROJECT Pnumber Numeric 2 Integer values from 1 to 40.
PROJECT Plocation Alphabetic 15 Bellaire, Blue Ash, Mason, Stafford, Sugarland
Assigned Hours Numeric 3
BCU_ACCOUNT Balance Numeric (8.2)*
BANK ACCOUNT Account# Alphanumeric 6
BCU_ACCOUNT Acct_type Alphabetic 1 C=Checking Acct., S=Savings Acct., I=Investment Acct.
HOBBY Hb_name Alphabetic 20
HOBBY Io_activity Alphabetic 1 I=Indoor Activity, O=Outdoor Activity
HOBBY Gi_activity Alphabetic 1 G=Group Activity, I=Individual Activity
Participates Hrs_per_wk Numeric (2.1)*
Participates Annual_cost Numeric 6
*(n1.n2) is used to indicate n1 places to the left of the decimal point and n2 places to the right of the decimal point
51
D
EMPLOYEE PLANT
PROJECT
Works_in
Managed_by
Undertaken_by
Supervised_by
(0,1)
(0,1)
(0, 1)
(0, 20)
[A,20]
Fname
Emp#
[N,6]
Salary [X,50]
Address
Name
[A,20]
Lname
[A,1]
Minit
[Dt,8]
Date_hired
[A,30]
Pl_name
[N,7]
Budget
[N,3]
No_of_employees
[Dt,8]
Mgr_start_dt
[N,2]
Pnumber
N
[N,1]
Name_tag
[N,2]
No_of_dependents
R
(100, n)
(1,1)
(0,1)
(0,1)
(0,n)
(0, 1)
(0, 20)
[A,20]
Fname
Emp#
[N,6]
Salary [X,50]
Address
Name
[A,20]
Lname
[A,1]
Minit
[Dt,8]
Date_hired
[A,30]
Pl_name [N,2]
Pnumber
[N,7]
Budget
[N,3]
No_of_employees
[Dt,8]
Mgr_start_dt
[N,2]
Pnumber
[N,1]
Name_tag
[N,2]
No_of_dependents
N
[A,1]
Gender
[N,5]
Emp_n
[A,1]
Emp_a
[A,15]
Plocation
[A,20]
Pr_name
[N,2]
Building
Assigned
Hours
(0,n)
(
1
,
m
)
R
C
(1,1)
C
1) Map attribute characteristics [Data Type, Size] to the ER diagram
Entity Level Domain Constraints
A mother or daughter dependent must be a female, a father or son
dependent must be a male, and a spouse dependent can be either
gender.
An employee cannot be his or her own supervisor.
A dependent may have a joint account only with an employee of Bearcat
Incorporated to whom he or she is related.
Every plant is managed by an employee who works in the same plant.

Remaining Miscellaneous Constraints
Each plant has at least three buildings.
The salary of an employee cannot exceed the salary of the employees
supervisor.
52
Table 3.2: Semantic integrity constraints for
the Design-Specific ER model (Contd.)
53
Original PLANT Data Set

Pnumber Plname Budget Building
10 Underwood 3000000 1
2
3
11 Garnett 3000000 1
2
12 Belmont 3500000 1
13 Vanderbilt 3500000 1
2
Business rule: Either Pnumber or Plname must be present
Building a Multi-valued attribute
Figure 3.10 (a) Transformation of a multi-valued attribute to a single-valued attribute
PLANT
Plname
Pnumber
Building
Budget
54
Original PLANT Data Set

Pnumber Plname Budget Building
10 Underwood 3000000 1
2
3
11 Garnett 3000000 1
2
12 Belmont 3500000 1
13 Vanderbilt 3500000 1
2
Revised PLANT Data Set
Pnumber Plname Budget
10 Underwood 3000000
11 Garnett 3000000
12 Belmont 3500000
13 Vanderbilt 3500000
Revised
BUILDING
Data Set
Building
1
2
3
1
2
1
1
2
Figure 3.10(b)
Mapping a multivalued attribute to a weak entity type
[A Structural Alternative to Figure 3.10(a)]
PLANT
Plname
Pnumber
Budget
Houses BUILDING
Building
n 1
PLANT
Plname
Pnumber
Building
Budget
Transformation of a Multi-valued attribute
{A structural alternative}
Major Themes
Presentation Layer ER Diagram Part 1
Presentation Layer ER Model Complete
Design-Specific ER Model Part 1
Design-Specific ER Model Complete


55
Also called a composite entity type or a bridge entity type.
56
Decompose an m:n relationship type
(by creating a gerund entity type)
(a)
An m:n relationship between EMPLOYEE and PROJECT
Figure 3.10 Resolution of m:n cardinality ratio
(b)
Decomposition of Assigned relationship type to eliminate m:n cardinality ratio
EMPLOYEE
(1,n) (1,m)
Assigned PROJECT
EMPLOYEE
(1,n) (1,1)
Uses ASSIGNMENT
Belongs to
PROJECT
(1,1) (1,m)
57
Patient_no Last_name First_name Gender Age Admit_date Room Bed
7642 Davis Bill M 27 7/10/96 108 B
2222 Grimes David M 44 7/12/96 100 A
7384 Lisauckis Ho M 69 7/22/96 108 A
9182 Hargrove Jane F 21 7/25/96 105 A
1678 Robinson Nancy F 57 7/1/96 111 B
8222 Smith Robin F 27 5/22/96 117 B
1772 Adams Sam M 58 7/10/96 117 A
7456 Baker Megan F 31 7/24/96 111 A
4111 Cox Jim M 35 5/13/96 102 B
Medication_code Medication_desc On_hand On_order Unit_cost
TAG Tagament 53000 0 3
VIB Vibramycin 37000 23000 1.5
KEF Keflin 29000 41000 2.5
ASP Aspirin 123000 0 0.02
PCN Penicillin 370000 0 0.4
VAL Valium 31000 0 0.75
Dosage
Freq
3 1
2 2
2 2
2 1
2
2 1
2 3
3 1
2 1
3 1
2 2
2

PATIENT


MEDICATION


Prescribed

Can Dosage and Frequency be added to the PATIENT
data set or the MEDICATION data set ?!
PATIENT MEDICATION
(b)
An m:n relationship in [min, max] (Look-near) Notation
(1,m) (0,n)
Prescribed
Dosage Freq
m:n relationship type: an example
If NO, why not?!
58
Patient_no Last_name First_name Gender Age Admit_date Room Bed
7642 Davis Bill M 27 7/10/96 108 B
2222 Grimes David M 44 7/12/96 100 A
7384 Lisauckis Ho M 69 7/22/96 108 A
9182 Hargrove Jane F 21 7/25/96 105 A
1678 Robinson Nancy F 57 7/1/96 111 B
8222 Smith Robin F 27 5/22/96 117 B
1772 Adams Sam M 58 7/10/96 117 A
7456 Baker Megan F 31 7/24/96 111 A
4111 Cox Jim M 35 5/13/96 102 B
Medication_code Medication_desc On_hand On_order Unit_cost
TAG Tagament 53000 0 3
VIB Vibramycin 37000 23000 1.5
KEF Keflin 29000 41000 2.5
ASP Aspirin 123000 0 0.02
PCN Penicillin 370000 0 0.4
VAL Valium 31000 0 0.75
Patient_no Medication_code Dosage
Freq
1772 VIB 3 1
7384 VIB 2 2
1772 KEF 2 2
2222 TAG 2 1
1678 TAG 2
1772 VAL 2 1
7456 KEF 2 3
7642 PCN 3 1
7642 VAL 2 1
7384 KEF 3 1
7642 ASP 2 2
ASP 2
Decomposition of Prescribed relationship type to eliminate m:n cardinality ratio
PATIENT PRESCRIPTION MEDICATION
Dosage
Is_for Given_to
(0,n) (1,m) (1,1) (1,1)
Freq
PATIENT MEDICATION
(b)
An m:n relationship in [min, max] (Look-near) Notation
(1,m) (0,n)
Prescribed
Dosage Freq
The second Example (Contd.)

PATIENT


MEDICATION


Prescribed

Gerund entity type



Decomposition of an m:n relationship type
59
{by creating a gerund entity type}
PATIENT MEDICATION
(a)
An m:n relationship in [min, max] (Look-near) Notation
(1,m) (0,n)
Prescribed
Dosage Freq
Decomposition of Prescribed relationship type to eliminate m:n cardinality ratio
PATIENT PRESCRIPTION MEDICATION
Dosage
Is_for Given_to
(0,n) (1,m) (1,1) (1,1)
Freq
Gerund entity type
Weak entity type & gerund entity type
Weak entity type

Gerund entity type
A genuine entity type reflecting
the modeling of a user-specified
business rule
Must have a partial key
(discriminator) atomic or
composite
May have other single-valued
attributes
Results from the transformation
of a multi-valued attribute of an
entity type or a relationship type

An artificial entity type
reflecting the transformation of
a m:n relationship type
Presence of a partial key is
impossible presence implies a
modeling error
May have other single-valued
attributes
Results from the decomposition
of an m:n relationship type

60
61
D
R
EMPLOYEE PLANT
PROJECT
DEPENDENT
BCU_ACCOUNT
Works_in
Managed_by
Undertaken_by
Held_by_D
Supervised_by
(100, n)
(1,1)
(0,1)
(3, n)
(0,1)
(0,n)
(0, n)
(1, 1)
(0, 1)
(0, 20)
Held_by_E
(0,m)
[A,20]
Fname
[A,1]
Gender
Emp#
[N,6]
Salary [X,50]
Address
Name
[A,20]
Lname
[A,1]
Minit
[Dt,8]
Date_hired
[A,30]
Pl_name
[N,2]
Pnumber
[N,7]
Budget
[A,20]
Building
[N,3]
No_of_employees
[Dt,8]
Mgr_start_dt
[N,3]
Hours
[A,15]
Plocation
[N,2]
Pnumber
[A,20]
Pr_name
[A,12]
Related_how
[Dt,8]
Birthdate
[A,15]
Dname
[N,8.2]
Balance
Account_id
[A,1]
Acct_type
[X,6]
Account#
C
C
C
C
N
R
(1,m)
C
R
[N,6]
Annual_cost
[N,2.1]
Hrs_per_wk
[A,20]
Hb_name
[N,1]
Name_tag
[N,2]
No_of_dependents
- - - - - - - -
BUILDING
- - - - -
ASSIGNMENT
(1,1)
Houses
Belongs_to
Uses
D
(1, m)
(1, 1)
(1, 1)
R
C
Dependent
Includes_D
Includes_H
HOBBY
PARTICIPATION
(1, 1)
[A,1]
Prefix
[A,5]
Suffix
R
DEPENDENT
Dependent_of
(100, n)
(1,1)
(0,1)
(0, n)
(3, n)
(0,1)
(0,n)
(0, n)
(1, 1)
(0, 1)
(0, 20)
(0, n)
(0,1)
Held_by_E
(0,1)
[A,20]
Fname
[A,1]
Gender
Emp#
[N,6]
Salary [X,50]
Address
Name
[A,20]
Lname
[A,1]
Minit
[Dt,8]
Date_hired
[A,30]
Pl_name
[N,2]
Pnumber
[N,7]
Budget
[A,20]
Building
[N,3]
No_of_employees
[Dt,8]
Mgr_start_dt
[N,3]
Hours
[A,15]
Plocation
[N,2]
Pnumber
[A,20]
Pr_name
[A,12]
Related_how
[A,1]
Gender
[Dt,8]
Birthdate
[A,15]
Dname
Account_id
C
(o, m)
(0, n)
[N,6]
Annual_cost
[N,2.1]
Hrs_per_wk
[A,20]
Hb_name
Gi_activity
[A,1]
Io_activity
[A,1]
[N,1]
Name_tag
[N,2]
No_of_dependents
- - - - - - - -
- - - - -
(1,1)
(1, m)
(1, 1)
(1, 1)
Dependent
PARTICIPATION
(1, 1)
[N,5]
Emp_n
[A,1]
Emp_a
(1, 1)
N
(1,1)
Design-Specific ER diagram for bearcat Inc. - Final
All tasks fulfilled
Gerund entity type
Resolve m:n
relationship type
Assigned
weak entity type
Resolve multi-
valued attribute
Bulding

> Constraint PLANT.Pnumber IN (10 through 20)
> Constraint Nametag IN (1 through 9)
> Constraint Gender IN (M, F)
> Constraint Salary IN (35000 through 90000)
> Constraint PROJECT.Pnumber IN (1 through 40)
> Constraint Plocation IN (Bellaire, Blue Ash, Mason, Stafford, Sugarland)
> Constraint Acct_type IN (C, S, I)
> Constraint Io_activity IN (I, O)
> Constraint Gi_activity IN (G, I)
> Constraint Related_how IN (Spouse) OR
IN ((Mother, Daughter) AND Gender IN (F)) OR
IN ((Father, Son) AND Gender IN (M))
Constraints Carried Forward to Logical Design
1. An employee cannot be his or her own supervisor.
2. A dependent can have a joint account only with an employee of Bearcat Incorporated with
whom he or she is related.
3. The salary of an employee cannot exceed the salary of the employees supervisor.
4. Every plant is managed by an employee who works in the same plant.
62
Table 3.4: Semantic integrity constraints for the
Final Design-Specific ER model
Questions ?!
63
Revisit 1:n relationships
64
COMMERCIAL_
FLIGHT
AIRCRAFT
used in
flies PILOT
(1, n)
(1, 1)
(0, 1)
Aircraft_number
Purchase_date
Aircraft_type
Pilot_id
Pilot_name
Qualification
Certified_date
(0, m)
Destination
Origin
Flight_numbar
Flight_id
Flight_date
Data set Instances and relationships
among AIRCRAFT, PILOT & COMMERCIAL_FLIGHT
65
AIRCRAFT
Aircraft_Number Aircraft_Type Purchase_Date
12476J DC10 20031201
16341L B747 19950323
17821C DC9 19870515
18407T B767 19850221
18495S DC9 20010909
21342L DC10 20031201
21667J B747 19950323
21741L DC10 19970220
22321B DC9 19870310
30416B DC9 19970316
32341L B767 19850403
36511A B767 19850411
47521L DC10 19930412
7465C DC10 19970224
82144B B747 19970522
PILOT
Pilot_Name Pilot_ID Qualification Certified_Date
Susan Baker 131496 DC10 01181997
Harry Daldwell 182612 B767 03181995
Sherry Wilson 312643 DC10 01242007
Judy Lewis 334613 B747 02122005
George Tech 361219 DC10 07241997
Mike Nevert 396183 DC9 01241993
Doug West 413099 DC9 12011997
Craig Neal 628541 DC10 01281997
Tom Leslie 653481 DC10 02122005
Mike Nevert 776851 B767 12022001
COMMERCIAL_FLIGHT
Flight_Number Flight_Date Origin Destination
1536 03012011 Chicago Dayton
273 03092011 Memphis Chicago
273 03122011 Memphis Chicago
377 02272011 Atlanta New York
387 02272011 Minneapolis Chicago
428 01242011 Atlanta San Fransisco
452 02282011 Chicago Minneapolis
531 03082011 Detroit Memphis
531 03092011 Detroit Memphis
581 03062011 Detroit Memphis
596 01302011 Atlanta Chicago
694 03122011 Boston Chicago
Aircraft_
Number
18407T
36511A
18495S
32341L
7465C
21741L
18495S
17821C
36511A
18407T
12476J
21342L
Pilot_ID
776851
182612
413099
776851
413099
628541
413099
396183

334613
653481
131496

You might also like