Entity Model Diagrams
Click on the link below to take another look at the Third Normal Form (3NF) solution to the Normalisation example we looked at in the last section:
Note that the entities are related to each other mainly by sharing keys (main keys and foreign keys). This is an important feature which enables us to navigate through the database and process queries. For any sizable database it is helpful to show these relationships in a diagram known as the Entity Model. The diagram has two symbols:
A box to represent each entity:
|and a connector to represent each relationship:|
The connection shown above is called a one-to-many relationship, the left end being the one and the right the many.
The diagram is constructed by linking together entities that are related to each other by way of their keys. It is normal to construct the diagram in a top-down left-to-right manner so that it reads naturally just as if we were reading a page of text or screen. We would normally begin with any entity which has foreign keys and link it to its partner. In our example this means that we would begin with Tutor and Course and link them as shown in the adjacent diagram.
This tells us two things: firstly it states that "one Tutor <has some relationship to> many Courses". Translating this we could say "A Tutor teaches many Courses". (As we go through this process you will note that as we create the relationships we are also creating factual statements about our system as it exists).
The second thing this diagram tells us is that Course contains the key of Tutor since the "many" symbol is attached to the Course entity. This is a crucial concept and it is recommended that you use this method for constructing the diagram.
Next: Drawing the Entity Model