Neo Brian Neo Brian - 21 days ago 6
MySQL Question

Registered Users and unregistered users

I have a users table for registered users. These registered users can add contacts that have registered (Registered users) and also contacts that have not registered (That can register in future).

What is the best database structure?


  1. Should I create two User tables (Registered and unregistered) having
    ID as primary key and using the Email as a unique identifier.

  2. Should I store all contacts (registered and unregistered in the same
    table #Users Table) having in mind that not-existing users/emails
    can be added to the table making it to have alot of users that may
    never exist.


Answer

I manage a website since 6 years and I have all the users in the same table with a column named "profile", with any problem at all. Is very useful to have all in the same table. You could have a boolean column: registered and non registered.