February 2023
Intermediate to advanced
158 pages
3h 50m
English
Similarly to how we added an extra parameter for keys, there’s one final parameter reserved for column comments. They’re completely optional but can be handy if you need to explain something about a particular column—such as specifying a foreign key. Here’s what it looks like in Mermaid if we add a comment to specify the missing foreign keys from the TITLE_GENRE entity:
| TITLE_GENRE { |
| int title_id PK "FK" |
| int genre_id PK "FK" |
| } |
If we add the remaining missing keys, and comments where necessary, our ERD looks like this:
I think this is a good compromise, and it renders nicely. Don’t be afraid to add both a foreign key and ...