Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. 1. Find the full name of the highest-paid staff member.
  2. SELECT TOP name
  3. FROM staff
  4. WHERE salary = (SELECT MAX(salary) FROM staff)
  5.  
  6.  
  7. 2. Find the full name of the lowest-paid manager.
  8. SELECT TOP name
  9. FROM staff
  10. WHERE salary = (SELECT min(salary) FROM staff)
  11.  
  12.  
  13. 3. Find the oldest comment on PropertyNo P13.
  14. select min(date)
  15. from comments
  16. 4. Find the full name of the renter willing to pay most for a house.
  17. select fname lname
  18. from renter
  19. where rent = max(rent)
  20. 5. Find the address of the most expensive Cork apartment.
  21. select address
  22. from properties
  23. where city = cork and type = apartment and rent = max(rent)
  24.  
  25. HINTS. Check the lecture notes on ALL and SOME (or you could use MAX
  26. and MIN which I mentioned briefly).
  27.  
  28. DEADLINE. The end of semester is a week on Friday but let's take
  29. until Friday 10 April. (Also lab 3 if you didn't submit it already.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement