designs.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [
  2. {
  3. "name":"Sample: Top salary",
  4. "desc":"Top salary 2007 above $100k",
  5. "type":"0",
  6. "data":{
  7. "query":{
  8. "query":"SELECT sample_07.description, sample_07.salary\r\nFROM\r\n sample_07\r\nWHERE\r\n( sample_07.salary > 100000)\r\nORDER BY sample_07.salary DESC\r\nLIMIT 1000",
  9. "type":0,
  10. "email_notify":false,
  11. "is_parameterized":false,
  12. "database":"default"
  13. },
  14. "functions":[ ],
  15. "VERSION":"0.4.1",
  16. "file_resources":[ ],
  17. "settings":[ ]
  18. }
  19. },
  20. {
  21. "name":"Sample: Salary growth",
  22. "desc":"Salary growth (sorted) from 2007-08",
  23. "type":"0",
  24. "data":{
  25. "query":{
  26. "query":"SELECT s07.description, s07.salary, s08.salary,\r\n s08.salary - s07.salary\r\nFROM\r\n sample_07 s07 JOIN sample_08 s08\r\nON ( s07.code = s08.code)\r\nWHERE\r\n s07.salary < s08.salary\r\nORDER BY s08.salary-s07.salary DESC\r\nLIMIT 1000",
  27. "type":0,
  28. "email_notify":false,
  29. "is_parameterized":false,
  30. "database":"default"
  31. },
  32. "functions":[ ],
  33. "VERSION":"0.4.1",
  34. "file_resources":[ ],
  35. "settings":[ ]
  36. }
  37. },
  38. {
  39. "name":"Sample: Job loss",
  40. "desc":"Job loss among the top earners 2007-08",
  41. "type":"0",
  42. "data":{
  43. "query":{
  44. "query":"SELECT s07.description, s07.total_emp, s08.total_emp, s07.salary\r\nFROM\r\n sample_07 s07 JOIN \r\n sample_08 s08\r\nON ( s07.code = s08.code )\r\nWHERE\r\n( s07.total_emp > s08.total_emp\r\n AND s07.salary > 100000 )\r\nORDER BY s07.salary DESC\nLIMIT 1000",
  45. "type":0,
  46. "email_notify":false,
  47. "is_parameterized":false,
  48. "database":"default"
  49. },
  50. "functions":[ ],
  51. "VERSION":"0.4.1",
  52. "file_resources":[ ],
  53. "settings":[ ]
  54. }
  55. },
  56. {
  57. "name":"Sample: Customers",
  58. "desc":"Email Survey Opt-Ins, Customers for Shipping ZIP Code, Total Amount per Order",
  59. "type":"0",
  60. "data":{
  61. "query":{
  62. "query": "-- Get email survey opt-in values for all customers\nSELECT\r\n c.id,\r\n c.name,\r\n c.email_preferences.categories.surveys\r\nFROM customers c;\n\n\n\n-- Select customers for a given shipping ZIP Code\nSELECT\r\n customers.id,\r\n customers.name\r\nFROM customers\r\nWHERE customers.addresses['shipping'].zip_code = '76710';\n\n\n\n-- Compute total amount per order for all customers\nSELECT\r\n c.id AS customer_id,\r\n c.name AS customer_name,\r\n ords.order_id AS order_id,\r\n SUM(order_items.price * order_items.qty) AS total_amount\r\nFROM\r\n customers c\r\nLATERAL VIEW EXPLODE(c.orders) o AS ords\r\nLATERAL VIEW EXPLODE(ords.items) i AS order_items\r\nGROUP BY c.id, c.name, ords.order_id;",
  63. "type":0,
  64. "email_notify":false,
  65. "is_parameterized":false,
  66. "database":"default"
  67. },
  68. "functions":[ ],
  69. "VERSION":"0.4.1",
  70. "file_resources":[ ],
  71. "settings":[ ]
  72. }
  73. },
  74. {
  75. "name":"Sample: Top salary",
  76. "desc":"Top salary 2007 above $100k",
  77. "type":"1",
  78. "data":{
  79. "query":{
  80. "query":"SELECT sample_07.description, sample_07.salary\r\nFROM\r\n sample_07\r\nWHERE\r\n( sample_07.salary > 100000)\r\nORDER BY sample_07.salary DESC\r\nLIMIT 1000",
  81. "type":1,
  82. "email_notify":false,
  83. "is_parameterized":false,
  84. "database":"default"
  85. },
  86. "functions":[ ],
  87. "VERSION":"0.4.1",
  88. "file_resources":[ ],
  89. "settings":[ ]
  90. }
  91. },
  92. {
  93. "name":"Sample: Salary growth",
  94. "desc":"Salary growth (sorted) from 2007-08",
  95. "type":"1",
  96. "data":{
  97. "query":{
  98. "query":"SELECT s07.description, s07.salary, s08.salary,\r\n s08.salary - s07.salary\r\nFROM\r\n sample_07 s07 JOIN sample_08 s08\r\nON ( s07.code = s08.code)\r\nWHERE\r\n s07.salary < s08.salary\r\nORDER BY s08.salary-s07.salary DESC\r\nLIMIT 1000",
  99. "type":1,
  100. "email_notify":false,
  101. "is_parameterized":false,
  102. "database":"default"
  103. },
  104. "functions":[ ],
  105. "VERSION":"0.4.1",
  106. "file_resources":[ ],
  107. "settings":[ ]
  108. }
  109. },
  110. {
  111. "name":"Sample: Job loss",
  112. "desc":"Job loss among the top earners 2007-08",
  113. "type":"1",
  114. "data":{
  115. "query":{
  116. "query":"SELECT s07.description, s07.total_emp, s08.total_emp, s07.salary\r\nFROM\r\n sample_07 s07 JOIN \r\n sample_08 s08\r\nON ( s07.code = s08.code )\r\nWHERE\r\n( s07.total_emp > s08.total_emp\r\n AND s07.salary > 100000 )\r\nORDER BY s07.salary DESC\nLIMIT 1000",
  117. "type":0,
  118. "email_notify":false,
  119. "is_parameterized":false,
  120. "database":"default"
  121. },
  122. "functions":[ ],
  123. "VERSION":"0.4.1",
  124. "file_resources":[ ],
  125. "settings":[ ]
  126. }
  127. },
  128. {
  129. "name":"Sample: Customers",
  130. "desc":"Email Survey Opt-Ins, Customers for Shipping ZIP Code, Total Amount per Order",
  131. "type":"1",
  132. "data":{
  133. "query":{
  134. "query": "-- Get email survey opt-in values for all customers \nSELECT\r\n c.id,\r\n c.name,\r\n c.email_preferences.categories.surveys\r\nFROM customers c;\n\n\n\n-- Select customers for a given shipping ZIP Code\nSELECT\r\n c.id,\r\n c.name\r\nFROM customers c, c.addresses a\r\nWHERE a.key = 'shipping' and a.zip_code = '76710';\n\n\n\n-- Compute total amount per order for all customers\nSELECT\r\n c.id AS customer_id,\r\n c.name AS customer_name,\r\n o.order_id,\r\n v.total\r\nFROM\r\n customers c,\r\n c.orders o,\r\n (SELECT SUM(price * qty) total FROM o.items) v;",
  135. "type":1,
  136. "email_notify":false,
  137. "is_parameterized":false,
  138. "database":"default"
  139. },
  140. "functions":[ ],
  141. "VERSION":"0.4.1",
  142. "file_resources":[ ],
  143. "settings":[ ]
  144. }
  145. }
  146. ]