Data is never added, updated or deleted from a database without a reason. There is always a process which is being applied. This process is sometimes referred to as a business process as it reflects what a business may use the data for. For example consider a member of staff whose data is required within a database.

In order to know what to do with the data we need to answer the following questions

  1. when and why should data be added
  2. What will happen / what updates will happen to the data
  3. When will the data be deleted

In the case of an employee we would most likely add the data when they start working for the company. As such recruitment would be the main time we would add the employee to the database. There are no other times when the data will be added as such we can move onto the next question.

When would an employee change their information. It could be that they have moved or changed their telephone number. It could be that they have got married or changed their name. Or it could be that they have been promoted. This could happen numerous times but would be one or the other of the above. It is not necessary that when you get married you will move and change your name. As such one the following actions can be activated numerous times

  • Change name or
  • Move address or
  • Change telephone number

Finally a employee could be removed from the database. Again there are a number of reasons for this. Note that if they went on maternity / paternity leave they will not be removed from the database.

  • Fired
  • Changed jobs
  • Made redundant

Now that we have a good idea of how a employee will move through the database we can express it as a diagram. The diagram we use is a form of Jackson structured programming diagrams (JSP). The employees diagram is shown below.

The diagram is read in the same way as standard JSP diagrams. Time runs from left to right. As such the first thing to happen to the entity is on the left while the last thing is on the right. In this case recruit is first while leave is last. There is no set time difference between actions. As such it is not used to give exact timelines. It merely shows the sequence of events.

 

Change employee contains three possible actions. The OR operator, shown as an O, says that move address, change name or change phone will be mutually exclusive. That is only one will happen at once. However the change employee box says that it can happen numerous times.

 

The last thing to happen to data is for it to be removed. In this case there is three different reasons why data will be removed. It may seem strange to think about the three different deletions due to the fact that the end result is the same. On the face of things this clearly seems to be the case. However the process which is followed to fire, make redundant or for some one to leave is much different. For example someone who is made redundant may be paid redundancy money. Some one who leaves may be archived just in case they return. Someone who is fired may have an investigation performed and their data frozen. What ever happens it is clear that the three deletions each will approach the matter differently. As such it is important that all requirements are documented.