Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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;