A common (i assume?) type of query:
I have two tables ('products', 'productsales'). Each record in 'productsales' represents a sale (so it has 'date', 'quantity', 'product_id'). How do i efficiently make a query like the following:
Retrieve the product names of all products that were sold more than X times between date Y and date Z.
(X is the quantity sold not the number of transactions)