In this lecture, we will provide solutions to the exercise questions that we posed in the last section. Recall that we presented two exercises, one on a veterinarian office, and a second related to a time sheet. The first one can now be viewed on the screen. At the top, we have displayed the original exercise with the questions. There were four questions. The first three related to anomalies.
And they answered here. Question one was related to an update anomaly. Question two, a deletion anomaly. And question three a proposed list of entities to meet the criteria displayed in the spreadsheet. Hopefully you attempted to answer these questions. As with only exercise questions, the answer to question four is no displayed.
That is the entities and their relationship. Even though we are not able to call The uses of the system, we can assume that the owner and animal are related and the vet treats the animal and the drawing shows his relations. The original timesheet exercise question now appears on the screen with the first step in the creation of entity relationship diagram that is, the entities are identified. Also in this diagram, data or fields for each entity are listed. Do you agree with these fields? The next screen indicates the relationships of the entities and the cardinality has been added.
That is one to one or one to many or many to many. This is not trivial and you may feel unsure about this. So let me go through the reasoning carefully. We have identified three entities employee project and no You may have some concern on why notes were included. The simple answer is that the end the original term sheet, and we need to capture all the presented data. This notes entity pertains to the employee and project and therefore, both of these letter L elements are related.
Next, the cardinality it makes sense that an employee makes many notes over a period of time. And similarly, there are many notes pertaining to the project. A case could be presented that employees and projects have a relationship which is true, but in this timesheet form, they only related because of the notes. Perhaps not an easy solution at this stage. But remember in the analysis, we would ask clarifying questions of the user in order to establish the purpose, business rules and conditions and once question I would ask is, are the notes dependent on one of both of the entities? The answer I am suggesting is that notes are dependent on both more to learn and I promise it will become much easier as we present more complex situations.