Results 1 to 2 of 2

Thread: DB layout help

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Unanswered: DB layout help

    I am making a site that will display items for sale but not sure how to layout my
    DB.Should I make a table with the name of each item group
    (e.g. Spring,coils.ect..) and then make a table with the name of the different
    types of the item and the last table containing the items information.

    Not sure if I'm explaining this right, for that I am sorry I am very tired.

    So here is what I was thinking
    Table
    [item_groups]
    group_id PK
    group_name


    Table
    [sub_groups]
    sub_id PK
    group_id FK
    sub_names

    Table
    [items]
    item_id PK
    sub_id FK
    group_id FK
    item_name
    item_weight
    item_price
    ect...


    would this be the right line of thinking, thanks for any help you guys might have.

    Steve

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have a look at normalisation
    Fundamentals of Relational Database Design -- r937.com
    The Relational Data Model, Normalisation and effective Database Design

    resist the temptation to have a table per product type
    after all a product is a product
    if you have unique attributes on a product type then consider using a sub table for those attributes
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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