SQL · Amazon · Easy
Problem Description You are given a table named product_spend: > > >The combination (user_id, transaction_date) is the primary key for this table. Write a SQL query that finds the two highest-grossing products inside each category during the year 2022. Return the columns category, product, and total_spend — where total_spend is the sum of the spend column for that product across all 2022 transactions. When two products have the same total spend, choosing either one is…
Checking your access…