Complete the code to group the sales by the product column.
SELECT product, SUM(amount) FROM sales [1] product;The GROUP BY clause groups rows that have the same values in specified columns into summary rows.
Complete the code to find the total quantity sold for each category.
SELECT category, SUM(quantity) FROM products [1] category;Use GROUP BY to group rows by category before summing quantities.
Fix the error in the query to correctly group by the customer_id column.
SELECT customer_id, COUNT(order_id) FROM orders [1] customer_id;The query needs GROUP BY to group rows by customer_id before counting orders.
Fill both blanks to group sales by region and calculate the average sales amount.
SELECT [1], AVG(amount) FROM sales [2] region;
The SELECT clause must include the grouping column region, and the query must use GROUP BY to group rows by region.
Fill all three blanks to select the department, count employees, and group by department.
SELECT [1], COUNT(employee_id) FROM employees [2] [3];
The query selects department, counts employees, and groups by department using GROUP BY.