7. ENTITY RELATIONSHIP MODELLING
Entities are the people, places, things, or events that are of interest for a system that we are planning to build. In the previous section we considered there were several entities: four students and two courses.
In general, we find examples of entities when we think of people, places, things, or events in our area of interest:
- People: student, customer, employee
- Places: resort, city, country
- Things: restaurant, product, invoice, movie, painting, book, building, contract
- Events: registration, election, presentation, earthquake, hurricane
Entity sets are named collections of related entities. From our example we have two entity sets:
- The Student entity set comprises at least the 4 student entities: John, Amelia, Lee, and April.
- The Course entity set comprises at least the 2 course entities: Introduction to Art and Introduction to History.
Entity sets are the collections of entities of one type. We consider an Entity Type to be the definition of the entities in such a set. A common convention is to name entity types as singular nouns and that, at least, the first letter is capitalized.
In an ERD entity types are shown as named rectangular shapes. For example:
The Student and Department entity types shown above are drawn with a simple single-line border. This means that they are regular (or strong) entity types that are not existence- dependent on other entity types (see the next section).
1) Consider your educational institution. Your educational institution needs to keep track of its students. How many student entities does the institution have? You have provided the institution with information about you. In your opinion, what attributes describe these entities?
2) Consider your place of work. The Human Resources department in your company needs to manage information about its employees. How many employee entities are there? What attributes describe these entities?
3) Consider your educational institution or place of work.
- What are some of the entity types that would be useful?
- What relationships exist that relate entity types to one another?
- What attributes would be useful to describe entities and relationships?
- Draw an ERD.