I need to store user profiles and logins. Is the best way to do that to have a table for logins (email, username, and password) and a separate table for their profile/info (e.g. their progress in something)? I am using MySQL if that makes a difference.
MySQL – Best Way to Store User Profiles and Logins
loginsMySQLusers
Related Question
- PostgreSQL Multi-Tenant Schema Design – Handling User Logins
- MySQL – Users vs. People: Where to Keep the Email Address?
- Mysql – Design for user profile information and track changes
- Mysql – What’s the best way to store and search through many product specifications
- Mysql – Designing MySQL Database For Two Different User Types (Staff and Client)
- Sql-server – User and login mapping after an SQL Server restore
- When should I reference the User record or User Profile record
Best Answer
In general, if tables relate one-to-one, put both sets of columns in a single table. (There are exceptions, but I don't see one here.)
On the other hand, "progress" sounds like some type of log? That is, there might be lots of rows for each user? Then you must have 2 tables, one with user info, one with 'progress'.
The user table would have a
user_id
as thePRIMARY KEY
and the log table would have anINDEX(user_id, datetime)
or something like that. (I am assuming there is a datetime/timestamp column in the log.)