1110
1110

Reputation: 6829

Database with users design

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?

Upvotes: 1

Views: 253

Answers (1)

cherouvim
cherouvim

Reputation: 31903

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.

Upvotes: 1

Related Questions