Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2005
    Posts
    30

    Question Unanswered: One to many relationship issue

    Hi Guys

    I am having a bit of a brain drain at the moment and cannot figure out what I thought would be a reasonably easy problem to solve.

    This is the situation.

    I am designing a web site (ASP, Access) for a childrens clothes shop and I am just about to start the dbase design.

    My issue is this.

    Each product, for arguments sake lets say a t-shirt, comes in a variety of different sizes, 0-2months 3-6months etc up to 15-16year. Each size also has a stock level.

    My ultimate aim is that only the sizes in stock of a particluar product will show on the generated page.

    At the moment I have a products table, and a size table. The products table also has a stock number in there.

    My problem is how to relate the sizes to the product.

    the size table is as follows

    size_id - autonumber
    size_range - text (this is where the 0-2months, 3-6 months etc goes.

    This is the wrong way to go about it I know.

    Can anybody give me an idea how the relationship will work and how I need to organise my tables.

    Many thanks in advance.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    products
    product_id
    product_name
    etc.

    sizes
    size_id
    size_range

    productsizestocks
    product_id FK
    size_id FK
    stock integer
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Apr 2005
    Posts
    30
    Thanks Very Much for your reply.

    Created the new table and all works a treat.

    Thanks

Posting Permissions

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