Hello,

I want to design a database to compare prices from Supermarkets based on producttypes and different filters. I designed the following three tables:

1. Shop
ID,Name,Type,Country
1,Supermarket A,Supermarket,Netherlands
2,Supermarket B,supermarket,Netherlands
3,Night Shop A,NightShop,Germany

2. Products
ID,Type,Name
1,Fruit,Apples
2,Fruit,Strawberry
3,Soda,Cola
3,Soda,Fanta

3. Prices
ShopID,ProductID,Year,Price
1,1,2016,10
1,1,2017,11
2,1,2016,9
2,1,2016,10
2,2,2016,5
2,2,2017,6

Now I want to know who sells the cheapest fruit of all companies. In My data (Prices) it should be Supermarket B because the Apples are cheaper then Supermarket A. But if I combine them to a total score the price will be higher because Supermarket B has the prices available of the strawberries and Company A does not. I only want to compare every fruit that has a price of company a and B.

So I want to exclude the strawberries if one of the two companies does not have data available. Is this possible?