locked
Database Design Tip Reuired RRS feed

  • Question

  • User-1219224268 posted

    Hi,

    I am building a page that displays a product's details, with the information being called from an MSSQL database.

    I would like to be able to have a variable number of features listed for each product, so for example, Product A has a list of 3 features, Product B has a list of 7 features, Product C has 2 features listed etc.

    I would like to avoid having a lot of NULLS in my database, and would prefer not to restrict the number of possible features listed.

    Is there a common way to tackle this problem? Is it simply a case of setting up a table just to store features?

    Thanks in advance, hope that made sense!

    Friday, June 4, 2010 11:04 AM

Answers

  • User1564947477 posted

    A common approach here would be something like this

     

    PRODUCT Table

    ProductID, ProductName, etc

    FEATURE Table

    FeatureID, FeatureName, etc

    PRODUCTFEATURE Table - stores relationship of which products have which features

    ProductID, FeatureID

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 4, 2010 11:14 AM

All replies

  • User1564947477 posted

    A common approach here would be something like this

     

    PRODUCT Table

    ProductID, ProductName, etc

    FEATURE Table

    FeatureID, FeatureName, etc

    PRODUCTFEATURE Table - stores relationship of which products have which features

    ProductID, FeatureID

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 4, 2010 11:14 AM
  • User-1360095595 posted

    Cross Reference Table. 

    Friday, June 4, 2010 11:17 AM