188k views
2 votes
Write a SELECT statement that returns the category_name column from the Categories table. Return one row for each category that has never been assigned to any product in the Products table. To do that, use a subquery introduced with the NOT EXISTS operator.

User Jiana
by
5.9k points

1 Answer

4 votes

Answer:

Below is the required statement:

Step-by-step explanation:

select c.categoryname

from categories c

where not exists (select 1 from products p where p.categoryid = c.categoryid);

User Chromos
by
6.4k points