Answer:
SELECT C.CategoryName,COUNT(P.CategoryID) AS NumberOfProducts, MAX(P.ListPrice) AS
MostExpensiveProduct
FROM Categories C, Products P
WHERE P.CategoryID=C.CategoryID
GROUP BY C.CategoryName ORDER BY COUNT(*) desc;
Explanation:
This program uses a SELECT statement to arrive at its outout or perform its function.
The SELECT statement helps to return one row for each category that has products.
This is done by Sorting the result set so the category with the most products appears first.