You are on page 1of 1

Rollup:

On Dealer name:
select dealer.Dealer_name, sum(revenue.units_sold)
from revenue
inner join dealer on revenue.Dealer_id = dealer.Dealer_id
group by dealer.Dealer_name with rollup

On Product name:
select product.Product_name, sum(revenue.units_sold)
from revenue
inner join product on revenue.Model_id = product.Model_id
group by product.Product_name with rollup
Slice:
On fuel_type
select variant.Variant_name, product.Product_name
from variant
inner join product on variant.Variant_id = product.Variant_id
where variant.Fuel_type ='PETROL'

On variant_type:
select variant.Variant_name, product.Product_name
from variant
inner join product on variant.Variant_id = product.Variant_id
where variant.Fuel_type ='PETROL'
Dice:
select dealer.Dealer_name, product.Product_name, branch.Branch_name,
t_date.T_date, revenue.units_sold, revenue.Revenue
from revenue
inner join dealer on revenue.Dealer_id=dealer.Dealer_id
inner join product on revenue.Model_id=product.Model_id
inner join branch on revenue.Branch_id=branch.Branch_id
inner join t_date on revenue.Date_id=t_date.Date_id
where quarter(T_date) = 2
and
units_sold>5

You might also like