You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

demo-queries-from slides-3.sql 427B

1234567891011
  1. SELECT vendor_id, ROUND(AVG(invoice_total), 2) AS average_invoice_amount
  2. FROM invoices
  3. GROUP BY vendor_id
  4. HAVING AVG(invoice_total) > 2000
  5. ORDER BY average_invoice_amount DESC;
  6. SELECT vendor_name, vendor_state, ROUND(AVG(invoice_total), 2) AS average_invoice_amount
  7. FROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_id
  8. GROUP BY vendor_name
  9. HAVING AVG(invoice_total) > 2000
  10. ORDER BY average_invoice_amount DESC;