12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- --!syntax_pg
- --TPC-DS Q48
- -- start query 1 in stream 0 using template ../query_templates/query48.tpl
- select sum (ss_quantity)
- from plato.store_sales, plato.store, plato.customer_demographics, plato.customer_address, plato.date_dim
- where s_store_sk = ss_store_sk
- and ss_sold_date_sk = d_date_sk and d_year = 1998
- and
- (
- (
- cd_demo_sk = ss_cdemo_sk
- and
- cd_marital_status = 'M'
- and
- cd_education_status = '4 yr Degree'
- and
- ss_sales_price between 100.00::numeric and 150.00::numeric
- )
- or
- (
- cd_demo_sk = ss_cdemo_sk
- and
- cd_marital_status = 'D'
- and
- cd_education_status = 'Primary'
- and
- ss_sales_price between 50.00::numeric and 100.00::numeric
- )
- or
- (
- cd_demo_sk = ss_cdemo_sk
- and
- cd_marital_status = 'U'
- and
- cd_education_status = 'Advanced Degree'
- and
- ss_sales_price between 150.00::numeric and 200.00::numeric
- )
- )
- and
- (
- (
- ss_addr_sk = ca_address_sk
- and
- ca_country = 'United States'
- and
- ca_state in ('KY', 'GA', 'NM')
- and ss_net_profit between 0::numeric and 2000::numeric
- )
- or
- (ss_addr_sk = ca_address_sk
- and
- ca_country = 'United States'
- and
- ca_state in ('MT', 'OR', 'IN')
- and ss_net_profit between 150::numeric and 3000::numeric
- )
- or
- (ss_addr_sk = ca_address_sk
- and
- ca_country = 'United States'
- and
- ca_state in ('WI', 'MO', 'WV')
- and ss_net_profit between 50::numeric and 25000::numeric
- )
- )
- ;
- -- end query 1 in stream 0 using template ../query_templates/query48.tpl
|