I have originally posted my question here on stackexchange
mysql structure based on date - Database Administrators Stack Exchange
Any help?
I have originally posted my question here on stackexchange
mysql structure based on date - Database Administrators Stack Exchange
Any help?
You might get a better response if you post the whole question here, rather than asking people to go over to another site to help you…
Thank you for advice
So I was asked to make a module for a storage website, which will display users storage.
There is an application on server which does all of this and has a database, so programmer told me that he can update mysql database whenever change happens to the original one.
He gave me table like this one
Balance, date - 13.05.2014
Warehouse: 21 60,000.00
№ Name Quantity Unit (weight) Netto
1 Chicken (15 kg) 4,000 Box (15 kg.) 60,000.00
Total: 4,000 60,000.00
And told me that he will be updating database with sending how much is added or subtracted to the quantity.
In my mind this will look like this
INSERT INTO table VALUES (1000, 0, datetime())
where first value is quantity added, second is subtracted and third date.
I know this is kind of strange but this is what he told me (and I have suspicious he kind of hates me)
So i need suggestions how to design such database, which will be also performance efficient. Do I really need to table structure or can I go with one?
yes, you need
Sorry that was a typo, I meant " Do I really need “two table” structure or can I go with one?
two?
which two were you thinking of?
one with the product, and the other with updates
so, for example one table will take
ID NAME
“99” “chicken”
and the other
ID Added Subtracted date
“99”, “+100”, “-5”, “date”
So customer can see the quantity by date (for example yesterday)
wow, that’s pretty sophisticated… are you sure you need that?