Anonymous

How Do I Draw Entity Relationship Diagrams and Data Flow Diagrams?

3

3 Answers

Samuel Chiltern Profile
Samuel Chiltern answered
Definitions

Before attempting to draw an Entity Relationship Diagram (ERD) and a Data Flow Diagram (DFD), it is important to make sure that you know the difference between the two.

The DFD outlines the functions and processes of the system being studied, and will depict the flow of data from one process to another.

An ERD describes data objects (i.e. Database tables) within the system.

All of the diagrams you produce will need to include the following four key elements:

  1. Actors - these produce data. Consider them an input into the system.
  2. Processes - these act upon the data, modifying it in some way.
  3. Data flows - these indicate the flow of data from one place to another.
  4. Data stores - this is where data is held, once it has entered the system and been processed.

Process
  1. You already have a target system to analyse, so you have a good place to start. The first thing to do is to identify the four key elements (listed above) within your system. Just write it all down on paper for now.
  2. Using a square box, place the initial actor at the top.
  3. Draw a data flow arrow from this actor to the initial process.
  4. Add more processes and arrows as necessary. Remember that data can flow in both directions simultaneously, but you must mark where data changes its form (e.g. From paper record to electronic).
  5. The flow will end when the data ends up in a storage system - which can be physical or electronic. Entities which only receive data must be labelled as 'storage', otherwise they will be considered an 'actor'.
  6. When you're happy that the diagram is complete, review it, and then you may transfer it into a diagramming program, such as Microsoft Visio.
Ellie Hoe Profile
Ellie Hoe answered
You can make an ERD using various tools such as Microsoft Visio, Paint, Powerpoint or paper. The most important thing is to know how to draw an ERD.

Consider the following rules:

  • Draw entities in the form of rectangles. For example, if you want to show a student or organization as an entity, draw a rectangle labelled 'student' or 'organization'. 
  • Draw attributes of entities in the form of circles, so if for example you want to depict a student's age, draw a circle labelled 'student age'.
  • Connect the circle with entity (rectangle) by means of flow line.
  • If you want to show relationships between different entities, use the diamond symbol to show the relationships. For example, a student has an academic record, so you will use a diamond symbol to link the two rectangles i.e student and academic record.     
  • The key is to establish the relationships between the entities.
Anonymous Profile
Anonymous answered
An ER Diagram is often used to plan and communicate information about how a database is structured, so people creating the database and using the database will understand how the data is inter-related. 

A good basic explanation (with some examples of ER diagrams) can be found on the Wikipedia page: en.wikipedia.org. Before drawing an ER diagram, you must first understand how data in the database is related.  A well-designed database is one that minimizes the space used, maximizes performance, and minimizes fields of "Not Applicable" data. 

Thus, different tables are created in a database containing objects.  The objects can be associated with zero, one, or many other pieces of data. 

For example, let's say you are working at a vet's office and creating a database to contain customer information. 

Your customers may have one or more pets of varying types.  You will need to store information about the customer themselves (such as their name, phone number, etc), and information about any pets that they might have (such as the pet's name, shots, whether the pet is neutered or not, etc). 

It would be possible to design this database so that for every one customer, they may have one or more pets.  This is called a one-to-many relationship. 

The database might also keep track of an owner's alternative emergency contact, which each customer is allowed to have one of.  This would be an example of a one-to-one relationship. 

You must first identify these relationships between objects in your database, before you can draw your ER diagram.   

Once you have identified the relationships between the objects, start drawing the objects on your paper in rectangles. 

For example, you may put "Customer" in one rectangle and "Pet" in another rectangle. Now think about how these two objects are connected.  Customers own their pets, so put "Owns" in a diamond between Customer and Pet.  From left to right you can read it as: Customer Owns Pet. 

Next, how many customers are related to how many pets? Do multiple customers own one pet?  Does one customer own multiple pets?  Is each customer only allowed to own one pet? 

The answer in this example is one main customer can own multiple pets.  So now you would draw lines on either side of the "Owns" diamond to indicate how many objects there are on each side of the relationship. 

Next to the customer side you would want one line, or possibly a line with the number 1 noted above the line (this depends on what standard of ER diagram you are using). 

Next to the "Pet" side you would want a line that splits into multiple lines, multiples lines, or a line with a "N" above it (this again depends on what standard of ER diagram you are using) -- see the following for examples:  en.wikipedia.org (in the images in the link, the left hand side is the "many" side, and the right hand side is the "one" side -- it would be read "many people can be born in one location").   

Additional information in the ER diagram can be included by connecting words in ovals to the objects they are relevant to. 

In our vet example, information you might want to store about a "Person" includes their name, phone number, address, etc.  Each of these items can be included in the diagram by writing them in ovals, and then drawing lines to "Person" since that is what the data is about.  Here you can see a bigger example:  en.wikipedia.org

There are also many kinds of ER-Diagramming software available.  Once you understand how your database is going to work, the software will let you use consistent-looking symbols to diagram the information about your database. 

This is especially useful if planning and communicating a very large database, which may have a diagram that takes up many pages.  Howeve, you do need to know the basics discussed above to be able to use and understand these tools.

Answer Question

Anonymous