News for hackers. Stuff that matters.
Re:Best Practices for Data Modeling by benmanns on Tuesday October 29, 2019 @11:26AM (#21388215)
I don't know—this could be seen as more consistent. It's almost like a type system on identifiers. This way you avoid accidentally joining users.id to user_preferences.id because you'll always join with the user_id "type" from users.user_id to user_preferences.user_id. SQL even has a syntax for that: JOIN user_preferences USING (user_id).

There are no comments on this comment yet.