I want a sql table which has all universal units like kg,grams,tons etc.. and its relationship. Has anyone got this ?
—EDIT—-
I am designing a Point Of Sale system and I am doing stock management module now. So i have to calculate the units accordingly. For example if the administrator set tat for making Pizza they use product1 100 grams, product2 100ml etc.. then i have to reduce the amount of product1 and product2 in stock level when they sell each pizza.. So is there any way to do this without units ?? How do you solve this problem ?
Do transactions of your consumables in some consistent set of units (kilograms and liters and “each” are good choices).
When you buy something that is measured in pounds, convert it to kilograms before entering it into the database. If you buy something in gallons, convert it to liters. If you buy something by the 1000-count, convert it to each.
If you catch it at the data entry point then you don’t need the table, really.
Now, if for convenience, you want to let your admins store their recipes in their favorite units, then you need to pick one unit per class of quantity (mass, volume, length, dry measure, etc.) and store amounts in that unit in your stocking table. Then you’ll want a table that has all of the relations for these units to your base unit (1 kg = 1000 g; 1 kg = 0.001 metric tons, etc.)
This shouldn’t be that involved to build yourself. There aren’t that many ways to describe how much butter you have on hand.