Management wants a category-level sales summary. Write a que…

Management wants a category-level sales summary. Write a query showing for each product category:category, total_products_sold, total_revenue, avg_purchase_amount, highest_purchase total_products_sold = total quantity sold across all purchases total_revenue = sum of all purchase amounts avg_purchase_amount = average purchase amount highest_purchase = the single largest purchase amount in that category Sorted by total_revenue descending. Table: products, purchases

Write the SQL query to provide information for this analysis…

Write the SQL query to provide information for this analysis: For customers who made purchases in April or May 2024, calculate how many days it has been since their last purchase (use Dec 31, 2024 as the reference date). This will help identify customers for re-engagement campaigns Display: customer_id, last_purchase_date, days_since_purchase (sorted by last_purchase_date ascending) Tables: purchases