- For each
employee,
list
his/her fname and lname, and his/her
manager's
fname and lname.
Solution:
List the employee's name and his/her supervisor SSN:
SELECT fname, lname, superssn
FROM employee
Add in supervisor's information:
SELECT fname, lname, fname, lname
FROM employee, employee
where superssn = ssn (red attr belongs to supervisor !!)
Solution: use alias:
SELECT e.fname, e.lname, m.fname, m.lname
FROM employee e, employee m
WHERE e.superssn = m.ssn;
|
|