E
E
Evgeny Vlasov2016-12-11 14:02:48
MySQL
Evgeny Vlasov, 2016-12-11 14:02:48

What is the best way to organize the work of the database to select the optimal PC assembly according to the tables of components?

Hello! They gave the task at the university to design and implement such a database:
fb82292d69254d2fb56af50236d14bb7.jpg9d3c38d7f99941118bf5f1d0b7848767.jpg
I implemented the following structure:
There are the following components - mat. board, CPU, RAM, video card, power supply, case,
cooler etc.).
In turn, for each component table there is a table - a price list with fields (component id, store id, price).
The only way I could come up with to solve the task for selecting a PC assembly that I could think of was to create a VIEW of all possible PC assemblies, simultaneously from three stores, i.e. all possible combinations of matching components. It turns out a table of the following type: (id of the motherboard, Id of the motherboard store, Price of the motherboard in this store; Id of the processor, Id of the processor store, etc....). Those. combinatorial solution.
The problem is that there are a lot of such assembly options (at least several million).
So, the question is: HOW CAN THIS BE DONE MORE CORRECTLY? Or is my solution acceptable?
I would be very grateful for your help! Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2016-12-11
@MaxDukov

IMHO you misunderstood the question.
a conditional client assembles the kit himself - and you have to calculate the cost if you buy from different companies.
everything is simple here - group by part number and min price.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question