BEGIN; BEGIN select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01' and o_orderdate < date '1995-01-01' + interval '1 year' group by n_name order by revenue desc; n_name | revenue ---------------------------+------------------ CANADA | 5324763873.26042 BRAZIL | 5304189690.4554 UNITED STATES | 5287288954.88669 PERU | 5266531795.00072 ARGENTINA | 5265287940.67824 (5 rows) COMMIT; COMMIT