1

I am in database design development phase. Application will work with large number of users (LARGE :))

I designed 80% of database but I have one Users table which is connected to everything else:

Users {UserId, FirstName, LastName, Username, Password, PasswordQuestion, PasswordAnswer, Gender, RoleId, LastLoginDate etc etc}

I saw asp.net membership database structure where Users and Membership are two tables. My questions are:

  1. Should I use one users table with all users data in it or more tables?
  2. If answer is 'more tables', what tables to use? Any advice on how to structure relation between those tables?

This is sample relation that I have, and trying to improve. I don't understand why user and userChild are separated tables?

2
  • 1
    How large is "LARGE"? 100,000? Commented Dec 25, 2010 at 22:34
  • John: Something like that. Mitch: Sorry I didn't read FAQ, now I understand that I need to build reputation. I will fix that. And I updated question with one new data. Commented Dec 26, 2010 at 11:47

1 Answer 1

1

How many tables you need depends on your modeling needs.

For example if you include the RoleId in the Users table then you'll only be able to assign one role per user. Is that what you want?

Otherwise, if you have a separate table linking users to roles, you'll be able to assign more than one role per user.

Sign up to request clarification or add additional context in comments.

2 Comments

No. Every user can have only one role. I am creating something where user can register, login, users can browse another users to add them as friends (I have Friend table with UserId and FriendId columns and both columns are connected to UserId from Users table). A also think to create separate table for secure questions because there will be list of questions. But I don't know do I, and should I have Users table that will store user personal data like FirsName, LastName etc. and another table that will store data like email, username, password, avatarUrl etc.
If a user has a single firstname and a single email then these two bits of data should usually go in the same table: Users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.