Challenge: Calculate Inventory Value
Task
Swipe to start coding
Write a query to calculate the total inventory value for all products in the products table. The total inventory value is defined as the sum of the product of price and stock for every product.
- Use the
productstable. - Multiply the
priceby thestockfor each product. - Calculate the sum of these values for all products.
- Return the result as a single value with the column name
total_inventory_value.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.86
Challenge: Calculate Inventory Value
Swipe to show menu
Task
Swipe to start coding
Write a query to calculate the total inventory value for all products in the products table. The total inventory value is defined as the sum of the product of price and stock for every product.
- Use the
productstable. - Multiply the
priceby thestockfor each product. - Calculate the sum of these values for all products.
- Return the result as a single value with the column name
total_inventory_value.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 6
single