|
@@ -0,0 +1,165 @@
|
|
|
|
|
+[
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Salary Analysis",
|
|
|
|
|
+ "desc": "Top salary 2007 above $100k, Salary growth (sorted) from 2007-08",
|
|
|
|
|
+ "type": "0",
|
|
|
|
|
+ "dialects": ["postgresql", "mysql", "presto"],
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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;\n\n\nSELECT 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;\n\n\n",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Top salary",
|
|
|
|
|
+ "desc": "Top salary 2007 above $100k",
|
|
|
|
|
+ "type": "0",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Salary growth",
|
|
|
|
|
+ "desc": "Salary growth (sorted) from 2007-08",
|
|
|
|
|
+ "type": "0",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Job loss",
|
|
|
|
|
+ "desc": "Job loss among the top earners 2007-08",
|
|
|
|
|
+ "type": "0",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Customers",
|
|
|
|
|
+ "desc": "Email Survey Opt-Ins, Customers for Shipping ZIP Code, Total Amount per Order",
|
|
|
|
|
+ "type": "0",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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;",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Top salary",
|
|
|
|
|
+ "desc": "Top salary 2007 above $100k",
|
|
|
|
|
+ "type": "1",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 1,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Salary growth",
|
|
|
|
|
+ "desc": "Salary growth (sorted) from 2007-08",
|
|
|
|
|
+ "type": "1",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 1,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Job loss",
|
|
|
|
|
+ "desc": "Job loss among the top earners 2007-08",
|
|
|
|
|
+ "type": "1",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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",
|
|
|
|
|
+ "type": 0,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "name": "Sample: Customers",
|
|
|
|
|
+ "desc": "Email Survey Opt-Ins, Customers for Shipping ZIP Code, Total Amount per Order",
|
|
|
|
|
+ "type": "1",
|
|
|
|
|
+ "data": {
|
|
|
|
|
+ "query": {
|
|
|
|
|
+ "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;",
|
|
|
|
|
+ "type": 1,
|
|
|
|
|
+ "email_notify": false,
|
|
|
|
|
+ "is_parameterized": false,
|
|
|
|
|
+ "database": "default"
|
|
|
|
|
+ },
|
|
|
|
|
+ "functions": [],
|
|
|
|
|
+ "VERSION": "0.4.1",
|
|
|
|
|
+ "file_resources": [],
|
|
|
|
|
+ "settings": []
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+]
|