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-7.sql 506B

1234567891011121314
  1. SELECT invoice_number, vendor_name
  2. FROM vendors v, invoices i
  3. WHERE v.vendor_id = i.vendor_id
  4. ORDER BY invoice_number;
  5. SELECT vendor_name, invoice_number, invoice_date,
  6. line_item_amount, account_description
  7. FROM vendors v, invoices i, invoice_line_items li,
  8. general_ledger_accounts gl
  9. WHERE v.vendor_id = i.vendor_id
  10. AND i.invoice_id = li.invoice_id
  11. AND li.account_number = gl.account_number
  12. AND invoice_total - payment_total - credit_total > 0
  13. ORDER BY vendor_name, line_item_amount DESC;