Skip to content

Commit e0c86fe

Browse files
Merge 2d25046 into 9918d3c
2 parents 9918d3c + 2d25046 commit e0c86fe

File tree

4 files changed

+871
-2
lines changed

4 files changed

+871
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
pragma TablePathPrefix = "/Root/";
2+
3+
-- TPC-H/TPC-R National Market Share Query (Q8)
4+
-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
5+
-- using 1680793381 as a seed to the RNG
6+
7+
select
8+
o_year,
9+
sum(case
10+
when nation = 'MOZAMBIQUE' then volume
11+
else 0
12+
end) / sum(volume) as mkt_share
13+
from
14+
(
15+
select
16+
DateTime::GetYear(o_orderdate) as o_year,
17+
l_extendedprice * (1 - l_discount) as volume,
18+
n2.n_name as nation
19+
from
20+
part
21+
cross join supplier
22+
cross join lineitem
23+
cross join orders
24+
cross join customer
25+
cross join nation n1
26+
cross join nation n2
27+
cross join region
28+
where
29+
p_partkey = l_partkey
30+
and s_suppkey = l_suppkey
31+
and l_orderkey = o_orderkey
32+
and o_custkey = c_custkey
33+
and c_nationkey = n1.n_nationkey
34+
and n1.n_regionkey = r_regionkey
35+
and r_name = 'AFRICA'
36+
and s_nationkey = n2.n_nationkey
37+
and o_orderdate between date('1995-01-01') and date('1996-12-31')
38+
and p_type = 'ECONOMY PLATED COPPER'
39+
) as all_nations
40+
group by
41+
o_year
42+
order by
43+
o_year;

0 commit comments

Comments
 (0)