forked from catarinaribeir0/queries-tpch-dbgen-mysql
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path19.sql
39 lines (39 loc) · 1.15 KB
/
19.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
select
sum(l_extendedprice * (1 - l_discount)) as revenue
from
lineitem,
part
where
(
p_partkey = l_partkey
and p_brand = 'Brand#52'
and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
and l_quantity >= 4
and l_quantity <= 4 + 10
and p_size between 1
and 5
and l_shipmode in ('AIR', 'AIR REG')
and l_shipinstruct = 'DELIVER IN PERSON'
)
or (
p_partkey = l_partkey
and p_brand = 'Brand#11'
and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
and l_quantity >= 18
and l_quantity <= 18 + 10
and p_size between 1
and 10
and l_shipmode in ('AIR', 'AIR REG')
and l_shipinstruct = 'DELIVER IN PERSON'
)
or (
p_partkey = l_partkey
and p_brand = 'Brand#51'
and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
and l_quantity >= 29
and l_quantity <= 29 + 10
and p_size between 1
and 15
and l_shipmode in ('AIR', 'AIR REG')
and l_shipinstruct = 'DELIVER IN PERSON'
);