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.

123456789101112131415161718192021
  1. --A SELECT statement that uses the LEFT function
  2. SELECT vendor_contact_first_name, vendor_contact_last_name,
  3. CONCAT(LEFT(vendor_contact_first_name, 1),
  4. LEFT(vendor_contact_last_name, 1)) AS initials
  5. FROM vendors;
  6. --A SELECT statement that uses the DATE_FORMAT function
  7. SELECT invoice_date,
  8. DATE_FORMAT(invoice_date, '%m/%d/%y') AS 'MM/DD/YY',
  9. DATE_FORMAT(invoice_date, '%e-%b-%Y') AS 'DD-Mon-YYYY'
  10. FROM invoices
  11. ORDER BY invoice_date;
  12. --A SELECT statement that uses the ROUND function
  13. SELECT invoice_date, invoice_total,
  14. ROUND(invoice_total) AS nearest_dollar,
  15. ROUND(invoice_total, 1) AS nearest_dime
  16. FROM invoices
  17. ORDER BY invoice_date;