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-8.sql 582B

12345678910111213
  1. —-A compound condition without parenthese
  2. SELECT invoice_number, invoice_date, invoice_total,
  3. (invoice_total - payment_total - credit_total) AS balance_due
  4. FROM invoices
  5. WHERE invoice_date > '2014-07-03' OR invoice_total > 500
  6. AND invoice_total - payment_total - credit_total > 0;
  7. —The same compound condition with parentheses
  8. SELECT invoice_number, invoice_date, invoice_total,
  9. (invoice_total - payment_total - credit_total) AS balance_due
  10. FROM invoices
  11. WHERE (invoice_date > '2014-07-03' OR invoice_total > 500)
  12. AND invoice_total - payment_total - credit_total > 0;