Menu
CoddyTech

Category Restock Budget

Part of the SQL Foundations section of Coddy's PostgreSQL journey. Lesson 15 of 22.

challenge icon

Challenge

Medium

For active products only, return category, product_count and stock_value. Keep categories with at least two active products. stock_value is the sum of price times stock; order by category.

The input tables are shown in the test panel. Each run starts from fresh data. Return the named columns in the stated order; do not hard-code the displayed rows.

Try it yourself

-- Write your SQL here.

All lessons in SQL Foundations

Practice on your own: PostgreSQL playground