Rules for DFD’s
The DFD as an analytical tool follows certain rules. These rules
help in achieving the level of
There should be no black
holes, gray holes, miracles.
Do not leave things
the DFD should not
include data flows that are unassociated with the process.
Data Flows cannot be without a process or function being
involved in the flow. Below are given three
diagrams that indicate bad practices. There has to be a process
in between these three diagrams.
For a better understanding of data flow diagram, two diagrams
are drawn for the same process. The
diagram A includes some errors/ violation of rules usually used
and diagram B is the amended picture
how the correct DFD should look like.
The process covered in these diagrams is as follows.
The number of hours
employees have worked is recorded and employee time record is created
stored in employee time file.
information is taken from employee master file which is used along with time
records to calculate gross pay.
The leads to the
calculation of deductions leading to computation of net pay.
Payrolls slips are
printed used for
Record purpose in the
employee master file.
Preparation of checks
Paychecks and a copy of
pay slip is given to the employees.
data store to
entity - or
data store to
The diagram shows the violation of rules along with the relevant
explanation. Below we have corrected the
must be a
can have only
outputs without an
Avoid Black Holes – No
process can have only
inputs without an output
Avoid Gray Holes – process must have
sufficient input to execute
Following corrections have been made:
A process of creation of
employee time record has been added between employee and employee
Directions of processes
have been corrected among employee master file and processes of gross and
net pay calculation.
The presentation of
payroll printing process has been improved.
25.1 Entity Relationship Diagram
"The entity-relationship diagram (ERD) is a data model or
diagram for high-level descriptions of
conceptual data model, and it provides a graphical notation for
representing such data models in the
form of entity-relationship diagrams."
E-R Diagram (E-R model) facilitates database design by allowing
the specification of an “enterprise
schema” which represents the overall logical structure of a
database. The E-R Diagram (E-R model) is
extremely useful in mapping the meanings and interactions of
real-world enterprises onto a conceptual
A company hires many employees, one as a
•An employee can be assigned to one
•One department may have more than one
•Atleast one employee works on a project.
•An employee may work on more than one
projects at a time.
•At one time, an employee may not be working on
Above we have seen a common example of how a company, its
employees, the head of departments,
various projects being worked on are interlinked. ERD can be
drawn with a different perspective as well.
•Only one HOD will head the project.
•A HOD of department may head more than one
•At one time, he may not be heading any project.
The above figure shows a hotel booking system. Various records
have been kept for each entity. However
each entity shares a relationship with for logical purpose. For
instance, the field for room ID has been kept
in reservation for access to further data. User information has
been kept separate, however link has been
made to reservation, session and logs by making user ID common
to all three tables. Such kind of
relationship helps in keeping
An entity is an object that exists and is distinguishable from
other objects. An entity is described using a set
of attributes. For example specific person, company, event,
plant, crop, department, section, cost center.
Entity Set &attributes
An entity set is a set
of entities of the same type that share the same properties
All entities in an
entity set have the same set of attributes, i.e. common characteristics e.g.
names, addresses, date of birth, etc.
Each entity set has a
distinct attribute by which it can be easily identified, e.g. NIC no.,
Bird is an entity
The class of birds is an
The color of birds is an
25.3 Value Sets
Each attribute has a Value Set (domain) i.e. defined parameters
or the range in which value of the attribute
may fall, e.g.
Range of age allowed for employees is between 18 and 60, we can
specify the value set of the age attribute
of the EMPLOYEE to be the numbers between 18 and 60.
There are four types of attributes
Single – a single value
completely defines the attributes. E.g. The figure 27 represents the age
(attribute) of a person (entity)
Composite – More than
one values are required to explain the attribute e.g address includes
house no., street no., postal code, etc for its complete
a. Single – as explained above
b. Multi-valued – Where an attribute can have more than one
value. E.g. An individual may
have qualification. This is an attribute. If a person possesses
more than one qualification
: is a blank read as zero value. E.g. the various
categories of graduation degrees (B.A., B.Com.,
BSc, etc) will apply to graduates and not to non-graduates and
would be read as “Not Applicable”.
: is information provided on the basis of
a unique attribute e.g. customer ID, Employee
ID, Student ID. Relevant dependant information can be
obtained/derived through the said
A relationship is an association among entities. There has to be
a relationship between two entities.
Types of Relationship
One to One– e.g one supervisor controls one department.
Many to One – e.g. More than one employee works in one
Many to Many– More than one employees can work on more than one
Total and partial participation
Total Participation – if ALL entities in an entity set “A” are
related to the entity set “B”. For example, all
employees work for same department or section of the department.
Every employee has to be a part of a
department. No employee can exist in an organization without
being part of a department.
Partial Participation: if SOME (not all) entities in an entity
set “A” are related to the entity set “B”. For
example, employees work on various projects undertaken by the
organization. It is not essential that each
employee should work on every project.