Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Find the full name of the highest-paid staff member.
- SELECT TOP name
- FROM staff
- WHERE salary = (SELECT MAX(salary) FROM staff)
- 2. Find the full name of the lowest-paid manager.
- SELECT TOP name
- FROM staff
- WHERE salary = (SELECT min(salary) FROM staff)
- 3. Find the oldest comment on PropertyNo P13.
- select min(date)
- from comments
- 4. Find the full name of the renter willing to pay most for a house.
- select fname lname
- from renter
- where rent = max(rent)
- 5. Find the address of the most expensive Cork apartment.
- select address
- from properties
- where city = cork and type = apartment and rent = max(rent)
- HINTS. Check the lecture notes on ALL and SOME (or you could use MAX
- and MIN which I mentioned briefly).
- DEADLINE. The end of semester is a week on Friday but let's take
- until Friday 10 April. (Also lab 3 if you didn't submit it already.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement