Code:
select prices.price, products.product_name, discounts.discount_name from prices inner join products on prices.product_id = products.product_id inner join basket on basket.product_id = products.product_id inner join discounts on discount.discount_id = baskets.discount_id
and every product is in the basket table
and every basket has an associated discount.
you'll probably want to use LEFT OUTER join rather than INNER JOIN, depends on the database design.
Comment