Skip to content

Commit 60846ce

Browse files
committed
Add a SSB query suite
1 parent 3775dd3 commit 60846ce

File tree

15 files changed

+211
-2
lines changed

15 files changed

+211
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
select sum(lo_extendedprice*lo_discount) as revenue
2+
from lineorder, date
3+
where lo_orderdate = d_datekey
4+
and d_year = 1993
5+
and lo_discount between 1 and 3
6+
and lo_quantity < 25
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
select sum(lo_extendedprice*lo_discount) as revenue
2+
from lineorder, date
3+
where lo_orderdate = d_datekey
4+
and d_yearmonthnum = 199401
5+
and lo_discount between 4 and 6
6+
and lo_quantity between 26 and 35
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
select sum(lo_extendedprice*lo_discount) as revenue
2+
from lineorder, date
3+
where lo_orderdate = d_datekey
4+
and d_weeknuminyear = 6 and d_year = 1994
5+
and lo_discount between 5 and 7
6+
and lo_quantity between 36 and 40
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
select sum(lo_revenue), d_year, p_brand1
2+
from lineorder, date, part, supplier
3+
where lo_orderdate = d_datekey
4+
and lo_partkey = p_partkey
5+
and lo_suppkey = s_suppkey
6+
and p_category = 'MFGR#12'
7+
and s_region = 'AMERICA'
8+
group by d_year, p_brand1
9+
order by d_year, p_brand1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
select sum(lo_revenue), d_year, p_brand1
2+
from lineorder, date, part, supplier
3+
where lo_orderdate = d_datekey
4+
and lo_partkey = p_partkey
5+
and lo_suppkey = s_suppkey
6+
and p_brand1 between 'MFGR#2221' and 'MFGR#2228'
7+
and s_region = 'ASIA'
8+
group by d_year, p_brand1
9+
order by d_year, p_brand1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
select sum(lo_revenue), d_year, p_brand1
2+
from lineorder, date, part, supplier
3+
where lo_orderdate = d_datekey
4+
and lo_partkey = p_partkey
5+
and lo_suppkey = s_suppkey
6+
and p_brand1 = 'MFGR#2221'
7+
and s_region = 'EUROPE'
8+
group by d_year, p_brand1
9+
order by d_year, p_brand1
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
select c_nation, s_nation, d_year, sum(lo_revenue) as revenue
2+
from customer, lineorder, supplier, date
3+
where lo_custkey = c_custkey
4+
and lo_suppkey = s_suppkey
5+
and lo_orderdate = d_datekey
6+
and c_region = 'ASIA'
7+
and s_region = 'ASIA'
8+
and d_year >= 1992 and d_year <= 1997
9+
group by c_nation, s_nation, d_year
10+
order by d_year asc, revenue desc
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
select c_city, s_city, d_year, sum(lo_revenue) as revenue
2+
from customer, lineorder, supplier, date
3+
where lo_custkey = c_custkey
4+
and lo_suppkey = s_suppkey
5+
and lo_orderdate = d_datekey
6+
and c_nation = 'UNITED STATES'
7+
and s_nation = 'UNITED STATES'
8+
and d_year >= 1992 and d_year <= 1997
9+
group by c_city, s_city, d_year
10+
order by d_year asc, revenue desc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
select c_city, s_city, d_year, sum(lo_revenue) as revenue
2+
from customer, lineorder, supplier, date
3+
where lo_custkey = c_custkey
4+
and lo_suppkey = s_suppkey
5+
and lo_orderdate = d_datekey
6+
and c_nation = 'UNITED KINGDOM'
7+
and (c_city='UNITED KI1' or c_city='UNITED KI5')
8+
and (s_city='UNITED KI1' or s_city='UNITED KI5')
9+
and s_nation = 'UNITED KINGDOM'
10+
and d_year >= 1992 and d_year <= 1997
11+
group by c_city, s_city, d_year
12+
order by d_year asc, revenue desc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
select c_city, s_city, d_year, sum(lo_revenue) as revenue
2+
from customer, lineorder, supplier, date
3+
where lo_custkey = c_custkey
4+
and lo_suppkey = s_suppkey
5+
and lo_orderdate = d_datekey
6+
and c_nation = 'UNITED KINGDOM'
7+
and (c_city='UNITED KI1' or c_city='UNITED KI5')
8+
and (s_city='UNITED KI1' or s_city='UNITED KI5')
9+
and s_nation = 'UNITED KINGDOM'
10+
and d_yearmonth = 'Dec1997'
11+
group by c_city, s_city, d_year
12+
order by d_year asc, revenue desc

0 commit comments

Comments
 (0)