What is the best way to store product specification in database
-
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.. :)
-
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.. :)
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.
-
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.
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
-
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.. :)
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.
-
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.
-
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[^]
-
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.. :)
I thinks second option is better than first option. Store all category specification in single table.
Mojam