1
0

query41.sql 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. -- start query 1 in stream 0 using template query41.tpl and seed 1581015815
  2. select distinct(i_product_name)
  3. from item i1
  4. where i_manufact_id between 970 and 970+40
  5. and (select count(*) as item_cnt
  6. from item
  7. where (i_manufact = i1.i_manufact and
  8. ((i_category = 'Women' and
  9. (i_color = 'frosted' or i_color = 'rose') and
  10. (i_units = 'Lb' or i_units = 'Gross') and
  11. (i_size = 'medium' or i_size = 'large')
  12. ) or
  13. (i_category = 'Women' and
  14. (i_color = 'chocolate' or i_color = 'black') and
  15. (i_units = 'Box' or i_units = 'Dram') and
  16. (i_size = 'economy' or i_size = 'petite')
  17. ) or
  18. (i_category = 'Men' and
  19. (i_color = 'slate' or i_color = 'magenta') and
  20. (i_units = 'Carton' or i_units = 'Bundle') and
  21. (i_size = 'N/A' or i_size = 'small')
  22. ) or
  23. (i_category = 'Men' and
  24. (i_color = 'cornflower' or i_color = 'firebrick') and
  25. (i_units = 'Pound' or i_units = 'Oz') and
  26. (i_size = 'medium' or i_size = 'large')
  27. ))) or
  28. (i_manufact = i1.i_manufact and
  29. ((i_category = 'Women' and
  30. (i_color = 'almond' or i_color = 'steel') and
  31. (i_units = 'Tsp' or i_units = 'Case') and
  32. (i_size = 'medium' or i_size = 'large')
  33. ) or
  34. (i_category = 'Women' and
  35. (i_color = 'purple' or i_color = 'aquamarine') and
  36. (i_units = 'Bunch' or i_units = 'Gram') and
  37. (i_size = 'economy' or i_size = 'petite')
  38. ) or
  39. (i_category = 'Men' and
  40. (i_color = 'lavender' or i_color = 'papaya') and
  41. (i_units = 'Pallet' or i_units = 'Cup') and
  42. (i_size = 'N/A' or i_size = 'small')
  43. ) or
  44. (i_category = 'Men' and
  45. (i_color = 'maroon' or i_color = 'cyan') and
  46. (i_units = 'Each' or i_units = 'N/A') and
  47. (i_size = 'medium' or i_size = 'large')
  48. )))) > 0
  49. order by i_product_name
  50. limit 100;
  51. -- end query 1 in stream 0 using template query41.tpl