<Previous Lesson

Information Systems

Next Lesson>

Lesson#25

Rules for DFDs

Rules for DFD’s

The DFD as an analytical tool follows certain rules. These rules help in achieving the level of
standardization.
There should be no black holes, gray holes, miracles.
Do not leave things unlabeled
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.
Employee salary 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.
Entity A
Entity B
entity to
entity
data store to
entity - or
reverse
data store to
data store
109
The diagram shows the violation of rules along with the relevant explanation. Below we have corrected the
diagram.
There
must be a
process
between
entity and
data store
Miracle--No process
can have only
outputs without an
input
Avoid Black Holes – No
process can have only
inputs without an output
Avoid Gray Holes – process must have
sufficient input to execute
110

Following corrections have been made:
A process of creation of employee time record has been added between employee and employee
time file.
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
schema.
HIRES
EMPLOYEES DEPARTMENT
PROJECTS HOD
WORK ON
COMPANY
RUN BY
ASSIGNED TO
RUN BY
A company hires many employees, one as a
minimum
111
HIRES
EMPLOYEES DEPARTMENT
PROJECTS HOD
WORK ON
COMPANY
RUN BY
ASSIGNED TO
RUN BY
•An employee can be assigned to one
department only.
•One department may have more than one
employees.
HIRES
EMPLOYEES DEPARTMENT
PROJECTS HOD
WORK ON
COMPANY
RUN BY
ASSIGNED TO
RUN BY
•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
any project.
112
Another ERD
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.
HIRES
EMPLOYEES DEPARTMENT
PROJECTS HOD
WORK ON
COMPANY
RUN BY
ASSIGNED TO
RUN BY
•Only one HOD will head the project.
•A HOD of department may head more than one
project.
•At one time, he may not be heading any project.
113
Room
Room ID
Manager
Building
Room
Description
Status
User
User ID
First
Last
Login
Password
Type
Initials
Status
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

25.2 Entity
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
Reservation
Reservation ID
Room ID
User ID
Date
Start time
End time
Note
Status
Session
Session ID
User ID
Session String
Time Stamp
Log
Log ID
User ID
Time Stamp
In/out

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.,
employee no.

Example
Bird is an entity
The class of birds is an entity set
The color of birds is an attribute

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.
For Example:
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.

Attribute Types
There are four types of attributes

Single / composite :
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 explanation.

Single / multi-valued:
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

Null : 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”.

Derived : 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
attribute.

25.4 Relationships
A relationship is an association among entities. There has to be a relationship between two entities.
115

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 department
Many to Many– More than one employees can work on more than one projects.

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.

<Previous Lesson

Information Systems

Next Lesson>

Home

Lesson Plan

Topics

Go to Top

Next Lesson
Previous Lesson
Lesson Plan
Topics
Home
Go to Top