dreamerdeo's picture
Upload folder using huggingface_hub
1faca1c
[
{
"db_id": "customer_complaints",
"query": "SELECT count(*) FROM customers",
"query_toks": [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"customers"
],
"query_toks_no_value": [
"select",
"count",
"(",
"*",
")",
"from",
"customers"
],
"question": "How many customers are there?",
"question_toks": [
"How",
"many",
"customers",
"are",
"there",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT count(*) FROM customers",
"query_toks": [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"customers"
],
"query_toks_no_value": [
"select",
"count",
"(",
"*",
")",
"from",
"customers"
],
"question": "Count the number of customers.",
"question_toks": [
"Count",
"the",
"number",
"of",
"customers",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT email_address , phone_number FROM customers ORDER BY email_address , phone_number",
"query_toks": [
"SELECT",
"email_address",
",",
"phone_number",
"FROM",
"customers",
"ORDER",
"BY",
"email_address",
",",
"phone_number"
],
"query_toks_no_value": [
"select",
"email_address",
",",
"phone_number",
"from",
"customers",
"order",
"by",
"email_address",
",",
"phone_number"
],
"question": "Find the emails and phone numbers of all the customers, ordered by email address and phone number.",
"question_toks": [
"Find",
"the",
"emails",
"and",
"phone",
"numbers",
"of",
"all",
"the",
"customers",
",",
"ordered",
"by",
"email",
"address",
"and",
"phone",
"number",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [
"asc",
[
[
0,
[
0,
13,
false
],
null
],
[
0,
[
0,
14,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
],
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT email_address , phone_number FROM customers ORDER BY email_address , phone_number",
"query_toks": [
"SELECT",
"email_address",
",",
"phone_number",
"FROM",
"customers",
"ORDER",
"BY",
"email_address",
",",
"phone_number"
],
"query_toks_no_value": [
"select",
"email_address",
",",
"phone_number",
"from",
"customers",
"order",
"by",
"email_address",
",",
"phone_number"
],
"question": "What are the emails and phone numbers of all customers, sorted by email address and phone number?",
"question_toks": [
"What",
"are",
"the",
"emails",
"and",
"phone",
"numbers",
"of",
"all",
"customers",
",",
"sorted",
"by",
"email",
"address",
"and",
"phone",
"number",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [
"asc",
[
[
0,
[
0,
13,
false
],
null
],
[
0,
[
0,
14,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
],
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT town_city FROM customers WHERE customer_type_code = \"Good Credit Rating\" GROUP BY town_city ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"town_city",
"FROM",
"customers",
"WHERE",
"customer_type_code",
"=",
"``",
"Good",
"Credit",
"Rating",
"''",
"GROUP",
"BY",
"town_city",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"town_city",
"from",
"customers",
"where",
"customer_type_code",
"=",
"value",
"group",
"by",
"town_city",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Which city has the least number of customers whose type code is \"Good Credit Rating\"?",
"question_toks": [
"Which",
"city",
"has",
"the",
"least",
"number",
"of",
"customers",
"whose",
"type",
"code",
"is",
"``",
"Good",
"Credit",
"Rating",
"''",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
11,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
11,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
8,
false
],
null
],
"\"Good Credit Rating\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT town_city FROM customers WHERE customer_type_code = \"Good Credit Rating\" GROUP BY town_city ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"town_city",
"FROM",
"customers",
"WHERE",
"customer_type_code",
"=",
"``",
"Good",
"Credit",
"Rating",
"''",
"GROUP",
"BY",
"town_city",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"town_city",
"from",
"customers",
"where",
"customer_type_code",
"=",
"value",
"group",
"by",
"town_city",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Return the city with the customer type code \"Good Credit Rating\" that had the fewest customers.",
"question_toks": [
"Return",
"the",
"city",
"with",
"the",
"customer",
"type",
"code",
"``",
"Good",
"Credit",
"Rating",
"''",
"that",
"had",
"the",
"fewest",
"customers",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
11,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
11,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
8,
false
],
null
],
"\"Good Credit Rating\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name",
"query_toks": [
"SELECT",
"t1.product_name",
",",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"GROUP",
"BY",
"t1.product_name"
],
"query_toks_no_value": [
"select",
"t1",
".",
"product_name",
",",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"group",
"by",
"t1",
".",
"product_name"
],
"question": "List the name of all products along with the number of complaints that they have received.",
"question_toks": [
"List",
"the",
"name",
"of",
"all",
"products",
"along",
"with",
"the",
"number",
"of",
"complaints",
"that",
"they",
"have",
"received",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
15,
false
],
null
],
[
0,
24,
false
],
null
]
],
"table_units": [
[
"table_unit",
2
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
20,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
],
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name",
"query_toks": [
"SELECT",
"t1.product_name",
",",
"count",
"(",
"*",
")",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"GROUP",
"BY",
"t1.product_name"
],
"query_toks_no_value": [
"select",
"t1",
".",
"product_name",
",",
"count",
"(",
"*",
")",
"from",
"products",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"group",
"by",
"t1",
".",
"product_name"
],
"question": "What are all the different product names, and how many complains has each received?",
"question_toks": [
"What",
"are",
"all",
"the",
"different",
"product",
"names",
",",
"and",
"how",
"many",
"complains",
"has",
"each",
"received",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
15,
false
],
null
],
[
0,
24,
false
],
null
]
],
"table_units": [
[
"table_unit",
2
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
20,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
],
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"t1.email_address",
"FROM",
"customers",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.customer_id",
"=",
"t2.customer_id",
"GROUP",
"BY",
"t1.customer_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"email_address",
"from",
"customers",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"group",
"by",
"t1",
".",
"customer_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Find the emails of customers who has filed a complaints of the product with the most complaints.",
"question_toks": [
"Find",
"the",
"emails",
"of",
"customers",
"who",
"has",
"filed",
"a",
"complaints",
"of",
"the",
"product",
"with",
"the",
"most",
"complaints",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
7,
false
],
null
],
[
0,
25,
false
],
null
]
],
"table_units": [
[
"table_unit",
1
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
7,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"t1.email_address",
"FROM",
"customers",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.customer_id",
"=",
"t2.customer_id",
"GROUP",
"BY",
"t1.customer_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"email_address",
"from",
"customers",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"group",
"by",
"t1",
".",
"customer_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?",
"question_toks": [
"What",
"are",
"the",
"emails",
"of",
"customers",
"who",
"have",
"filed",
"complaints",
"on",
"the",
"product",
"which",
"has",
"had",
"the",
"greatest",
"number",
"of",
"complaints",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
7,
false
],
null
],
[
0,
25,
false
],
null
]
],
"table_units": [
[
"table_unit",
1
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
7,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"DISTINCT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"customers",
"AS",
"t3",
"GROUP",
"BY",
"t3.customer_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"distinct",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"customers",
"as",
"t3",
"group",
"by",
"t3",
".",
"customer_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Which products has been complained by the customer who has filed least amount of complaints?",
"question_toks": [
"Which",
"products",
"has",
"been",
"complained",
"by",
"the",
"customer",
"who",
"has",
"filed",
"least",
"amount",
"of",
"complaints",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
15,
false
],
null
],
[
0,
24,
false
],
null
]
],
"table_units": [
[
"table_unit",
2
],
[
"table_unit",
3
],
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
7,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
true,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"DISTINCT",
"t1.product_name",
"FROM",
"products",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.product_id",
"=",
"t2.product_id",
"JOIN",
"customers",
"AS",
"t3",
"GROUP",
"BY",
"t3.customer_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"distinct",
"t1",
".",
"product_name",
"from",
"products",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"product_id",
"=",
"t2",
".",
"product_id",
"join",
"customers",
"as",
"t3",
"group",
"by",
"t3",
".",
"customer_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.",
"question_toks": [
"Return",
"the",
"names",
"of",
"products",
"that",
"have",
"had",
"complaints",
"filed",
"by",
"the",
"customer",
"who",
"has",
"filed",
"the",
"fewest",
"complaints",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
15,
false
],
null
],
[
0,
24,
false
],
null
]
],
"table_units": [
[
"table_unit",
2
],
[
"table_unit",
3
],
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
7,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
true,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1",
"query_toks": [
"SELECT",
"t1.phone_number",
"FROM",
"customers",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.customer_id",
"=",
"t2.customer_id",
"ORDER",
"BY",
"t2.date_complaint_raised",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"phone_number",
"from",
"customers",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"order",
"by",
"t2",
".",
"date_complaint_raised",
"desc",
"limit",
"value"
],
"question": "What is the phone number of the customer who has filed the most recent complaint?",
"question_toks": [
"What",
"is",
"the",
"phone",
"number",
"of",
"the",
"customer",
"who",
"has",
"filed",
"the",
"most",
"recent",
"complaint",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
7,
false
],
null
],
[
0,
25,
false
],
null
]
],
"table_units": [
[
"table_unit",
1
],
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
0,
29,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1",
"query_toks": [
"SELECT",
"t1.phone_number",
"FROM",
"customers",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.customer_id",
"=",
"t2.customer_id",
"ORDER",
"BY",
"t2.date_complaint_raised",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"phone_number",
"from",
"customers",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"order",
"by",
"t2",
".",
"date_complaint_raised",
"desc",
"limit",
"value"
],
"question": "Return the phone number of the customer who filed the complaint that was raised most recently.",
"question_toks": [
"Return",
"the",
"phone",
"number",
"of",
"the",
"customer",
"who",
"filed",
"the",
"complaint",
"that",
"was",
"raised",
"most",
"recently",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
7,
false
],
null
],
[
0,
25,
false
],
null
]
],
"table_units": [
[
"table_unit",
1
],
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
0,
29,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)",
"query_toks": [
"SELECT",
"email_address",
",",
"phone_number",
"FROM",
"customers",
"WHERE",
"customer_id",
"NOT",
"IN",
"(",
"SELECT",
"customer_id",
"FROM",
"complaints",
")"
],
"query_toks_no_value": [
"select",
"email_address",
",",
"phone_number",
"from",
"customers",
"where",
"customer_id",
"not",
"in",
"(",
"select",
"customer_id",
"from",
"complaints",
")"
],
"question": "Find the email and phone number of the customers who have never filed a complaint before.",
"question_toks": [
"Find",
"the",
"email",
"and",
"phone",
"number",
"of",
"the",
"customers",
"who",
"have",
"never",
"filed",
"a",
"complaint",
"before",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
],
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": [
[
true,
8,
[
0,
[
0,
7,
false
],
null
],
{
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
25,
false
],
null
]
]
]
],
"union": null,
"where": []
},
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT email_address , phone_number FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM complaints)",
"query_toks": [
"SELECT",
"email_address",
",",
"phone_number",
"FROM",
"customers",
"WHERE",
"customer_id",
"NOT",
"IN",
"(",
"SELECT",
"customer_id",
"FROM",
"complaints",
")"
],
"query_toks_no_value": [
"select",
"email_address",
",",
"phone_number",
"from",
"customers",
"where",
"customer_id",
"not",
"in",
"(",
"select",
"customer_id",
"from",
"complaints",
")"
],
"question": "What are the emails and phone numbers of custoemrs who have never filed a complaint?",
"question_toks": [
"What",
"are",
"the",
"emails",
"and",
"phone",
"numbers",
"of",
"custoemrs",
"who",
"have",
"never",
"filed",
"a",
"complaint",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
13,
false
],
null
]
],
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": null,
"where": [
[
true,
8,
[
0,
[
0,
7,
false
],
null
],
{
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
25,
false
],
null
]
]
]
],
"union": null,
"where": []
},
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff",
"query_toks": [
"SELECT",
"phone_number",
"FROM",
"customers",
"UNION",
"SELECT",
"phone_number",
"FROM",
"staff"
],
"query_toks_no_value": [
"select",
"phone_number",
"from",
"customers",
"union",
"select",
"phone_number",
"from",
"staff"
],
"question": "Find the phone number of all the customers and staff.",
"question_toks": [
"Find",
"the",
"phone",
"number",
"of",
"all",
"the",
"customers",
"and",
"staff",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
0
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
6,
false
],
null
]
]
]
],
"union": null,
"where": []
},
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT phone_number FROM customers UNION SELECT phone_number FROM staff",
"query_toks": [
"SELECT",
"phone_number",
"FROM",
"customers",
"UNION",
"SELECT",
"phone_number",
"FROM",
"staff"
],
"query_toks_no_value": [
"select",
"phone_number",
"from",
"customers",
"union",
"select",
"phone_number",
"from",
"staff"
],
"question": "What are the phone numbers of all customers and all staff members?",
"question_toks": [
"What",
"are",
"the",
"phone",
"numbers",
"of",
"all",
"customers",
"and",
"all",
"staff",
"members",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
14,
false
],
null
]
]
]
],
"union": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
0
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
6,
false
],
null
]
]
]
],
"union": null,
"where": []
},
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_description FROM products WHERE product_name = \"Chocolate\"",
"query_toks": [
"SELECT",
"product_description",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"Chocolate",
"''"
],
"query_toks_no_value": [
"select",
"product_description",
"from",
"products",
"where",
"product_name",
"=",
"value"
],
"question": "What is the description of the product named \"Chocolate\"?",
"question_toks": [
"What",
"is",
"the",
"description",
"of",
"the",
"product",
"named",
"``",
"Chocolate",
"''",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
21,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
20,
false
],
null
],
"\"Chocolate\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_description FROM products WHERE product_name = \"Chocolate\"",
"query_toks": [
"SELECT",
"product_description",
"FROM",
"products",
"WHERE",
"product_name",
"=",
"``",
"Chocolate",
"''"
],
"query_toks_no_value": [
"select",
"product_description",
"from",
"products",
"where",
"product_name",
"=",
"value"
],
"question": "Return the description of the product called \"Chocolate\".",
"question_toks": [
"Return",
"the",
"description",
"of",
"the",
"product",
"called",
"``",
"Chocolate",
"''",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
21,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
20,
false
],
null
],
"\"Chocolate\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1",
"query_toks": [
"SELECT",
"product_name",
",",
"product_category_code",
"FROM",
"products",
"ORDER",
"BY",
"product_price",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"product_name",
",",
"product_category_code",
"from",
"products",
"order",
"by",
"product_price",
"desc",
"limit",
"value"
],
"question": "Find the name and category of the most expensive product.",
"question_toks": [
"Find",
"the",
"name",
"and",
"category",
"of",
"the",
"most",
"expensive",
"product",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
0,
22,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
],
[
0,
[
0,
[
0,
17,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1",
"query_toks": [
"SELECT",
"product_name",
",",
"product_category_code",
"FROM",
"products",
"ORDER",
"BY",
"product_price",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"product_name",
",",
"product_category_code",
"from",
"products",
"order",
"by",
"product_price",
"desc",
"limit",
"value"
],
"question": "What is the name and category code of the product with the highest price?",
"question_toks": [
"What",
"is",
"the",
"name",
"and",
"category",
"code",
"of",
"the",
"product",
"with",
"the",
"highest",
"price",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
0,
22,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
20,
false
],
null
]
],
[
0,
[
0,
[
0,
17,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)",
"query_toks": [
"SELECT",
"product_price",
"FROM",
"products",
"WHERE",
"product_id",
"NOT",
"IN",
"(",
"SELECT",
"product_id",
"FROM",
"complaints",
")"
],
"query_toks_no_value": [
"select",
"product_price",
"from",
"products",
"where",
"product_id",
"not",
"in",
"(",
"select",
"product_id",
"from",
"complaints",
")"
],
"question": "Find the prices of products which has never received a single complaint.",
"question_toks": [
"Find",
"the",
"prices",
"of",
"products",
"which",
"has",
"never",
"received",
"a",
"single",
"complaint",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
22,
false
],
null
]
]
]
],
"union": null,
"where": [
[
true,
8,
[
0,
[
0,
15,
false
],
null
],
{
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
24,
false
],
null
]
]
]
],
"union": null,
"where": []
},
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)",
"query_toks": [
"SELECT",
"product_price",
"FROM",
"products",
"WHERE",
"product_id",
"NOT",
"IN",
"(",
"SELECT",
"product_id",
"FROM",
"complaints",
")"
],
"query_toks_no_value": [
"select",
"product_price",
"from",
"products",
"where",
"product_id",
"not",
"in",
"(",
"select",
"product_id",
"from",
"complaints",
")"
],
"question": "What are the prices of products that have never gotten a complaint?",
"question_toks": [
"What",
"are",
"the",
"prices",
"of",
"products",
"that",
"have",
"never",
"gotten",
"a",
"complaint",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
22,
false
],
null
]
]
]
],
"union": null,
"where": [
[
true,
8,
[
0,
[
0,
15,
false
],
null
],
{
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
24,
false
],
null
]
]
]
],
"union": null,
"where": []
},
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT avg(product_price) , product_category_code FROM products GROUP BY product_category_code",
"query_toks": [
"SELECT",
"avg",
"(",
"product_price",
")",
",",
"product_category_code",
"FROM",
"products",
"GROUP",
"BY",
"product_category_code"
],
"query_toks_no_value": [
"select",
"avg",
"(",
"product_price",
")",
",",
"product_category_code",
"from",
"products",
"group",
"by",
"product_category_code"
],
"question": "What is the average price of the products for each category?",
"question_toks": [
"What",
"is",
"the",
"average",
"price",
"of",
"the",
"products",
"for",
"each",
"category",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [
[
0,
17,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
5,
[
0,
[
0,
22,
false
],
null
]
],
[
0,
[
0,
[
0,
17,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT avg(product_price) , product_category_code FROM products GROUP BY product_category_code",
"query_toks": [
"SELECT",
"avg",
"(",
"product_price",
")",
",",
"product_category_code",
"FROM",
"products",
"GROUP",
"BY",
"product_category_code"
],
"query_toks_no_value": [
"select",
"avg",
"(",
"product_price",
")",
",",
"product_category_code",
"from",
"products",
"group",
"by",
"product_category_code"
],
"question": "Return the average price of products that have each category code.",
"question_toks": [
"Return",
"the",
"average",
"price",
"of",
"products",
"that",
"have",
"each",
"category",
"code",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
2
]
]
},
"groupBy": [
[
0,
17,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
5,
[
0,
[
0,
22,
false
],
null
]
],
[
0,
[
0,
[
0,
17,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1",
"query_toks": [
"SELECT",
"t1.last_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"JOIN",
"products",
"AS",
"t3",
"ON",
"t2.product_id",
"=",
"t3.product_id",
"ORDER",
"BY",
"t3.product_price",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"last_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"join",
"products",
"as",
"t3",
"on",
"t2",
".",
"product_id",
"=",
"t3",
".",
"product_id",
"order",
"by",
"t3",
".",
"product_price",
"limit",
"value"
],
"question": "Find the last name of the staff member who processed the complaint of the cheapest product.",
"question_toks": [
"Find",
"the",
"last",
"name",
"of",
"the",
"staff",
"member",
"who",
"processed",
"the",
"complaint",
"of",
"the",
"cheapest",
"product",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
],
"and",
[
false,
2,
[
0,
[
0,
24,
false
],
null
],
[
0,
15,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
],
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
0,
22,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price LIMIT 1",
"query_toks": [
"SELECT",
"t1.last_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"JOIN",
"products",
"AS",
"t3",
"ON",
"t2.product_id",
"=",
"t3.product_id",
"ORDER",
"BY",
"t3.product_price",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"last_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"join",
"products",
"as",
"t3",
"on",
"t2",
".",
"product_id",
"=",
"t3",
".",
"product_id",
"order",
"by",
"t3",
".",
"product_price",
"limit",
"value"
],
"question": "What is the last name of the staff member in charge of the complaint on the product with the lowest price?",
"question_toks": [
"What",
"is",
"the",
"last",
"name",
"of",
"the",
"staff",
"member",
"in",
"charge",
"of",
"the",
"complaint",
"on",
"the",
"product",
"with",
"the",
"lowest",
"price",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
],
"and",
[
false,
2,
[
0,
[
0,
24,
false
],
null
],
[
0,
15,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
],
[
"table_unit",
2
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
0,
22,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*) > 3",
"query_toks": [
"SELECT",
"complaint_status_code",
"FROM",
"complaints",
"GROUP",
"BY",
"complaint_status_code",
"HAVING",
"count",
"(",
"*",
")",
">",
"3"
],
"query_toks_no_value": [
"select",
"complaint_status_code",
"from",
"complaints",
"group",
"by",
"complaint_status_code",
"having",
"count",
"(",
"*",
")",
">",
"value"
],
"question": "Which complaint status has more than 3 records on file?",
"question_toks": [
"Which",
"complaint",
"status",
"has",
"more",
"than",
"3",
"records",
"on",
"file",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
27,
false
]
],
"having": [
[
false,
3,
[
0,
[
3,
0,
false
],
null
],
3.0,
null
]
],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
27,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING count(*) > 3",
"query_toks": [
"SELECT",
"complaint_status_code",
"FROM",
"complaints",
"GROUP",
"BY",
"complaint_status_code",
"HAVING",
"count",
"(",
"*",
")",
">",
"3"
],
"query_toks_no_value": [
"select",
"complaint_status_code",
"from",
"complaints",
"group",
"by",
"complaint_status_code",
"having",
"count",
"(",
"*",
")",
">",
"value"
],
"question": "Return complaint status codes have more than 3 corresponding complaints?",
"question_toks": [
"Return",
"complaint",
"status",
"codes",
"have",
"more",
"than",
"3",
"corresponding",
"complaints",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
27,
false
]
],
"having": [
[
false,
3,
[
0,
[
3,
0,
false
],
null
],
3.0,
null
]
],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
27,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT last_name FROM staff WHERE email_address LIKE \"%wrau%\"",
"query_toks": [
"SELECT",
"last_name",
"FROM",
"staff",
"WHERE",
"email_address",
"LIKE",
"``",
"%",
"wrau",
"%",
"''"
],
"query_toks_no_value": [
"select",
"last_name",
"from",
"staff",
"where",
"email_address",
"like",
"value"
],
"question": "Find the last name of the staff whose email address contains \"wrau\".",
"question_toks": [
"Find",
"the",
"last",
"name",
"of",
"the",
"staff",
"whose",
"email",
"address",
"contains",
"``",
"wrau",
"''",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
0
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
9,
[
0,
[
0,
5,
false
],
null
],
"\"%wrau%\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT last_name FROM staff WHERE email_address LIKE \"%wrau%\"",
"query_toks": [
"SELECT",
"last_name",
"FROM",
"staff",
"WHERE",
"email_address",
"LIKE",
"``",
"%",
"wrau",
"%",
"''"
],
"query_toks_no_value": [
"select",
"last_name",
"from",
"staff",
"where",
"email_address",
"like",
"value"
],
"question": "What are the last names of staff with email addressed containing the substring \"wrau\"?",
"question_toks": [
"What",
"are",
"the",
"last",
"names",
"of",
"staff",
"with",
"email",
"addressed",
"containing",
"the",
"substring",
"``",
"wrau",
"''",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
0
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
9,
[
0,
[
0,
5,
false
],
null
],
"\"%wrau%\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1",
"query_toks": [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"customers",
"GROUP",
"BY",
"customer_type_code",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"count",
"(",
"*",
")",
"from",
"customers",
"group",
"by",
"customer_type_code",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
],
"question": "How many customers are there in the customer type with the most customers?",
"question_toks": [
"How",
"many",
"customers",
"are",
"there",
"in",
"the",
"customer",
"type",
"with",
"the",
"most",
"customers",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
8,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1",
"query_toks": [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"customers",
"GROUP",
"BY",
"customer_type_code",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"count",
"(",
"*",
")",
"from",
"customers",
"group",
"by",
"customer_type_code",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
],
"question": "Count the number of customers that have the customer type that is most common.",
"question_toks": [
"Count",
"the",
"number",
"of",
"customers",
"that",
"have",
"the",
"customer",
"type",
"that",
"is",
"most",
"common",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
8,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"desc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1",
"query_toks": [
"SELECT",
"t1.last_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"ORDER",
"BY",
"t2.date_complaint_raised",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"last_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"order",
"by",
"t2",
".",
"date_complaint_raised",
"limit",
"value"
],
"question": "What is the last name of the staff who has handled the first ever complaint?",
"question_toks": [
"What",
"is",
"the",
"last",
"name",
"of",
"the",
"staff",
"who",
"has",
"handled",
"the",
"first",
"ever",
"complaint",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
0,
29,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1",
"query_toks": [
"SELECT",
"t1.last_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"ORDER",
"BY",
"t2.date_complaint_raised",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"t1",
".",
"last_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"order",
"by",
"t2",
".",
"date_complaint_raised",
"limit",
"value"
],
"question": "Return the last name of the staff member who handled the complaint with the earliest date raised.",
"question_toks": [
"Return",
"the",
"last",
"name",
"of",
"the",
"staff",
"member",
"who",
"handled",
"the",
"complaint",
"with",
"the",
"earliest",
"date",
"raised",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
0,
29,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
4,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT count(DISTINCT complaint_type_code) FROM complaints",
"query_toks": [
"SELECT",
"count",
"(",
"DISTINCT",
"complaint_type_code",
")",
"FROM",
"complaints"
],
"query_toks_no_value": [
"select",
"count",
"(",
"distinct",
"complaint_type_code",
")",
"from",
"complaints"
],
"question": "How many distinct complaint type codes are there in the database?",
"question_toks": [
"How",
"many",
"distinct",
"complaint",
"type",
"codes",
"are",
"there",
"in",
"the",
"database",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
3,
[
0,
[
0,
28,
true
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT count(DISTINCT complaint_type_code) FROM complaints",
"query_toks": [
"SELECT",
"count",
"(",
"DISTINCT",
"complaint_type_code",
")",
"FROM",
"complaints"
],
"query_toks_no_value": [
"select",
"count",
"(",
"distinct",
"complaint_type_code",
")",
"from",
"complaints"
],
"question": "Count the number of different complaint type codes.",
"question_toks": [
"Count",
"the",
"number",
"of",
"different",
"complaint",
"type",
"codes",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
3,
[
0,
[
0,
28,
true
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = \"vbogisich@example.org\"",
"query_toks": [
"SELECT",
"address_line_1",
",",
"address_line_2",
"FROM",
"customers",
"WHERE",
"email_address",
"=",
"``",
"vbogisich",
"@",
"example.org",
"''"
],
"query_toks_no_value": [
"select",
"address_line_1",
",",
"address_line_2",
"from",
"customers",
"where",
"email_address",
"=",
"value"
],
"question": "Find the address line 1 and 2 of the customer with email \"vbogisich@example.org\".",
"question_toks": [
"Find",
"the",
"address",
"line",
"1",
"and",
"2",
"of",
"the",
"customer",
"with",
"email",
"``",
"vbogisich",
"@",
"example.org",
"''",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
9,
false
],
null
]
],
[
0,
[
0,
[
0,
10,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
13,
false
],
null
],
"\"vbogisich@example.org\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = \"vbogisich@example.org\"",
"query_toks": [
"SELECT",
"address_line_1",
",",
"address_line_2",
"FROM",
"customers",
"WHERE",
"email_address",
"=",
"``",
"vbogisich",
"@",
"example.org",
"''"
],
"query_toks_no_value": [
"select",
"address_line_1",
",",
"address_line_2",
"from",
"customers",
"where",
"email_address",
"=",
"value"
],
"question": "What are lines 1 and 2 of the addressed of the customer with the email \"vbogisich@example.org\"?",
"question_toks": [
"What",
"are",
"lines",
"1",
"and",
"2",
"of",
"the",
"addressed",
"of",
"the",
"customer",
"with",
"the",
"email",
"``",
"vbogisich",
"@",
"example.org",
"''",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
9,
false
],
null
]
],
[
0,
[
0,
[
0,
10,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
13,
false
],
null
],
"\"vbogisich@example.org\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = \"Product Failure\" GROUP BY complaint_status_code",
"query_toks": [
"SELECT",
"complaint_status_code",
",",
"count",
"(",
"*",
")",
"FROM",
"complaints",
"WHERE",
"complaint_type_code",
"=",
"``",
"Product",
"Failure",
"''",
"GROUP",
"BY",
"complaint_status_code"
],
"query_toks_no_value": [
"select",
"complaint_status_code",
",",
"count",
"(",
"*",
")",
"from",
"complaints",
"where",
"complaint_type_code",
"=",
"value",
"group",
"by",
"complaint_status_code"
],
"question": "Find the number of complaints with Product Failure type for each complaint status.",
"question_toks": [
"Find",
"the",
"number",
"of",
"complaints",
"with",
"Product",
"Failure",
"type",
"for",
"each",
"complaint",
"status",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
27,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
27,
false
],
null
]
],
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
28,
false
],
null
],
"\"Product Failure\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = \"Product Failure\" GROUP BY complaint_status_code",
"query_toks": [
"SELECT",
"complaint_status_code",
",",
"count",
"(",
"*",
")",
"FROM",
"complaints",
"WHERE",
"complaint_type_code",
"=",
"``",
"Product",
"Failure",
"''",
"GROUP",
"BY",
"complaint_status_code"
],
"query_toks_no_value": [
"select",
"complaint_status_code",
",",
"count",
"(",
"*",
")",
"from",
"complaints",
"where",
"complaint_type_code",
"=",
"value",
"group",
"by",
"complaint_status_code"
],
"question": "Of complaints with the type code \"Product Failure\", how many had each different status code?",
"question_toks": [
"Of",
"complaints",
"with",
"the",
"type",
"code",
"``",
"Product",
"Failure",
"''",
",",
"how",
"many",
"had",
"each",
"different",
"status",
"code",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
27,
false
]
],
"having": [],
"intersect": null,
"limit": null,
"orderBy": [],
"select": [
false,
[
[
0,
[
0,
[
0,
27,
false
],
null
]
],
[
3,
[
0,
[
0,
0,
false
],
null
]
]
]
],
"union": null,
"where": [
[
false,
2,
[
0,
[
0,
28,
false
],
null
],
"\"Product Failure\"",
null
]
]
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5",
"query_toks": [
"SELECT",
"t1.first_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"GROUP",
"BY",
"t2.staff_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"5"
],
"query_toks_no_value": [
"select",
"t1",
".",
"first_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"group",
"by",
"t2",
".",
"staff_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "What is first names of the top 5 staff who have handled the greatest number of complaints?",
"question_toks": [
"What",
"is",
"first",
"names",
"of",
"the",
"top",
"5",
"staff",
"who",
"have",
"handled",
"the",
"greatest",
"number",
"of",
"complaints",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
31,
false
]
],
"having": [],
"intersect": null,
"limit": 5,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
3,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5",
"query_toks": [
"SELECT",
"t1.first_name",
"FROM",
"staff",
"AS",
"t1",
"JOIN",
"complaints",
"AS",
"t2",
"ON",
"t1.staff_id",
"=",
"t2.staff_id",
"GROUP",
"BY",
"t2.staff_id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"5"
],
"query_toks_no_value": [
"select",
"t1",
".",
"first_name",
"from",
"staff",
"as",
"t1",
"join",
"complaints",
"as",
"t2",
"on",
"t1",
".",
"staff_id",
"=",
"t2",
".",
"staff_id",
"group",
"by",
"t2",
".",
"staff_id",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Return the first names of the 5 staff members who have handled the most complaints.",
"question_toks": [
"Return",
"the",
"first",
"names",
"of",
"the",
"5",
"staff",
"members",
"who",
"have",
"handled",
"the",
"most",
"complaints",
"."
],
"sql": {
"except": null,
"from": {
"conds": [
[
false,
2,
[
0,
[
0,
1,
false
],
null
],
[
0,
31,
false
],
null
]
],
"table_units": [
[
"table_unit",
0
],
[
"table_unit",
3
]
]
},
"groupBy": [
[
0,
31,
false
]
],
"having": [],
"intersect": null,
"limit": 5,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
3,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"state",
"FROM",
"customers",
"GROUP",
"BY",
"state",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"state",
"from",
"customers",
"group",
"by",
"state",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Which state has the most customers?",
"question_toks": [
"Which",
"state",
"has",
"the",
"most",
"customers",
"?"
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
12,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
12,
false
],
null
]
]
]
],
"union": null,
"where": []
}
},
{
"db_id": "customer_complaints",
"query": "SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1",
"query_toks": [
"SELECT",
"state",
"FROM",
"customers",
"GROUP",
"BY",
"state",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
],
"query_toks_no_value": [
"select",
"state",
"from",
"customers",
"group",
"by",
"state",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
],
"question": "Give the state that has the most customers.",
"question_toks": [
"Give",
"the",
"state",
"that",
"has",
"the",
"most",
"customers",
"."
],
"sql": {
"except": null,
"from": {
"conds": [],
"table_units": [
[
"table_unit",
1
]
]
},
"groupBy": [
[
0,
12,
false
]
],
"having": [],
"intersect": null,
"limit": 1,
"orderBy": [
"asc",
[
[
0,
[
3,
0,
false
],
null
]
]
],
"select": [
false,
[
[
0,
[
0,
[
0,
12,
false
],
null
]
]
]
],
"union": null,
"where": []
}
}
]