← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Write a SQL query that retrieves the total sales amount for each product, categorized by quarters of the year. The query should sum the sales amounts for each quarter and pivot the results so that each quarter becomes its own column. The output should have one row per product with columns for Q1, Q2, Q3, and Q4 showing the total sales for that quarter. You must use conditional aggregation with CASE WHEN statements to achieve the pivot.