Unanswered: Urgent help needed with a couple of queries
I have written a couple of queries which I would like to have some feedback on on how they can be improved.
The first query is:
FROM person p, employee e
WHERE p.pnum = e.pnum
AND e.salary IN
FROM employee e);
Basically, this query finds the name of the employee who earns the lowest salary. BUT, how do I manipulate this query in such a way that it finds the name of the employee who earns the SECOND lowest salary? I cannot seem to figure it out.
The second query in question is:
SELECT p.pname, e.office
FROM person p LEFT JOIN employee e
ON p.pnum = e.pnum;
This query most probably doesn't work. It is intended to find the name(s) of the employee(s) who do not share an office. Could someone please help me out with this sticky query?