Book Restock Receipt
Part of the SQL Foundations section of Coddy's PostgreSQL journey. Lesson 21 of 22.
Challenge
MediumIn one UPDATE, add two units to the stock of every active books product. Then return category and stock_value for all products grouped by category, with stock_value equal to SUM(price * 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