This is a homework question using subqueries, and the closest example the professor has given wasn't that helpful. We basically have a big table of products with the relevant rows
ProductID, SupplierID, CategoryID
select Products.SupplierID, CompanyName, Products.CategoryID, CategoryName
join Categories ON Products.CategoryID = Categories.CategoryID
join SUPPLIERS ON Products.SupplierID = Suppliers.SupplierID
where Products.SupplierID = ANY (select top 3 with ties Products.SupplierID
group by Products.SupplierID
order by count(*) desc);
I think that you would just need to change your WHERE Statement to look for the Supplier ID's that have 2 distinct CategoryID's. You are really close, it would just be removing the Top 3 and Order by, then adding a HAVING statement at the end showing
COUNT(DISTINCT(Products.CatigoryID)) = 2.
I hope that helps get you where you need to go.