Preview:
----temukan total pembelian terbanyak berdasarkan category tiap tahun

with t1 as(
select ct.category,sum(quantity) as totalbuy,extract(year from order_date) as datee
from orders_table as ot
join categories_table as ct
on ot.product_id = ct.productid
group by 1,3
)

select *
from t1
order by datee asc, totalbuy desc;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter