Sie sind auf Seite 1von 5

Susan Portugal

Comp520 Advanced Databases


February 23, 2009
Assignment 3
Chapter 6 Problems 4, 5, and 6
Problem 6.4
In Chapter 4, you saw the creation of the Tiny College database design. That design
reflected such business rules as “a professor may advise many students” and “a
professor may chair one department.” Modify the design shown in Figure 4.36 to
include these business rules:
• An employee could be staff or a professor or an administrator.
• A professor may also be an administrator.
• Staff employees have a work level classification, such a Level I and Level II.
• Only professors can chair a department. A department is chaired by only on
professor.
• Only professors can serve as the dean of a college. Each of the university’s
colleges is served by one dean.
• A professor can each many classes.
• Administrators have a position title.
Given that information, create the ERD containing all primary keys, foreign keys,
and main attributes.
Figure 4.36 The completed Tiny College ERD

The following ERD diagram modifies Figure 4.36 with the addition of the business
rules outlined. The figure includes primary keys, foreign keys, and main attributes.
EMPLOYEE
PK EMP_NUM

EMP_LNAME
SCHOOL
EMP_FNAME
EMP_INITIAL PK SCHOOL_CODE STAFF
EMP_E_MAIL
JOB_CODE SCHOOL_NAME PK,FK1 EMP_NUM
EMP_SALARY FK1 PROF_NUM
DEPT_CODE FK1 EMP_NUM STAFF_LNAME
ADMINISTRATOR STAFF_FNAME
is dean of STAFF_INITIAL
PK ADMIN_NUM STAFF_E_MAIL
STAFF_JOB_CODE
ADMIN_LNAME operates
ADMIN_FNAME
ADMIN_INITIAL
ADMIN_E_MAIL
ADMIN_JOB_CODE d
ADMIN_POS_TITLE O employs DEPARTMENT
PK DEPT_CODE
STUDENT LEVEL I LEVEL II
has DEPT_NAME
PK STU_NUM FK1 SCHOOL_CODE PK EMP_NUM PK EMP_NUM
FK2 PROF_NUM PK STAFF_NUM PK STAFF_NUM
FK1 DEPT_CODE FK2 EMP_NUM
STU_LNAME
PROFESSOR
STU_FNAME
STU_INITIAL
advises
PK,FK2 EMP_NUM
STU_EMAIL BUILDING
PK PROF_NUM chairs
FK2 PROF_NUM teaches PK BLDG_CODE
FK2 EMP_NUM FK1 DEPT_CODE
PROF_SPECIALTY BLDG_NAME
PROF_RANK BLDG_LOCATION
PROF_LNAME
ROOM
is written in PROF_FNAME
PROF_INITIAL PK,FK1 BLDG_CODE contains
CLASS PROF_EMAIL PK ROOM_CODE
PK,FK3 CRS_CODE
PK CLASS_CODE is used for ROOM_TYPE COURSE
ENROLL
offers PK CRS_CODE
PK,FK2 CRS_CODE CLASS_SECTION
PK,FK2 CLASS_CODE is found in CLASS_TIME
FK1 PROF_NUM FK1 DEPT_CODE
PK,FK1 STU_NUM CRS_TITLE
FK2 ROOM_CODE generates
FK2 BLDG_CODE CRS_DESCRIPTION
ENROLL_DATE CRS_CREDITS
ENROLL_GRADE FK1 EMP_NUM
Susan Portugal
Comp520 Advanced Databases
February 23, 2009
Assignment 3
Chapter 6 Problems 4, 5, and 6
Problem 6.5
Tiny College wants to keep track of the history of all administrative appointments
(date of appointment and date of termination). (Hint: Time variant data are at
work.) The Tiny College chancellor may want to know how many deans worked in
the College of Business between January 1, 1960 and January 1, 2008 or who the
dean of the College of Education was in 1990. Give that information, create the
complete ERD containing all primary keys, foreign keys, and main attributes.

The following figure includes primary keys, foreign keys, and main attributes.

Current Data

EMPLOYEE
COLLEGE
PK EMP_NUM
PK COLLEGE_ID
EMP_LNAME manages
EMP_FNAME COLLEGE_NAME
EMP_INITIAL FK1 EMP_NUM
EMP_E_MAIL DATE_ASSIGN
JOB_CODE DATE_TERM
EMP_SALARY

Historic Data

EMP_MGR_HIST
COLLEGE_MGR_HIST

ADMIN_HIST

PK,FK1 EMP_NUM
PK,FK2 DEPT_ID
PK DATE_ASSIGN
PK DATE_TERM
Susan Portugal
Comp520 Advanced Databases
February 23, 2009
Assignment 3
Chapter 6 Problems 4, 5, and 6
Problem 6.6
Some Tiny staff employees are information technology (IT) personnel. Some IT
personnel provide technology support for academic programs. Some IT personnel
provide technology infrastructure support. Some IT personnel provide technology
support for academic programs and technology infrastructure support. IT
personnel are not professors. IT personnel are required to take periodic training to
retain their technical expertise. Tiny College tracks all IT personnel training by
date, type, and results (completed vs. not completed). Given that information,
create the complete ERD containing all primary keys, foreign keys, and main
attributes.

The following figure includes primary keys, foreign keys, and main attributes. The
following ERD depicts the IT Department pertaining to the IT Employees.

Current Data

IT EMPLOYEE1
PK EMP_NUM
O
EMP_LNAME
EMP_FNAME
EMP_INITIAL
ACADEMIC PROG1 TECH INF1 IT DEPARTMENT1
EMP_E_MAIL
FK1 DEPT_ID employs PK DEPT_ID
PK,FK1 EMP_NUM PK,FK1 EMP_NUM
JOB_CODE
DATE_ASSIGN DEPT_NAME
EMP_SALARY DATE_ASSIGN

EMP_TRAIN_HIST
Historic Data

TRAINING_HIST1
DEPT_TRAIN_HIST
PK,FK1 EMP_NUM
PK,FK2 DEPT_ID
PK DATE_ASSIGN

JOB_CODE
EMP_SALARY
TRAIN_DATE
TRAIN_TYPE
TRAIN_RESULTS
Susan Portugal
Comp520 Advanced Databases
February 23, 2009
Assignment 3
Chapter 6 Problems 4, 5, and 6
Reference:
Peter Rob and Carlos Coronel. Database Systems : Design, Implementation, and
Management. Boston: Course Technology, 2007.

Das könnte Ihnen auch gefallen