Skip to content

Commit

Permalink
update queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongsjtu committed May 17, 2017
1 parent 802a902 commit 988e68b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion kylin/query/Q1.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
select sum(v_revenue) as revenue
from p_lineorder
left join dates on lo_orderdate = d_datekey
where d_year = 1993;
where d_year = 1993
and lo_discount between 1 and 3
and lo_quantity < 25;
4 changes: 3 additions & 1 deletion kylin/query/Q1.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
select sum(v_revenue) as revenue
from p_lineorder
left join dates on lo_orderdate = d_datekey
where d_yearmonthnum = 199401;
where d_yearmonthnum = 199401
and lo_discount between 4 and 6
and lo_quantity between 26 and 35;
4 changes: 3 additions & 1 deletion kylin/query/Q1.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
select sum(v_revenue) as revenue
from p_lineorder
left join dates on lo_orderdate = d_datekey
where d_weeknuminyear = 6 and d_year = 1994;
where d_weeknuminyear = 6 and d_year = 1994
and lo_discount between 5 and 7
and lo_quantity between 26 and 35;
2 changes: 1 addition & 1 deletion kylin/query/Q2.3
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ from p_lineorder
left join dates on lo_orderdate = d_datekey
left join part on lo_partkey = p_partkey
left join supplier on lo_suppkey = s_suppkey
where p_brand = 'MFGR#2239' and s_region = 'EUROPE'
where p_brand = 'MFGR#2221' and s_region = 'EUROPE'
group by d_year, p_brand
order by d_year, p_brand;

0 comments on commit 988e68b

Please sign in to comment.