Good evening, I'm new to SQL and I have a question.
I have the following database:
Mygoalistopresentthenamesoftheemployees,theirroleandthenameofthedepartmentwheretheywork,havingtobetheresultorderedbythenameofthedepartmentandwithinthedepartmentbythenameoftheemployee.HoweverIamaskedtopresentthenameofthedepartmentwherenooneworks,havingtheresultofbeingequaltothefollowingimage:
Without the NULL part I know the code would be:
select emp.nome, emp.funcao, dep.nome
from emp, dep
where emp.ndep = dep.ndep
order by dep.nome, emp.nome;
However I can not figure out how to include NULL in the table, I've tried using IS NULL but it gives me an error, probably because I'm using it badly. Can someone help me?
Thank you