Results 1 to 5 of 5

Thread: more tables or more entries

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    more tables or more entries

    Hi

    What is the best policy in general?

    More tables with less fields or less tables with more fields?

    10 tables with 2 fields each or 2 tables with 10 fields each?

    Regards

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: more tables or more entries

    Quote Originally Posted by Tugabargains
    Hi

    What is the best policy in general?

    More tables with less fields or less tables with more fields?

    10 tables with 2 fields each or 2 tables with 10 fields each?

    Regards
    Unfortunately that is too vague a question...

    I've seen commercial applications take "normalization rules" too far - having 500+ tables with just a handful of columns in each table.

    Might have looked good at design time, but reporting against or even simply understanding this structure was overwhelming.

    Ask a more specific question and we will give you our opinions!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Re: more tables or more entries

    ok,

    I have the following problem:

    1st Table (Local): LocalID, Name, Seats, OcupaidSeats, refTypeLocal
    This table stores data about a local
    ex.: 1, Cinema 1, 200, 157, 1
    2, Cinema 2, 350, 100, 1
    3, Cinema 3, 200, 0, 2

    2nd Table (TypeLocal): TypeLocalID, Name
    This table stores type of locals, at the moment there is only 2 diferent types but I need to have the facility to add more.
    Ex.: 1, Cinema
    2, IMax

    Shoul I group this two tables and have only one
    (Local): LocalID, Name, Seats, OcupaidSeats, TypeLocal ?

  4. #4
    Fanatic Member -TPM-'s Avatar
    Join Date
    Jul 2005
    Posts
    850

    Re: more tables or more entries

    I'd say normalizing 1 column is pointless.
    TPM

    Add yourself to the VBForums Frappr Map!!

  5. #5
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016

    Re: more tables or more entries

    Quote Originally Posted by -TPM-
    I'd say normalizing 1 column is pointless.
    It depeneds. If you want to restrict the values in the columns, then normalizing is a good thing. It allows you to perform you validation through referential integrity. If you perform your validation in the application, for each new value you want to validate, you will have to modify/redeploy the application.

    If you don't care to restrict the values that are in the column, then yes, I'd agree that normalizing the table would be pointless.

    So if you need to control the values in the field, then I would suggest the second table. Otherwise, it's not needed.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

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