Every table of an application has two keys. The primary key is the technical column `id`, a number taken from a sequence that never changes during the life of the row. The natural key is the combination of columns by which a user recognises the row, such as the code of an application, or the application together with the code of a table.
The natural key is a unique index named `<prefix>_<alias>_nk`. It serves three purposes:
- It prevents two rows from describing the same thing.
- A screen, an import or an interface can refer to another row by its natural key instead of by its identity. The business layer translates the codes into the identity when the row is written.
- When metadata or seed data is loaded, an existing row with the same natural key is updated instead of inserted twice.
In discussions the natural key can be treated as the real key of the table. The separate technical key exists so that a natural key can be changed, for instance when a code is renamed, without touching the rows that refer to it.