Complete the code to group the sales by both city and product.
SELECT city, product, SUM(sales) FROM sales_data GROUP BY [1];The GROUP BY clause must include both city and product to group by multiple columns.
Complete the code to count the number of orders grouped by customer and order_date.
SELECT customer_id, order_date, COUNT(*) FROM orders GROUP BY [1];To group by both customer_id and order_date, list both columns separated by a comma in the GROUP BY clause.
Fix the error in the GROUP BY clause to correctly group by both department and role.
SELECT department, role, AVG(salary) FROM employees GROUP BY [1];The columns in GROUP BY must be separated by commas without extra trailing commas.
Fill both blanks to group sales by region and product category.
SELECT [1], [2], SUM(amount) FROM sales GROUP BY [1], [2];
You must select and group by the same columns: region and product_category.
Fill all three blanks to select city, category, and total sales grouped by city and category.
SELECT [1], [2], SUM([3]) FROM sales_data GROUP BY [1], [2];
The query selects city and category and sums the sales column, grouping by city and category.