Professional Documents
Culture Documents
Department of Computing
Objectives
After performing this lab students should be able to:
Tools/Software Requirement
MySQL Community Server 5.6
MySQL Workbench 6.1
Description
1. This lab assumes that MySQL Community Server is running and MySQL Workbench is
loaded.
2. From the bottom of the main Workbench screen, select the plus sign near Models to
create a new E-R diagram.
3. Select (double click) the Add Diagram option. A new tab for the ERD would open.
4. You may click the entity (table) icon from the tool bar and then click an
appropriate portion of the diagram to create a new entity in the model.
6. From the menu, go to Model > Model Options and select Show Caption in the options
for diagram to enable relationship labels.
7. Before modeling an association between two relations, make sure that the target relations
have primary keys. Later, click (DONT DRAG) the relevant association icon from the
toolbar and select first (where foreign key should be added) and then the second relation
(referring to the primary key). In case of many-to-many associate, a new relation would
be created that you may modify.
8. MySQL Workbench doesnt allow to model a single many-to-many association directly
as it creates an associative entity instead, and creates two one-to-many associations.
Lab Task
1. Draw an ERD for the following situation using MySQL Workbench.
a) Deewan Engineering is an auto-parts manufacturing 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. If an employee is currently married to another employee of Deewan, the
date of marriage and who is married to whom must be stored; however, no record
of marriage is required if an employees spouse is not also an employee. 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 employees current job.
b) There are 11 different departments, each with a unique name. An employee can
report to only one department. Each department has a phone number.
c) 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.
Deliverable
Submit the MWB file while designing the ER-D of the model using MySQL Workbench.