title: Join / subquery for SQL
body: <p>I'm struggling with the following question:</p>
  <p>Query all customers who spent 50% of less than the average amount spent on all invoices. For each customer, display their name and the amount spent to 6 decimals. Order the result by the amount spent from high to low.</p>
  <p><img src="https://i.stack.imgur.com/7niQq.png" alt="customer" /></p>
  <p><img src="https://i.stack.imgur.com/icou0.png" alt="invoice" /></p>