12345678910111213141516171819202122232425 |
- SELECT 'After 1/1/2018' AS selection_date,
- COUNT(*) AS number_of_invoices,
- ROUND(AVG(invoice_total), 2) AS avg_invoice_amt,
- SUM(invoice_total) AS total_invoice_amt
- FROM invoices
- WHERE invoice_date > '2018-01-01';
-
- SELECT 'After 1/1/2018' AS selection_date,
- COUNT(*) AS number_of_invoices,
- MAX(invoice_total) AS highest_invoice_total,
- MIN(invoice_total) AS lowest_invoice_total
- FROM invoices
- WHERE invoice_date > '2018-01-01';
-
- SELECT MIN(vendor_name) AS first_vendor,
- MAX(vendor_name) AS last_vendor,
- COUNT(vendor_name) AS number_of_vendors
- FROM vendors;
-
- SELECT COUNT(DISTINCT vendor_id) AS number_of_vendors,
- COUNT(vendor_id) AS number_of_invoices,
- ROUND(AVG(invoice_total), 2) AS avg_invoice_amt,
- SUM(invoice_total) AS total_invoice_amt
- FROM invoices
- WHERE invoice_date > '2018-01-01';
|