Complete the code to calculate the total salary from the employees table.
SELECT [1](salary) FROM employees;The SUM function adds up all the values in the salary column.
Complete the code to find the total price of all products in the products table.
SELECT [1](price) AS total_price FROM products;The SUM function adds all the prices to get the total price.
Fix the error in the code to correctly calculate the total quantity from the orders table.
SELECT [1](quantity) FROM orders;The correct function to add all quantities is SUM. COUNT counts rows, GROUP is not a function, and TOTAL is not standard SQL.
Fill both blanks to calculate the total sales for each product in the sales table.
SELECT product_id, [1](amount) AS total_amount FROM sales [2] product_id;
Use SUM to add amounts and GROUP BY to group results by product_id.
Fill all three blanks to calculate the total revenue for each category in the products table.
SELECT [1], [2](price) AS total_revenue FROM products [3] category;
Select the category column, sum the price column, and group by category to get total revenue per category.