Skip to Main Content
Creating Software with Modern Diagramming Techniques
book

Creating Software with Modern Diagramming Techniques

by Ashley Peacock
February 2023
Intermediate to advanced content levelIntermediate to advanced
158 pages
3h 50m
English
Content preview from Creating Software with Modern Diagramming Techniques

Comment Your Columns

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:

images/design-database-schemas/comments.png

I think this is a good compromise, and it renders nicely. Don’t be afraid to add both a foreign key and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Publisher Resources

ISBN: 9798888650219Errata Page