Professional Documents
Culture Documents
Data Modeling & Database Design: ER Modeling - The Method
Data Modeling & Database Design: ER Modeling - The Method
*
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