Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. What is the best way to store product specification in database

What is the best way to store product specification in database

Scheduled Pinned Locked Moved Design and Architecture
questiondatabasehardware
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    swapnil7090
    wrote on last edited by
    #1

    hello i am working on Project called Inventory Management System for Hardware shop and i play developer role. Now The database has category table which is consist of many categories such as Motherboard , Ram , Processor and so on. Now the question is what is best way to store specification in database because every category has its own specification , I Have Two Way :- either by creating different table for each specification of Category or create single table for all specification of Every Category. i am confuse between this two.which one is best and faster. Thanks in advance.. :)

    J M O 3 Replies Last reply
    0
    • S swapnil7090

      hello i am working on Project called Inventory Management System for Hardware shop and i play developer role. Now The database has category table which is consist of many categories such as Motherboard , Ram , Processor and so on. Now the question is what is best way to store specification in database because every category has its own specification , I Have Two Way :- either by creating different table for each specification of Category or create single table for all specification of Every Category. i am confuse between this two.which one is best and faster. Thanks in advance.. :)

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Question is imprecise.\ However if you have a FIXED list of characteristics for each product then you create a table that models exactly that. If you have a VARYING list of characters then you create a meta-model solution such that the tables that holds the characteristics looks like the following.

      Inventory: id, product_id, count

      Product: id, name, description

      Product_characteristic: id, product_id, characteristic_name, characteristic_value

      There are more complicated versions of the above.

      B 1 Reply Last reply
      0
      • J jschell

        Question is imprecise.\ However if you have a FIXED list of characteristics for each product then you create a table that models exactly that. If you have a VARYING list of characters then you create a meta-model solution such that the tables that holds the characteristics looks like the following.

        Inventory: id, product_id, count

        Product: id, name, description

        Product_characteristic: id, product_id, characteristic_name, characteristic_value

        There are more complicated versions of the above.

        B Offline
        B Offline
        bakary konate
        wrote on last edited by
        #3

        I agree with jschell. Here is slightly different version of that: Inventory: id, product_id, count, date Product: id, name, description, price, category_id Category: id, name, description Characteristic: id,name, description Category_Characteristic: category_id, characteristic_id

        1 Reply Last reply
        0
        • S swapnil7090

          hello i am working on Project called Inventory Management System for Hardware shop and i play developer role. Now The database has category table which is consist of many categories such as Motherboard , Ram , Processor and so on. Now the question is what is best way to store specification in database because every category has its own specification , I Have Two Way :- either by creating different table for each specification of Category or create single table for all specification of Every Category. i am confuse between this two.which one is best and faster. Thanks in advance.. :)

          M Offline
          M Offline
          Matt U
          wrote on last edited by
          #4

          To go along with the ideas previously mentioned, I actually had a similar project a few months ago. It was suggest here on CP that I do something like this:

          Inventory: id, product_id, count

          Product: id, name, description

          Product_Specs: id, product_id, spec_name, value_type, value

          "value_type" could be "TEXT", "INT", "DOUBLE", "FLOAT", etc. And the application handles the value type as necessary. So if the value type is "FLOAT", the user must input a valid 'float' value. And so on.

          djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

          J 1 Reply Last reply
          0
          • M Matt U

            To go along with the ideas previously mentioned, I actually had a similar project a few months ago. It was suggest here on CP that I do something like this:

            Inventory: id, product_id, count

            Product: id, name, description

            Product_Specs: id, product_id, spec_name, value_type, value

            "value_type" could be "TEXT", "INT", "DOUBLE", "FLOAT", etc. And the application handles the value type as necessary. So if the value type is "FLOAT", the user must input a valid 'float' value. And so on.

            djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            Matt U. wrote:

            It was suggest here on CP that I do something like this:

            hmmm..... http://www.codeproject.com/Messages/4414624/Inventory-Control-App-Looking-For-Suggestions.aspx[^]

            M 1 Reply Last reply
            0
            • J jschell

              Matt U. wrote:

              It was suggest here on CP that I do something like this:

              hmmm..... http://www.codeproject.com/Messages/4414624/Inventory-Control-App-Looking-For-Suggestions.aspx[^]

              M Offline
              M Offline
              Matt U
              wrote on last edited by
              #6

              Ah, yes, thank you for the link. Sorry, I didn't think to find it, despite how quick and simple it would've been. :)

              djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

              1 Reply Last reply
              0
              • S swapnil7090

                hello i am working on Project called Inventory Management System for Hardware shop and i play developer role. Now The database has category table which is consist of many categories such as Motherboard , Ram , Processor and so on. Now the question is what is best way to store specification in database because every category has its own specification , I Have Two Way :- either by creating different table for each specification of Category or create single table for all specification of Every Category. i am confuse between this two.which one is best and faster. Thanks in advance.. :)

                O Offline
                O Offline
                ospmojamcpds
                wrote on last edited by
                #7

                I thinks second option is better than first option. Store all category specification in single table.

                Mojam

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups