3 ms·
I think he's referring to using "[Table]ID" as the primary key on [Table]? So now you have to join with the Person table on Person.PersonID from your local col
by zo1 9y ago
I think he's referring to using "[Table]ID" as the primary key on [Table]?
So now you have to join with the Person table on Person.PersonID from your local column PersonID. I much prefer the other way around: Table.ID with foreign keys being "TableID".
- slobotron 9y agoI find "[Table]ID" to be bit more readable in joins. I.e. SELECT * FROM table1 INNER JOIN table2 USING (table1_id); vs SELECT * FROM table1 INNER JOIN table2 ON (table2.table1_id = table1.id);