I want to know what product has been ordered the greatest number of times.
select * from products as t1 join regular_order_products as t2 on t1.product_id = t2.product_id group by t2.product_id order by count ( * ) desc limit 1
What is the total cost of the dvd orders?
select sum ( product_price ) from products as t1 join regular_order_products as t2 on t1.product_id = t2.product_id where t1.product_name = 'dvds'
And what about electronics?
select sum ( product_price ) from products as t1 join regular_order_products as t2 on t1.product_id = t2.product_id where t1.product_name = 'electronics'