Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sirexzib's avatar

Database construction, how would you optimally do this

Alright, to keep things as Basic as possible.

Let's say I have 5 products and I have 5 providers for each product (Every Provider Sells the product). Now they have all different prices, how would you store the prices in the database for each product?

Eventually the products will have more providers aswell.

And on top of that, when a user browse the site, the user can themselves pick which provider to show prices from.

So I have: [Products/Crypto Currencies] 1x NEO 1x XRP 1x LTC 1x SC 1x XEM

[Providers/Platform]

Poloniex Bittrex Coinbase Bitfinex FifthExample

So basically each of the products has a price on every provider, now Richard comes to my website and registers.

And then he picks to show prices from the CoinBase provider.

Currently we have a table for each provider but that feels not so good.

Thanks!

0 likes
2 replies
topvillas's avatar

Create a table with a product_id, provider_id and price.

Please or to participate in this conversation.