You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the id represents the table in which it is a record, then the id should be simply id. On the other hand if the id is a foreign key on a record on another table it should have the format <record-type>_id.
For example:
when referencing clients on a sales record then we can use salesperson.client_id. This makes it easier to determine which is the primary table in queries when creating joins. We might have a where clause that looks like:
salesperson.id = client.salesperson_id
or client.id = salesperson.client_id
It is clear which is table the id is the primary property
The text was updated successfully, but these errors were encountered:
Currently the schema names of a given table as follows
salespersons -> salesperson_id
salesperson.salesperson_id
clients -> client_id
client.client_id
When the id represents the table in which it is a record, then the id should be simply
id
. On the other hand if the id is a foreign key on a record on another table it should have the format<record-type>_id
.For example:
when referencing clients on a sales record then we can use salesperson.client_id. This makes it easier to determine which is the primary table in queries when creating joins. We might have a where clause that looks like:
salesperson.id = client.salesperson_id
or
client.id = salesperson.client_id
It is clear which is table the
id
is the primary propertyThe text was updated successfully, but these errors were encountered: