Kodewick
Start learning →
Basic←→0 / 70

Shelf value

#015BasicSELECT3 min

The owner wants to know what each thing on the shelves is worth in total. From the products table, pick every thing's name, and as the second column price * stock.

The tables
products
idnamecategorypricestock
1Milk teadrink1230
2Lemon waterdrink850
3Cheesecakecake256
4Cookiesnack580
5Browniecake180
6Iced coffeedrink1520
7Chipssnack740
8Fruit tartcake284
8 rows
query.sql
-- your code here: the second column isn't stored, it's worked out as price * stock
SELECT name, price
FROM products;
Ctrl + Enter runs too
Result

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