Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011

    Question relationships Question

    Hello dbforum friends..
    i d like to pick your brains about something..
    Suppose i want to create a database for storing, lets say computer stuff, parts, hardware, peripherals etc....

    Which way would be better?

    Create a Basictable with all the common fields (like ProductName, Price,Guarantee....)
    and then create multiple other tables with each categorie's specific fields and binding those tables with the Basictable with one-to-one relationships..

    Create just one table with all possible fields and keep Null values in the fields that are not needed for specific categories..

    or maybe a third way.. ?

    Thanx in advance..

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    both of the methods you describe are suitable

    which one is "better" will depend on several things

    - how many shared columns are there in the supertype table
    - how many unique columns are there in the subtype tables
    - how frequently only the supertype table is queried
    - how frequently only specific subtypes are queried | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2011
    yeah.. or i guess i could combine both ways.. Like keeping the supertype table for the common fields and joinning together some of the subtype tables that have most of their fields in common

Posting Permissions

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