3 ms·
Synthetic key is the easiest choice. Because the primary key in one table is going to be foreign key in another table. If I have an employee table I can use the
by DeathArrow 2y ago
Synthetic key is the easiest choice. Because the primary key in one table is going to be foreign key in another table. If I have an employee table I can use their email address as the key but then I will have to use the email in any other table that references employee table, such as salary table, days off table and so on.
Most of the times using an auto incrementing integer or UUID is just fine.
In NOSQL there's usually a synthetic ID used to uniquely identify a document, I've never seen people using natural keys or compound keys.