Guest User

Untitled

a guest
May 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. -- Exercise 3b
  2. SELECT * FROM shr WHERE shrprice < 1;
  3.  
  4. -- Exercise 3d
  5. SELECT shrfirm, shrprice, shrqty, shrprice*shrqty AS totalvalue FROM shr;
  6.  
  7. -- Exercise 3e
  8. SELECT shrfirm FROM shr WHERE shrdiv/shrprice*100 > 5;
  9.  
  10. -- Exercise 3f
  11. SELECT shrdiv*shrqty AS totaldividend FROM shr WHERE shrfirm = 'Patagonian Tea';
  12.  
  13. -- Exercise 3h
  14. SELECT shrfirm FROM shr WHERE shrdiv/shrprice*100 = (SELECT MIN(shrdiv/shrprice*100) FROM shr);
  15.  
  16. -- Exercise 3l
  17. SELECT shrfirm, shrdiv/shrprice*100 AS yield FROM shr WHERE shrfirm NOT IN ('Bolivian Sheep', 'Canadian Sugar');
  18.  
  19. -- Exercise 3n
  20. SELECT shrfirm, shrprice*shrqty AS totalvalue FROM shr ORDER BY totalvalue DESC;
  21.  
  22. -- Exercise 3p
  23. SELECT shrcode, shrfirm FROM shr WHERE shrcode LIKE 'B%';
Add Comment
Please, Sign In to add comment