Hacker News new | ask | show | jobs
by zo1 2979 days 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".

1 comments

I 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);