N
N
NoName_02016-08-13 21:35:39
Database
NoName_0, 2016-08-13 21:35:39

Goods at different prices, how to proceed?

Good day to all. I ask for help in solving the problem that arose during the technical planning of the online store. The problem is this: there are names of goods in the database (just an entry in a special table, the name and that’s it, no prices), then, when these goods are already in stock, you need to make the actual goods by name (an entry in another table) with a price at which they bought this product, and then, based on this and other data, we can consider profit, etc. But here's the problem, what to do if the same product (one name) arrives, but at different prices? how to be in such a situation? I'm sure that the people who design / developed online stores have implemented this. I have an idea: to create several entries with the same name, but with different prices. There is no other way to do it, right? Please help, I can't figure it out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2016-08-13
@NoName_0

I don’t understand the problem, you have 1 table - a reference book of commodity units, and 2 - a procurement table, in which the product id, date, quantity, perhaps some other explanations (let's say the supplier) and the price at which they bought are written. All. Or am I misunderstanding something about the question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question