summaryrefslogtreecommitdiffstats
path: root/src/s3select/TPCDS/sample-queries-tpcds/query91.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/s3select/TPCDS/sample-queries-tpcds/query91.sql')
-rw-r--r--src/s3select/TPCDS/sample-queries-tpcds/query91.sql31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/s3select/TPCDS/sample-queries-tpcds/query91.sql b/src/s3select/TPCDS/sample-queries-tpcds/query91.sql
new file mode 100644
index 000000000..057c76ba8
--- /dev/null
+++ b/src/s3select/TPCDS/sample-queries-tpcds/query91.sql
@@ -0,0 +1,31 @@
+-- start query 1 in stream 0 using template query91.tpl and seed 1930872976
+select
+ cc_call_center_id Call_Center,
+ cc_name Call_Center_Name,
+ cc_manager Manager,
+ sum(cr_net_loss) Returns_Loss
+from
+ call_center,
+ catalog_returns,
+ date_dim,
+ customer,
+ customer_address,
+ customer_demographics,
+ household_demographics
+where
+ cr_call_center_sk = cc_call_center_sk
+and cr_returned_date_sk = d_date_sk
+and cr_returning_customer_sk= c_customer_sk
+and cd_demo_sk = c_current_cdemo_sk
+and hd_demo_sk = c_current_hdemo_sk
+and ca_address_sk = c_current_addr_sk
+and d_year = 2000
+and d_moy = 12
+and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown')
+ or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree'))
+and hd_buy_potential like 'Unknown%'
+and ca_gmt_offset = -7
+group by cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status
+order by sum(cr_net_loss) desc;
+
+-- end query 1 in stream 0 using template query91.tpl