select country, category, year, sum(amount)
from   sales, location, product, time
where  sales.locid=location.locid and
       sales.pid=product.pid and
       sales.tid=time.tid
group by country, category, year
order by country, category, year;
