This is just homework currently, but I am having trouble writing a SELECT statement for this question:
Produce a result set showing department name, department description, employee first name, and employee last name for ALL departments, including those for whom no employee has been assigned. Sort by department name.
I believe I have the SELECT, FROM, WHERE, and ORDER BY down, but the NOT EXISTS is where I am struggling.
Here is the table:
SELECT deptName, deptDesc, empFirstName, empLastName
FROM department, employee
WHERE department.deptID=employee.deptID
AND NOT EXISTS (
SELECT deptName, deptDesc
FROM
ORDER BY deptName ;
At this point I am just trying to include those for whom no employee has been assigned.