CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: design question

  1. #1
    Join Date
    Apr 2003
    Posts
    52

    design question

    Is it better to have one table with many entries
    Example
    ----------
    Email
    Name
    Address
    City
    ....

    or to have multiple tables with fewer entries
    Example
    ----------
    Table1

    Email
    Name

    Table2

    Address
    City

    Basicly, i'm looking at designing one table with about 25+ entries or spliting them up in to 3-4 categores and creating a table for each, and i'm looking for the better option, the option that will give me better performance. To me either one doesn't matter, but if one will performe better, obviously i'd like to use that one.

  2. #2
    Join Date
    Jun 2001
    Location
    Mi
    Posts
    1,249
    That depends on your purpose ... What normal form are you looking to get to? Oh, what database is this to be in?

  3. #3
    Join Date
    Apr 2003
    Posts
    52
    It's going to run on MySql, and possibly MsSql later on.

    It's basicly a submition form. The user will enter his info, name, email, address...and so on.

    My inquiry is basicly, is it better to split these into categories then give each catagory it's own table in the database, or just create one table in the database and throw all these entries in there.

    I'm leaning more thward splitting everything up.

    Here's a better idea of what the database entries will look like and possibly how I'm thinking of splitting them up.

    1-
    Email, Name, Address, Phone...

    2-
    Email notifications, SMS notification, other notifications...

    3-
    XML feed1, XML feed2, XML feed3....

    Or, should I just put all of these into one table??

  4. #4
    Join Date
    Mar 2002
    Location
    Croatia
    Posts
    275
    In your example, it's better to have one table.
    All information you have specified is unique, so there is no need to make another table.

    Create another table, for example, if you want to have more then one email for one person:

    TablePerson
    ---------------
    Person_ID
    Name
    Address
    City

    TableEmails
    ---------------
    Person_ID
    Email

    You can enter more emails for one person.
    Person_ID is primary key in TablePerson.
    Person_ID in TableEmails isn't a primary key, duplicates are allowed.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured