SELECT Fname,Lname,Address
FROM employee
WHERE EXISTS (SELECT *
FROM dependent
WHERE Ssn=Essn AND Relationship='Son' AND NOT Relationship='Daughter')
GROUP BY Ssn
I'm trying to List the first name, last name, and address of all employees who have a son as a dependent but do not have a daughter as a dependent.
<> relationship='Daughter'
, and notNOT
, I believe. – Sean Brookins Oct 21 at 20:44