Fiz um teste e aqui funciona.
SELECT NomeD
FROM DISCIPLINA
WHERE PreReqD IS NULL
AND CodD NOT IN
(SELECT PreReqD
FROM DISCIPLINA
WHERE PreReqD IS NOT NULL)
Fiz um teste e aqui funciona.
SELECT NomeD
FROM DISCIPLINA
WHERE PreReqD IS NULL
AND CodD NOT IN
(SELECT PreReqD
FROM DISCIPLINA
WHERE PreReqD IS NOT NULL)