The question I'm trying to answer is
Write a SELECT statement that returns the CategoryName 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.
The Categories table includes the columns: CategoryID
and CategoryName
The Products table includes the columns: ProductID
,CategoryID
,ProductCode
,ProductName
,Description
,ListPrice
,DiscountPercent
,DateAdded
This is what I've tried:
SELECT CategoryName
From Categories
Where NOT EXISTS(SELECT CategoryID FROM Products WHERE CategoryID IS NOT NULL)
Anything helps, thanks!