Instagram
youtube
Facebook
Twitter

Count the Number of Discontinued Products

Count the Number of Discontinued Products
Product Table:


Query Explanation:

  • COUNT(*): Counts the number of rows where the condition is true.

  • WHERE Discontinued = 1: Filters only those products that are marked as discontinued.

  • AS DiscontinuedProductCount: Gives a clear alias to the output column.

SQL Query:

SELECT COUNT(*) AS DiscontinuedProductCount
FROM Products
WHERE Discontinued = 1;

Output: