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-2.sql 482B

123456789101112
  1. SELECT invoice_number, vendor_name, invoice_due_date,
  2. invoice_total - payment_total - credit_total AS balance_due
  3. FROM vendors v JOIN invoices i
  4. ON v.vendor_id = i.vendor_id
  5. WHERE invoice_total - payment_total - credit_total > 0
  6. ORDER BY invoice_due_date DESC;
  7. SELECT invoice_number, line_item_amount, line_item_description
  8. FROM invoices JOIN invoice_line_items line_items
  9. ON invoices.invoice_id = line_items.invoice_id
  10. WHERE account_number = 540
  11. ORDER BY invoice_date;