I am almost a novie in database queries. However,I do understand why and how correlated subqueries are expensive and best avoided. Given the following simple example - could someone help replacing with a join to help understand how it scores better:
SQL> select
  2    book_key,
  3    store_key,
  4    quantity
  5  from
  6    sales s
  7  where
  8    quantity < (select max(quantity)
  9                 from sales
 10                 where book_key = s.book_key); 
Apart from join,what other option do we have to avoid the subquery.
 
     
    