Database Systems Lab
Lab Manual (Lab 06)
Topic: Entity Relationship Diagram
Instructor: Mr. Masab Akram (Lab Engineer)
Session: Spring 2024
School of Systems and Technology
UMT Lahore Pakistan
Contents
Objectives.......................................................................................................................................................................3
Pre-requisites...................................................................................................................................................................3
Diagrams.net...................................................................................................................................................................4
Features...........................................................................................................................................................................4
Step by step guide to make an ER diagram....................................................................................................................4
Lab Tasks......................................................................................................................................................................15
Objectives
The purpose of this manual is to get started with ER diagrams. To learn how to make ER diagram of
the scenarios.
Pre-requisites
What is ER model?
What is Entity?
What is Attribute?
What are relationship types?
Diagrams.net
Diagrams.net (formerly known as draw.io) is free online diagram software. You can use it as a
flowchart maker, network diagram software, to create UML online, as an ER diagram tool, to design database
schema, to build circuit diagrams, and more. Using draw.io we can import .vsdx, Gliffy™ and Lucidchart™
files.
Features
Easy to use diagramming tool with extras for power users
Easy to use
Intuitive interface
Extensive shape library
Lots of templates
Drag & drop functionality
Import & export various formats
Automatic layout
High performance
Free & Open Source
Step by step guide to make an ER diagram
1) To use draw.io simply type URL apps.diagrams.net as shown in the screenshot below. Draw.io gives
you option to save your diagrams on cloud. Select the cloud where you want to save the diagram. In the given
below screenshot you can see Google Drive is selected as cloud to save our diagrams.
2) Select the account using which you want to create an account on draw.io as shown in the screenshot below.
3) After step 2 allow the diagrams.net (draw.io) to access you google account. Simply tick the
checkboxes and click on Continue button.
4) Create a folder with any name you like for example Diagrams. In this folder your diagrams will be saved.
5) Now click on Create New Diagram button to create a new diagram.
6) Enter the diagram name by removing Untitled Diagram and select Entity Relationship Diagram as shown
in the screenshot below.
Enter your diagram name here
Select the diagram which
you want to make
7) After step 6 you have to select the folder which you have already created on your Google drive. Click on
No, pick folder button and then select your folder as shown in the screenshot below.
8) Click on Untitled Diagram and change diagram name then click on Rename button as shown in the
screenshot below.
Also you can enter and change diagram name from here
9) Remove the existing diagrams by simply selecting all and then click on delete button from keyboard
because we don’t need the existing diagrams.
10) Click on Entity Relation button you will see all the ERD related shapes as shown in the screenshot.
11) Click on the Entity and drop it in free area as shown in the screenshot below.
12) Write the entity name in the rectangle as shown in the screenshot below.
13) Identify the type of relationship (1:1, 1:M or M:M) between entity A and entity B. After this add the
relationship by simply clicking and then dragging the Relationship shape. Now add the relationship name in
the diamond as shown in the screenshot below.
14) Now add the attributes of each entity by clicking on attributes and then simply drag it. Write the name
of attribute inside the oval shape as shown in the screenshot below.
15) Now add the key attribute of entity. A key attribute uniquely identifies a record. Click on key attribute
shape and drag it to add it. Add the name inside the key attribute as shown in the screenshot below.
16) Similarly add the attributes of Order entity.
Lab
Tasks
1) Draw the ER diagram of the following scenario:
A company has a number of employees. A company has several projects. An Employee is
assigned to many projects and a project is assigned to many employees.
2) Draw the ER diagram of the following scenario:
A team consists of many players. A player plays for only one team.
3) Draw the ER diagram of the following scenario:
A department employs many persons. A person is employed by one department at most.
4) Draw the ER diagram of the following scenario:
A manager manages one department at most. A department is managed by one manager at most.