Sheet 3
Sheet 3
A laboratory has several chemists who work on one or more projects. Chemists
also may use certain kinds of equipment on each project.
Attributes of CHEMIST include chemist_ID, Name, and Phone_ No.
Attributes of PROJECT include Project_ID and Start_Date.
Attributes of EQUIPMENT include Serial_No and Cost.
The organization wishes to record Assign_Date, that is the date when a
given equipment item was assigned to a particular chemist working on a
specified project.
A chemist must be assigned to at least one project and one equipment item.
A given equipment item need not be assigned, and a given project need not
be assigned either a chemist or an equipment item.
Example 2:
Each semester in a college, each student must be assigned an advisor, who helps
students to register for courses.
We must keep track of students, and the assigned advisor for each.
Each student must register for courses with the help of an advisor, but if the
student's assigned advisor is not available, the student may register with any
advisor.
For each registration, we must record the student, and the name of the
advisor with whom the student registered for the current term.
Represent this situation with an E-R diagram.
Example 3:
Develop an ERD for a symphony orchestra. During the discussions you discovered
the entity types that shown in the table below.
A concert season schedules one or more concerts. A particular concert is
scheduled for only one concert season.
For each concert there is one conductor. A conductor may conduct any
number of concerts or may not conduct any concerts.
A soloist performs one or more compositions at one or more concerts.
A concert includes the performance of one or more compositions. A
composition may be performed at one or more concerts or may not be
performed.
Each composition may require one or more soloists or may not require a
soloist. A soloist may perform one or more compositions at a given concert
or may not perform any composition.
The orchestra wishes to record the date when a soloist last performed a given
composition (Date Last Performed).
The season during which a series of concerts will be performed.
CONCERT
Identifier is Opening Date, which includes Month, Day, and
SEASON
Year.
Identified by a Concert Number, and described by the Concert
CONCERT Date, which consists of the following: Month, Day, Year, and
Time. Each concert typically has more than one concert date.
Compositions to be performed at each concert. Identifier is
Composition ID, which consists of the following: Composer
Name and Composition Name. Another attribute is Movement
COMPOSITION
ID, which consists of two parts: Movement Number and
Movement Name. Many, but not all, compositions have
multiple movements.
Person who will conduct the concert. Identifier is Conductor
CONDUCTOR
ID. Another attribute is Conductor Name.
Solo artist who performs a given composition on a particular
SOLOIST concert. Identifier is Soloist ID. Another attribute is Soloist
Name.
Example 4:
An engineering firm with approximately 500 employees. A database is required to
keep track of all employees, their skills, projects assigned, and departments worked
in.
Every employee has a unique number assigned by the firm and is required to
store his or her name and date of birth.
Each employee is given a job title (e.g., engineer, secretary, and so on). An
employee does only one type of job at any given time, and we only need to
retain information for an employee’s current job.
If an employee is currently married to another employee of Projects, the date
of marriage and who is married to whom must be stored. However, no
record of marriage is required if an employee’s spouse is not also an
employee.
There are 11 different departments, each with a unique name and a phone
number.
An employee can report to only 1 department.
To procure various kinds of equipment, each department deals with many
vendors. A vendor typically supplies equipment to many departments.
We are required to store the name and address of each vendor, and the date
of the last meeting between a department and a vendor.
Many employees can work on a project. An employee can work on many
projects (e.g., Southwest Refinery, California Petrochemicals, and so on) but
can only be assigned to at most one project in a given city. For each city, we
are interested in its state and population.
An employee can have many skills (preparing material requisitions,
checking drawings, and so on), but he/she may use only a given set of skills
on a particular project. (For example, an employee MURPHY may prepare
requisitions for the Southwest Refinery project and prepare requisitions as
well as check drawings for California Petrochemicals). Employees use each
skill that they possess in at least one project.
Each skill is assigned a number, and we must store a short description of
each skill.
Projects are distinguished by project numbers, and we must store the
estimated cost of each project.
We assume that a Vendor will be tracked in our database even if they have not
participated in a Buys_From relationship with a department, hence, the 0:M
cardinality next to Department in the diagram. This permits the tracking of a
Vendor in our database prior to the first transaction with us.
We assume that we may set up a department in our company that may not yet
have employees assigned to it. Thus, the 0:M cardinality next to Employee on
the Belongs_To relationship between Employee and Department.