選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

demo-queries-from slides-1.sql 954B

123456789101112131415161718192021222324
  1. --A SELECT statement that retrieves all the data from the Invoices table
  2. SELECT * FROM invoices;
  3. --A SELECT statement that retrieves three columns from each row, sorted in descending sequence by invoice total
  4. SELECT invoice_number, invoice_date, invoice_total
  5. FROM invoices
  6. ORDER BY invoice_total DESC;
  7. --A SELECT statement that retrieves two columns and a calculated value for a specific invoice
  8. SELECT invoice_id, invoice_total,
  9. credit_total + payment_total AS total_credits
  10. FROM invoices
  11. WHERE invoice_id = 17;
  12. --A SELECT statement that retrieves two columns and a calculated value for a specific invoice
  13. SELECT invoice_number, invoice_date, invoice_total
  14. FROM invoices
  15. WHERE invoice_date BETWEEN '2018-06-01' AND '2018-06-30'
  16. ORDER BY invoice_date;
  17. --A SELECT statement that retrieves two columns and a calculated value for a specific invoice
  18. SELECT invoice_number, invoice_date, invoice_total
  19. FROM invoices
  20. WHERE invoice_total > 50000;