- The set of
foreign keys of employees
with a dependent is:
select essn
from dependent
Result:
+-----------+
| essn |
+-----------+
| 333445555 |
| 333445555 |
| 333445555 |
| 987654321 |
| 123456789 |
| 123456789 |
| 123456789 |
+-----------+
|
- To find the fname and
lname of these
employees:
select fname, lname
from employee
where ssn IN (select essn
from dependent
)
Result:
+-----------+--------+---------+
| ssn | fname | lname |
+-----------+--------+---------+
| 123456789 | John | Smith |
| 333445555 | Frankl | Wong |
| 987654321 | Jennif | Wallace |
+-----------+--------+---------+
(I included SSN for clarity)
|
|