Use a surrogate key for identifying rows

This best practice sounds scary but it just means that you either use an id and/or guid column instead of just a natural primary key.

  1. Numeric ids have smaller storage size than e.g. an IBAN. Each foreign key for the given IBAN would also store the full IBAN data.
  2. A natural key might look static but could change over time.

In our exercises you will also find that we apply an id column for m:n relationship tables:

  1. It's easier to delete those relationships (e.g. a tag inside a blog post) by using the ID of this tuple than the tag name.
  2. It's easier to identify the row if the m:n relationship allows multiple relations between the same rows of both tables.