1.9: Diagramming Notation

Now that you know how to create and seed tables, it is important to understand how multiple tables work together. Special notation is used to model these relationships. Two common sets of symbols are shown in the table below.

To understand these relationships, think about an English sentence and how it is structured -- noun, verb, predicate.

  • When you consider a relation, identify the two entities first. Take the one-to-many example in the table above. The two entities are lecturer and course. The entity you start at (lecturer) is the "noun" of your sentence.

  • Find the connecting line. Is this example, it's easy because there is only one line in the diagram.

  • Follow the line to find the entity it connects to (course). This the final entity, or the "predicate" of your sentence.

  • The symbol that touches your final entity is the "verb" of your sentence.

  • If any symbol touches the "noun", ignore it.

  • Following the sentence structure and using the lecturer-course example, you end up with lecturer [0..*] course or "One lecturer has zero or many courses," which has been abbreviated to "One lecturer can have many courses."

You can follow the same process going the other direction. This time, start at course. This is now your noun. Follow the line to the other entity, which is lecturer; this is your new predicate. The symbol touching the predicate is your verb. So, following the sentence structure for this model, you get course [1] lecturer or "A course has one and only one lecturer."

At this point, these two notations may seem interchangeable. However, UML is used for object diagrams, whereas Crow's Foot is used for entity relationship diagramming. This lesson will not go deeper into the differences between these two, but there are plenty of resources available if you'd like to learn more.

  • You can read about Crow's Foot notation in more detail by following this link.

  • To read more about UML, including composition and aggregation, visit this site.

For now, use what you've learned to complete the challenges below. Instead of writing SQL scripts, you'll be drawing diagrams and filling in the blanks to model several relationships. Make sure to use both UML and Crow's Foot notation.

Click on 1.12 Solutions to see the solution for this challenge. Then, continue to Part 1.10: Foreign Keys.

Last updated