0% found this document useful (0 votes)
24 views5 pages

Lab 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Lab 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Practice: Database system

Lab 1 – Entity Relationship Diagram

Draw an entity relationship diagram (ERD) for the following situations:

Exercise 1. A company has a number of employees. The attributes of Employee include


Emp_ID (identifier), Name, Address, and Birthdate. The company also has several projects.
Attributes of Project include Proj_ID (identifier), project name, and the date it started. Each
employee may be assigned to one or more projects, or may not be assigned to any project. A
project must have at least one employee assigned to it, and may have any number of employees
assigned to it.

An employee’s billing rate may vary by project, and the company wishes to record the applicable
billing rate for each employee when assigned to a particular project.

Exercise 2. A university has a large number of courses in its catalog. Attributes of Course
include Course_Number (identifier), Course_Name, and Credits. Each course may have one or
more different courses as prerequisites, or may have no prerequisites. Similarly, a particular
course may be a prerequisite for any number of courses.

Exercise 3. A university course may have one or more scheduled sections, or may not have a
scheduled section. Attributes of Course include Course_ID (identifier), course name, and number
of credits. 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.

Exercise 4. A laboratory has several chemists who work on one or more projects. Chemists also
may use certain kinds of equipment on each project. (A particular piece of equipment can only
be used on one project at a time.)

The attributes of Chemist include Chemist_ID (identifier), name and Phone number. The
attributes of Project include Project_ID (identifier), project name and the date it started. The
attributes of Equipment include Serial number (identifier) and cost.

Lab 1 – Entity Relationship Diagram 1


Practice: Database system

The system has to record the date when a given equipment item was assigned to a particular
chemist working on a specified project as well as the total number of hours the chemist has used
the equipment for that project.

A chemist must be assigned to at least one project and one equipment item. A given equipment
item need not be assigned either to a chemist or a project, and a given project need not be
assigned either a chemist or an equipment item.

Exercise 5. A hospital has a large number of registered physicians. Attributes of physicians


include Physician_ID (the identifier) and Specialty. Patients are admitted to the hospital by
physicians. Attributes of patients include Patient_ID (the identifier) and Patient_Name. Any
patient who is admitted must have exactly one admitting physician. A physician may optionally
admit any number of patients. 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.
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 Result.

Exercise 6. Consider a MAIL_ORDER database in which employees take orders for parts from
customers. The data requirements are summarized as follows:

● The mail order company has employees, each identified by a unique employee number,

first and last name, and Zip Code.

● Each customer of the company is identified by a unique customer number, first and last

name, and Zip Code.

● Each part sold by the company is identified by a unique part number, a part name, price,

and quantity in stock.

● Each order placed by a customer is taken by an employee and is given a unique order

number. Each order contains specified quantities of one or more parts. Each order has a
date of receipt as well as an expected ship date. The actual ship date is also recorded.

Lab 1 – Entity Relationship Diagram 2


Practice: Database system

Exercise 7. Consider a MOVIE database in which data is recorded about the movie industry.
The data requirements are summarized as follows:

● Each movie is identified by title and year of release. Each movie has a length of minutes.

Each has a production company, and each is classified under one or more genres (such as
horror, action, drama, and so forth).

● Each movie has one or more directors and one or more actors appear in it. Each movie

also has a plot outline.

● Actors are identified by name and date of birth and appear in one or more movies. Each

actor has a role in the movie.

● Directors are also identified by name and date of birth and direct one or more movies. It

is possible for a director to act in a movie (including one that he or she may also direct).

● Production companies are identified by name and each has an address. A production

company produces one or more movies.

Exercise 8. Consider a CONFERENCE_REVIEW database in which researchers submit their


research papers for consideration. Reviews by reviewers are recorded for use in the paper
selection process. The database system caters primarily to reviewers who record answers to
evaluation questions for each paper they review and make recommendations regarding whether
to accept or reject the paper. The data requirements are summarized as follows:

● Authors of papers are uniquely identified by e-mail id. First and last names are also

recorded.

● Each paper is assigned a unique identifier by the system and is described by a title,

abstract, and the name of the electronic file containing the paper.

● A paper may have multiple authors, but one of the authors is designated as the contact

author.

Lab 1 – Entity Relationship Diagram 3


Practice: Database system

● Reviewers of papers are uniquely identified by e-mail address. Each reviewer’s first

name, last name, phone number, affiliation, and topics of interest are also recorded.

● Each paper is assigned between two and four reviewers. A reviewer rates each paper

assigned to him or her on a scale of 1 to 10 in four categories: technical merit, readability,


originality, and relevance to the conference. Finally, each reviewer provides an overall
recommendation regarding each paper.

● Each review contains two types of written comments: one to be seen by the review

committee only and the other as feedback to the author(s).

Exercise 9. Below is the course registration result of a student. Analyze the data requirements
and draw an entity relationship diagram (ERD):

COURSE REGISTRATION RESULT


Semester: II – Year: 2021 - 2022
Student name: Nguyen Van An Student Number: 1400001
Address: Tan Binh district, HCM city
Department: Computer Science & Engineering (Department Number: MT)

Course Course name Group Week Session Room Week Session Room
No. day day (2) (2) (2)
501047 Database system L01 Monday 1-2 204B10 Thursday 3-4 204B10
501082 Systems Analysis L01 Tuesday 5-6 205B10
& Design
500301 Data structures & L02
Algorithms

Exercise 10. A company with approximately 500 employees would like to keep track of all
employees, their skills, assigned projects, and departments in which they work.

Lab 1 – Entity Relationship Diagram 4


Practice: Database system

● Every employee has a unique number, a name, some phone numbers, and date of birth. If

an employee is married to another employee of the firm, the data of the 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. Each employee has a job title, such as:
secretary, engineer… Each employee does only one type of job at a time, and we only
need to retain information about an employee’s current job.

● There are 11 different departments in the company, each with a unique name. An

employee can work for only one department. Each department has a phone number.

● To procure various types of equipment, each department deals with many vendors. A

vendor typically supplies equipment to many departments. We need 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, 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, but they can use only a given set of skills on a

particular project. Employees use each skill that they possess in at least one project. Each
skill is assigned a number, and we will record a short description of each skill.

● Projects are distinguished by project numbers and we must store the estimated cost of

each project. A project is located in one city.

Lab 1 – Entity Relationship Diagram 5

You might also like