SHARE
TWEET

Untitled

a guest Jun 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Find the total amount of poster_qty paper ordered in the orders table.
  3. */
  4. SELECT SUM(poster_qty) AS total_poster_sales
  5. FROM orders;
  6.  
  7. /*
  8. Find the total amount of standard_qty paper ordered in the orders table.
  9. */
  10. SELECT SUM(standard_qty) AS total_standard_sales
  11. FROM orders;
  12.  
  13. /*
  14. Find the total dollar amount of sales using the total_amt_usd in the orders table.
  15. */
  16. SELECT SUM(total_amt_usd) AS total_dollar_sales
  17. FROM orders;
  18.  
  19. /*
  20. Find the total amount spent on standard_amt_usd and gloss_amt_usd paper for each order in the orders table. This should give a dollar amount for each order in the table.
  21. */
  22. SELECT standard_amt_usd + gloss_amt_usd AS total_standard_gloss
  23. FROM orders;
  24.  
  25. /*
  26. Find the standard_amt_usd per unit of standard_qty paper. Your solution should use both an aggregation and a mathematical operator.
  27. */
  28. SELECT SUM(standard_amt_usd)/SUM(standard_qty) AS standard_price_per_unit
  29. FROM orders;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top