← Back to Subqueries
Question 111
Instructors Who Do Not Head a Department
Instructors Who Do Not Head a Department
List the seven instructors who are not the head of any department. Returnfirst_nameandlast_name, sorted bylast_name. Business has no head, sohead_instructor_idis NULL there, and a naiveNOT INwould return no rows at all: make the subquery leave that NULL out.
Expected result:
+------------+-----------+ | first_name | last_name | +------------+-----------+ | Mei | Chen | | Olivia | Grant | | Marcus | Lindqvist | | Priya | Natarajan | | Tomasz | Nowak | | Daniel | Reyes | | Yuki | Tanaka | +------------+-----------+ 7 rows
Hints3 available
Sign in to use hintsTopics:
Subqueries
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)
Results
Run your SQL to see every statement's output here, then how it compares with the expected answer.
Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.