1
0

query90.sql 1.1 KB

12345678910111213141516171819202122
  1. -- start query 1 in stream 0 using template query90.tpl and seed 2031708268
  2. select cast(amc as decimal(15,4))/cast(pmc as decimal(15,4)) am_pm_ratio
  3. from ( select count(*) amc
  4. from web_sales, household_demographics , time_dim, web_page
  5. where ws_sold_time_sk = time_dim.t_time_sk
  6. and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
  7. and ws_web_page_sk = web_page.wp_web_page_sk
  8. and time_dim.t_hour between 9 and 9+1
  9. and household_demographics.hd_dep_count = 3
  10. and web_page.wp_char_count between 5000 and 5200) at,
  11. ( select count(*) pmc
  12. from web_sales, household_demographics , time_dim, web_page
  13. where ws_sold_time_sk = time_dim.t_time_sk
  14. and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
  15. and ws_web_page_sk = web_page.wp_web_page_sk
  16. and time_dim.t_hour between 16 and 16+1
  17. and household_demographics.hd_dep_count = 3
  18. and web_page.wp_char_count between 5000 and 5200) pt
  19. order by am_pm_ratio
  20. limit 100;
  21. -- end query 1 in stream 0 using template query90.tpl