Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Posts
    11

    Unanswered: large column # for a table?

    Im trying to create a table that will store user info (e.g. username, password, personal profile, expertise, interests etc....). I then ended up with about 30 columns for a table.

    I don't know if this is a good database design or would it slow down the searching speed. Should I split the table into smaller columns ?

    Any help is appreciated.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if each column value pertains to only the user, then no, don't split the user table

    if any of the columns contains multiple values, e.g. "interests", and you want the individual values to be searchable (instread of the whole thing as a single string which contains text/narrative), then yes, split that off
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2005
    Posts
    11
    thank you for your reply.
    Im planning on splitting the 'experise' column into a separate table. I have roughly 50+ expertise (e.g. asp, php, html etc..) for users to choose from.

    Should I build the table with 50+ columns and record the user expertise one per row, or should I build the table with only 2 main columnes (i.e. user id, expertise) which will split user expertise into several rows.

    My concern is with the database memory and searching speed once I have more users.
    Let's say if I have 50 columns per row and users only know three types of expertise then would it be better off to split the user into three different rows instead of storing data in the same row with 47 redundant columns?

    any help is appreciated.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    do not make a column for each expertise

    instead, make the expertise part of the key of a table, and store one row per user per expertise
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •