Tips for Normalizing a Users Table

  • Hi. I´d like to save User´s data into a table called Users, but I have at least 2 types of Users and they will have different table fields according to its type. Ex.

    ========

    Users

    ========

    UserID

    Username

    Password

    ========

    A user of type==User01 will use the info in the Users table, plus:

    ========

    User01

    ========

    Fullname

    Email

    Telephone

    ========

    A user of type==User02 will use the info in the Users table, plus:

    ========

    User02

    ========

    CompanyName

    Address

    Telephone

    Fax

    ========

     

    I could use just 1 table (the Users table) and save info for both user types, but depending of the type of user I´m saving info, some fields will be left blank/null, so I believe that I need a way to to have separate tables to save the user details according to the user type and a main table where I save the UserID,Username and Password because those fields are common to any kind of user.

    I would appreciate receiving some tips regarding these issues.

    Ken.


    Kindest Regards,

    »»» KenA

  • Can a user have more then one set of contact information?  Do you need to keep history when they change their contact information?  Will you want to search by last name ever?  Could they have more then one phone and fax if it's a Company?  Could an individual have a cell phone and a regular phone?  What about an office number or fax number?

    There are a lot of different directions you can go on this. 

    Contact

    -------

    ContactID

    ContactTypeID (individual or company)

    ContactUserName

    ContactPassword

    Individual

    ----------

    IndividualFullName

    IndividualMiddleName

    IndividualLastName

    IndividualSSN

    IndividualBirthday

    Company

    -------

    CompanyName

    CompanyType

    Address

    -------

    ContactID

    Address1

    Address2

    AddressCity

    AddressState

    AddressZip

    Phone

    -----

    Contact

    PhoneTypeID (home, office, fax, blah, blah)

    PhoneNumber

    PhoneExtension

    This can go on and on and on and on depending on what you need.

    Derrick Leggett
    Mean Old DBA
    When life gives you a lemon, fire the DBA.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply