Sheet 1
Sheet 1
Draw an ERD for each of the following situations. (If you believe that you need to
make additional assumptions, clearly state them for each situation).
a. A company has a number of employees. The attributes of EMPLOYEE
include Employee_ID, Name, Address, and Birthdate.
b. The company also has several projects. Attributes of PROJECT include
Project_ID, Project_Name, and Start_Date.
c. Each employee may be assigned to one or more projects, or may not be
assigned to a project. A project must have at least one employee assigned
and may have any number of employees assigned.
d. An employee's billing rate may vary by project, and the company wishes to
record the applicable billing rate (Billing_Rate) for each employee when
assigned to a particular project.
Example 2:
A college course may have one or more scheduled sections, or may not have a
scheduled section.
a. Attributes of COURSE include Course_ID, Course_Name, and Units.
b. Attributes of SECTION include Section_Number and Semester_ID.
Semester_ID is composed of two parts: Semester and Year. Section_Number
is an integer (such as "1" or "2") that distinguishes one section from another
for the same course but does not uniquely identify a section.
Example 3:
A bank records information about it’s customers and their accounts. A specific account
can have many owners (customers), and a specific customer can own an arbitary
number of accounts.
Information about customers include their social security number (SSN), phone
number, name and address.
Information about accounts include account number, type, and balance.
Example 4:
A hospital has a large number of registered physicians.
a. Attributes of PHYSICIAN include Physician_ID, and Specialty.
b. Patients are admitted to the hospital by physicians. Attributes of PATIENT
include Patient_ID, and PatiencName.
c. Any patient who is admitted must have exactly one admitting physician. A
physician may optionally admit any number of patients.
d. Once admitted, a given patient must be treated by at least one physician. A
particular physician may treat any number of patients, or may not treat any
patients.
e. Whenever a patient is treated by a physician, the hospital wishes to record
the details of the treatment (Treatment_Detail). Components of
Treatment_Detail include Date, Time, and Results.
Example 5:
The loan office in a bank receives from various parties requests to investigate the
credit status of a customer.
a. Each credit request is identified by a Request_ID and is described by a
Request_Date and Requesting_Party_Name.
b. The loan office also received results of credit checks. A credit check is
identified by a Credit_Check_ID and is described by the Credit_Check_Date
and the Credit_Rating.
c. The loan office matches credit requests with credit check results. A credit
request may be recorded before the check result arrives; a particular credit
result may be used in support of several credit requests. Draw an ERD for
this situation.
d. Now, assume that credit results may not be reused for multiple credit
requests. Redraw the ERD for this new situation using two entity types
e. Redraw it again using one entity type.
Example 6:
Companies are identified by Company_ID and described by Company_Name and
Industry_Type. These companies hire consultants, identified by Consultant_ID and
described by Consultant_Name and Consultant_Specialty, which is multivalued.
a. Assume that a consultant can work for only one company at a time, and we
need to track only current consulting engagements. Draw an ERD for this
situation.
b. Now, consider a new attribute, Hourly Rate, which is the rate a consultant
charges a company for each hour of his or her services. Redraw the ERD to
include this new attribute.
c. Now, consider that each time a consultant works for a company, a contract is
written describing the terms for this consulting engagement. Contract is
identified by a composite identifier of Company_ID, Consultant_ID, and
Contract_Date. Assuming that a consultant can still work for only one
company at a time, redraw the ERD for this new situation. Did you move
any attributes to different entity types in this latest situation?