Database Management
12 May 2026
How are tables related?
02aTermsThe above picture shows the crowsfoot notation for five cardinalities, from left to right: zero or one, exactly one, many (don’t use this one in this course!), zero or many, one or many. Always use the most restrictive applicable notation.
The main reason for crowsfoot notation is to be specific about cardinality—how many of one entity relate to how many of another entity.
This picture shows a many-to-many relationship. In the associated table, a supplier may supply many parts and more than one suppier may supply the same part. Every supplier in our database supplies at least one part and every part is supplied by at least one supplier.
No matter how inhumane we are, we can’t put an orca into more than one pool. One pool could contain many orcas but no orca will appear in more than one pool. That’s what this diagram says. Note that a relationship phrase above the line is read from left to right, while such a phrase below the line is read from right to left. Also note that a pool could be empty according to this diagram.
Again, we see a many-to-many relationship. Now we also see the attributes of the entity.
Here I have created an associative entity that lets us overcome the many-to-many relationship.
Now I’ve added primary keys to all three entities and foreign keys to quantity.
Now I’ve removed the many-to-many relationship and consider this a solution to the many-to-many relationship problem.
city in the supplier entity may differ from city in the quantity entity, the latter being the location where we’ve received the shipmentpid and sid in the quantity entity are foreign keys, shown in an oblique font, uniquely describing one instance in each of the other entitiesThis slideshow was produced using quarto
Fonts are Roboto, Roboto Light, and Victor Mono Nerd Font