You are on page 1of 2

SOAL 1

select
year(o.order_date) as Tahun,
Count(*)
from northwind.orders o
group by Tahun

SOAL 2

select
od.product_id ,
Round(sum(od.unit_price*od.quantity*(1-od.discount)), 0) as Nilai_penjualan
from northwind.order_details od
group by product_id
order by Nilai_penjualan desc

SOAL 3

select
o.customer_id ,
round(sum(od.unit_price*od.quantity*(1-od.discount)), 0) as Nilai_Penjualan
from northwind.order_details od
join northwind.orders o
on o.order_id =od.order_id
group by o.customer_id
order by Nilai_penjualan desc
limit 5

SOAL 4

select
year(o.order_date) as Tahun,
o.customer_id ,
round(sum(od.unit_price*od.quantity*(1-od.discount)), 0) as Nilai_Penjualan
from northwind.order_details od
join northwind.orders o
on o.order_id =od.order_id
where year(o.order_date)=1996
group by Tahun, o.customer_id
order by Nilai_penjualan desc
limit 5
SOAL 5

select
od.product_id ,
Round(sum(od.unit_price*od.quantity*(1-od.discount)),0) as Nilai_Penjualan
from northwind.order_details od
join northwind.orders o
on o.order_id =od.order_id
where o.customer_id ="QUICK"
group by product_id
order by Nilai_Penjualan desc
limit 10

You might also like