Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Moscow, Russia
    Posts
    2

    Question how to make set of properties?

    Hello all, I hope somebody can help me.

    I have a database with products, something like this:

    Products table:

    product_id
    category_id
    manufacturer_id
    product_name...
    .. etc

    Categories table:
    Category_id
    Category_name...
    ... and the same table for the manufacturer.

    But actually each product may have different set of propeties.
    I want to make table with properties, something like this:
    property_id
    property_name
    property_unit(mm, kg or something)

    The question is how correctly to join product whit its own set of properties, for example
    product with product_id = xxx have 3 properties( I take their names by id from properties table), product with product_id = yyy have 13 properties.
    I have no idea how to organize this data and what should be the structure of a table where the values of properties for each product are stored.

    Thank you.

  2. #2
    Join Date
    Sep 2003
    Posts
    12
    first of all you'll have to create two tables, the first will be the property table with property_id, property_name, etc. and second you'll have to create a table named product_property that will have to primary keys one will be the product_id and the other property_id and the relation between product ---> product_property has to be 1 to infinite and the relation product_property --> property has to be infinite to 1.

    greetings,

    baccon

  3. #3
    Join Date
    Aug 2003
    Location
    Moscow, Russia
    Posts
    2
    Thank you, I've also found a CD database example that help me to understand how to design this database.

Posting Permissions

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