Kodewick
Start learning →
Starter←→0 / 70

Everything in stock

#026StarterAggregates2 min

At the end of the month the owner wants to know how many items the shop holds in total. Add up all the stock values in the products table; the result is a single number.

The tables
products
idnamecategorypricestock
1Milk teadrink1230
2Lemon waterdrink850
3Cheesecakecake256
4Cookiesnack580
5Browniecake180
6Iced coffeedrink1520
7Chipssnack740
8Fruit tartcake284
8 rows
query.sql
-- your code here: SUM to add up stock
SELECT stock
FROM products;
Ctrl + Enter runs too
Result

Run shows what your query gives. When it looks right, Submit.