T
T
talgatuza2020-06-10 16:49:24
Database design
talgatuza, 2020-06-10 16:49:24

How to create proper mysql db?

How to create the correct transfer table?
There is a table with cities and cars, we need a table with prices (the price is stored in three currencies).
How to store this data in one row in the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-06-10
@AleksandrB

Firstly, you do not need to store this data in one line. Exchange rates, for reference, change, while I can change by 10-15% per day. You must sell at a predetermined price. If you bought slippers for $10, you usually sell them for 650 rubles at a dollar price of 65 rubles, and today the dollar has become worth 130 rubles, you will lose half of the price in the purchasing power of the next pair. It is clear that such jumps do not happen so often, but if they do, how will you change the prices of, say, 10,000 products?
For such a case, currency conversion functions are created with a fit to 99.99.

S
Sergey, 2020-06-10
@rakot90

For example, if the price is "forever": ID_CAR | ID_CITY | Price1 | Price2 | Price3 | Location change date
If the price changes, then one field Price + do the conversion function for all currencies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question