Sample Header Ad - 728x90

When should I reference the User record or User Profile record

2 votes
2 answers
812 views
I know it is a common paradigm to separate tables when building a User profile. For example, having a user table, and another table called user_profile with a foreign key to the user table. My understanding is that the user table is better for sensitive user account data or authentication data, such as email, password, user type etc. The Profile table could have additional data of that user like first name, last name, date of birth and more. But, what about other data that can be related to the user, and can also be modeled with a table. Some examples could be Payments and Transactions. My first guess is to link those to the profile table and that way I don't have to make any joins just to have Transactions and the name of User together (which the user table does not have). Linking to the profile, I have the user info and the Transactions. But then, when is it useful to link to the user table? What are the common paradigms? Thanks in advance!
Asked by chris (121 rep)
May 15, 2020, 09:21 PM
Last activity: Dec 4, 2023, 09:51 AM