SE Lab Experiment 3
SE Lab Experiment 3
Rajat Malik
(2K21/CO/370) 1
EXCERCISE NO. 3
AIM: -
To draw a sample ENTITY RELATIONSHIP DIAGRAM for Hall Management System.
Hardware Requirements:
Standard keyboard and mouse, colored monitor, 2GB RAM, 300MB Storage, Latest
Processor
Software Requirements:
THEORY:
Entity Relationship Diagrams are a major data modelling tool and will help organize the
data in your project into entities and define the relationships between the entities. This
process has proved to enable the analyst to produce a good database structure so that the
data can be stored and retrieved in a most efficient manner.
Entity
A data entity is anything real or abstract about which we want to store data. Entity types
fall into five classes: roles, events, locations, tangible things or concepts. E.g., employee,
payment, campus, book. Specific examples of an entity are called instances. E.g. the
employee John Jones, Mary Smith's payment, etc.
Relationship
A data relationship is a natural association that exists between one or more entities. E.g.,
Employees process payments. Cardinality defines the number of occurrences of one
entity for a single occurrence of the related entity. E.g., an employee may process many
payments but might not process any payments depending on the nature of her job.
2
Attribute
1. Identify Entities
The entities in this system are Department, Employee, Supervisor and Project. One is
tempted to make Company an entity, but it is a false entity because it has only one
instance in this problem. True entities must have more than one instance.
3
.
2. Find Relationships
We construct the following Entity Relationship Matrix:
4. Fill in Cardinality
From the description of the problem, we see that:
4
.
7. Identify Attributes
The only attributes indicated are the names of the departments, projects, supervisors and
employees, as well as the supervisor and employee NUMBER and a unique project
number.
8.Attribute
Map Attributes Entity Attribute Entity
Department Department Supervisor Supervisor
Name Number
Employee Employee Supervisor Supervisor
Number Name
Employee Employee Project Project
Name Name
Project Project
Number
5
9. Draw Fully Attributed ERD
6
FURTHER DISCUSSION:
The second symbol gives the maximum number of instances of the entity joining the
connector for each instance of the entity on the other side of the relationship. If there is
only one such instance, this symbol is 1. If more than 1, the symbol is a crows foot
opening towards the rectangle.
If you read it like a sentence, the first entity is the subject, the relationship is the verb, the
cardinality after the relationship tells how many direct objects (second entity) there are.
The key-based ERD has no many-to-many relationships and each entity has its
primary and foreign keys listed below the entity name in its rectangle.
Even if you have no new entities to add to the Key-Based ERD, you still need to
add the attributes to the Non-Key Data section of each rectangle. Adding these
attributes automatically puts them in the repository, so when we use the entity to
design the new system, all its attributes will be available.