[ { "db_id": "allergy_1", "query": "SELECT count(DISTINCT allergy) FROM Allergy_type", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "allergy", ")", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "allergy", ")", "from", "allergy_type" ], "question": "How many allergies are there?", "question_toks": [ "How", "many", "allergies", "are", "there", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 1, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(DISTINCT allergy) FROM Allergy_type", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "allergy", ")", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "allergy", ")", "from", "allergy_type" ], "question": "How many allergy entries are there?", "question_toks": [ "How", "many", "allergy", "entries", "are", "there", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 1, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(DISTINCT allergytype) FROM Allergy_type", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "allergytype", ")", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "allergytype", ")", "from", "allergy_type" ], "question": "How many different allergy types exist?", "question_toks": [ "How", "many", "different", "allergy", "types", "exist", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 2, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(DISTINCT allergytype) FROM Allergy_type", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "allergytype", ")", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "allergytype", ")", "from", "allergy_type" ], "question": "How many distinct allergies are there?", "question_toks": [ "How", "many", "distinct", "allergies", "are", "there", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 2, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT allergytype FROM Allergy_type", "query_toks": [ "SELECT", "DISTINCT", "allergytype", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "distinct", "allergytype", "from", "allergy_type" ], "question": "Show all allergy types.", "question_toks": [ "Show", "all", "allergy", "types", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT allergytype FROM Allergy_type", "query_toks": [ "SELECT", "DISTINCT", "allergytype", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "distinct", "allergytype", "from", "allergy_type" ], "question": "What are the different allergy types?", "question_toks": [ "What", "are", "the", "different", "allergy", "types", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergy , allergytype FROM Allergy_type", "query_toks": [ "SELECT", "allergy", ",", "allergytype", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "allergy", ",", "allergytype", "from", "allergy_type" ], "question": "Show all allergies and their types.", "question_toks": [ "Show", "all", "allergies", "and", "their", "types", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 1, false ], null ] ], [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergy , allergytype FROM Allergy_type", "query_toks": [ "SELECT", "allergy", ",", "allergytype", "FROM", "Allergy_type" ], "query_toks_no_value": [ "select", "allergy", ",", "allergytype", "from", "allergy_type" ], "question": "What are the allergies and their types?", "question_toks": [ "What", "are", "the", "allergies", "and", "their", "types", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 1, false ], null ] ], [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = \"food\"", "query_toks": [ "SELECT", "DISTINCT", "allergy", "FROM", "Allergy_type", "WHERE", "allergytype", "=", "``", "food", "''" ], "query_toks_no_value": [ "select", "distinct", "allergy", "from", "allergy_type", "where", "allergytype", "=", "value" ], "question": "Show all allergies with type food.", "question_toks": [ "Show", "all", "allergies", "with", "type", "food", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 1, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = \"food\"", "query_toks": [ "SELECT", "DISTINCT", "allergy", "FROM", "Allergy_type", "WHERE", "allergytype", "=", "``", "food", "''" ], "query_toks_no_value": [ "select", "distinct", "allergy", "from", "allergy_type", "where", "allergytype", "=", "value" ], "question": "What are all the different food allergies?", "question_toks": [ "What", "are", "all", "the", "different", "food", "allergies", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 1, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type WHERE allergy = \"Cat\"", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "WHERE", "allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "where", "allergy", "=", "value" ], "question": "What is the type of allergy Cat?", "question_toks": [ "What", "is", "the", "type", "of", "allergy", "Cat", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 1, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type WHERE allergy = \"Cat\"", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "WHERE", "allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "where", "allergy", "=", "value" ], "question": "What is allergy type of a cat allergy?", "question_toks": [ "What", "is", "allergy", "type", "of", "a", "cat", "allergy", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 1, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Allergy_type WHERE allergytype = \"animal\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Allergy_type", "WHERE", "allergytype", "=", "``", "animal", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "allergy_type", "where", "allergytype", "=", "value" ], "question": "How many allergies have type animal?", "question_toks": [ "How", "many", "allergies", "have", "type", "animal", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Allergy_type WHERE allergytype = \"animal\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Allergy_type", "WHERE", "allergytype", "=", "``", "animal", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "allergy_type", "where", "allergytype", "=", "value" ], "question": "How many animal type allergies exist?", "question_toks": [ "How", "many", "animal", "type", "allergies", "exist", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype", "query_toks": [ "SELECT", "allergytype", ",", "count", "(", "*", ")", "FROM", "Allergy_type", "GROUP", "BY", "allergytype" ], "query_toks_no_value": [ "select", "allergytype", ",", "count", "(", "*", ")", "from", "allergy_type", "group", "by", "allergytype" ], "question": "Show all allergy types and the number of allergies in each type.", "question_toks": [ "Show", "all", "allergy", "types", "and", "the", "number", "of", "allergies", "in", "each", "type", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype", "query_toks": [ "SELECT", "allergytype", ",", "count", "(", "*", ")", "FROM", "Allergy_type", "GROUP", "BY", "allergytype" ], "query_toks_no_value": [ "select", "allergytype", ",", "count", "(", "*", ")", "from", "allergy_type", "group", "by", "allergytype" ], "question": "What are the allergy types and how many allergies correspond to each one?", "question_toks": [ "What", "are", "the", "allergy", "types", "and", "how", "many", "allergies", "correspond", "to", "each", "one", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "GROUP", "BY", "allergytype", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "group", "by", "allergytype", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which allergy type has most number of allergies?", "question_toks": [ "Which", "allergy", "type", "has", "most", "number", "of", "allergies", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "GROUP", "BY", "allergytype", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "group", "by", "allergytype", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which allergy type is most common?", "question_toks": [ "Which", "allergy", "type", "is", "most", "common", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "GROUP", "BY", "allergytype", "ORDER", "BY", "count", "(", "*", ")", "ASC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "group", "by", "allergytype", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ], "question": "Which allergy type has least number of allergies?", "question_toks": [ "Which", "allergy", "type", "has", "least", "number", "of", "allergies", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "asc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1", "query_toks": [ "SELECT", "allergytype", "FROM", "Allergy_type", "GROUP", "BY", "allergytype", "ORDER", "BY", "count", "(", "*", ")", "ASC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergytype", "from", "allergy_type", "group", "by", "allergytype", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ], "question": "Which allergy type is the least common?", "question_toks": [ "Which", "allergy", "type", "is", "the", "least", "common", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "asc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student" ], "question": "How many students are there?", "question_toks": [ "How", "many", "students", "are", "there", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student" ], "question": "What is the total number of students?", "question_toks": [ "What", "is", "the", "total", "number", "of", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Fname , Lname FROM Student", "query_toks": [ "SELECT", "Fname", ",", "Lname", "FROM", "Student" ], "query_toks_no_value": [ "select", "fname", ",", "lname", "from", "student" ], "question": "Show first name and last name for all students.", "question_toks": [ "Show", "first", "name", "and", "last", "name", "for", "all", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Fname , Lname FROM Student", "query_toks": [ "SELECT", "Fname", ",", "Lname", "FROM", "Student" ], "query_toks_no_value": [ "select", "fname", ",", "lname", "from", "student" ], "question": "What are the full names of all students", "question_toks": [ "What", "are", "the", "full", "names", "of", "all", "students" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(DISTINCT advisor) FROM Student", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "advisor", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "advisor", ")", "from", "student" ], "question": "How many different advisors are listed?", "question_toks": [ "How", "many", "different", "advisors", "are", "listed", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 11, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(DISTINCT advisor) FROM Student", "query_toks": [ "SELECT", "count", "(", "DISTINCT", "advisor", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "count", "(", "distinct", "advisor", ")", "from", "student" ], "question": "How many advisors are there?", "question_toks": [ "How", "many", "advisors", "are", "there", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 11, true ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT Major FROM Student", "query_toks": [ "SELECT", "DISTINCT", "Major", "FROM", "Student" ], "query_toks_no_value": [ "select", "distinct", "major", "from", "student" ], "question": "Show all majors.", "question_toks": [ "Show", "all", "majors", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT Major FROM Student", "query_toks": [ "SELECT", "DISTINCT", "Major", "FROM", "Student" ], "query_toks_no_value": [ "select", "distinct", "major", "from", "student" ], "question": "What are the different majors?", "question_toks": [ "What", "are", "the", "different", "majors", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT city_code FROM Student", "query_toks": [ "SELECT", "DISTINCT", "city_code", "FROM", "Student" ], "query_toks_no_value": [ "select", "distinct", "city_code", "from", "student" ], "question": "Show all cities where students live.", "question_toks": [ "Show", "all", "cities", "where", "students", "live", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT city_code FROM Student", "query_toks": [ "SELECT", "DISTINCT", "city_code", "FROM", "Student" ], "query_toks_no_value": [ "select", "distinct", "city_code", "from", "student" ], "question": "What cities do students live in?", "question_toks": [ "What", "cities", "do", "students", "live", "in", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'", "query_toks": [ "SELECT", "Fname", ",", "Lname", ",", "Age", "FROM", "Student", "WHERE", "Sex", "=", "'F", "'" ], "query_toks_no_value": [ "select", "fname", ",", "lname", ",", "age", "from", "student", "where", "sex", "=", "value" ], "question": "Show first name, last name, age for all female students. Their sex is F.", "question_toks": [ "Show", "first", "name", ",", "last", "name", ",", "age", "for", "all", "female", "students", ".", "Their", "sex", "is", "F", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ], [ 0, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"F\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'", "query_toks": [ "SELECT", "Fname", ",", "Lname", ",", "Age", "FROM", "Student", "WHERE", "Sex", "=", "'F", "'" ], "query_toks_no_value": [ "select", "fname", ",", "lname", ",", "age", "from", "student", "where", "sex", "=", "value" ], "question": "What are the full names and ages for all female students whose sex is F?", "question_toks": [ "What", "are", "the", "full", "names", "and", "ages", "for", "all", "female", "students", "whose", "sex", "is", "F", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ], [ 0, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"F\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE Sex = 'M'", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "Sex", "=", "'M", "'" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "sex", "=", "value" ], "question": "Show student ids for all male students.", "question_toks": [ "Show", "student", "ids", "for", "all", "male", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"M\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE Sex = 'M'", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "Sex", "=", "'M", "'" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "sex", "=", "value" ], "question": "What are the student ids for all male students?", "question_toks": [ "What", "are", "the", "student", "ids", "for", "all", "male", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"M\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE age = 18", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "age", "=", "18" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "age", "=", "value" ], "question": "How many students are age 18?", "question_toks": [ "How", "many", "students", "are", "age", "18", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], 18.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE age = 18", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "age", "=", "18" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "age", "=", "value" ], "question": "How many students are 18 years old?", "question_toks": [ "How", "many", "students", "are", "18", "years", "old", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], 18.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE age > 20", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "age", ">", "20" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "age", ">", "value" ], "question": "Show all student ids who are older than 20.", "question_toks": [ "Show", "all", "student", "ids", "who", "are", "older", "than", "20", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 3, [ 0, [ 0, 8, false ], null ], 20.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE age > 20", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "age", ">", "20" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "age", ">", "value" ], "question": "What are the student ids for students over 20 years old?", "question_toks": [ "What", "are", "the", "student", "ids", "for", "students", "over", "20", "years", "old", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 3, [ 0, [ 0, 8, false ], null ], 20.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT city_code FROM Student WHERE LName = \"Kim\"", "query_toks": [ "SELECT", "city_code", "FROM", "Student", "WHERE", "LName", "=", "``", "Kim", "''" ], "query_toks_no_value": [ "select", "city_code", "from", "student", "where", "lname", "=", "value" ], "question": "Which city does the student whose last name is \"Kim\" live in?", "question_toks": [ "Which", "city", "does", "the", "student", "whose", "last", "name", "is", "``", "Kim", "''", "live", "in", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 6, false ], null ], "\"Kim\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT city_code FROM Student WHERE LName = \"Kim\"", "query_toks": [ "SELECT", "city_code", "FROM", "Student", "WHERE", "LName", "=", "``", "Kim", "''" ], "query_toks_no_value": [ "select", "city_code", "from", "student", "where", "lname", "=", "value" ], "question": "Give the city that the student whose family name is Kim lives in.", "question_toks": [ "Give", "the", "city", "that", "the", "student", "whose", "family", "name", "is", "Kim", "lives", "in", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 6, false ], null ], "\"Kim\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT Advisor FROM Student WHERE StuID = 1004", "query_toks": [ "SELECT", "Advisor", "FROM", "Student", "WHERE", "StuID", "=", "1004" ], "query_toks_no_value": [ "select", "advisor", "from", "student", "where", "stuid", "=", "value" ], "question": "Who is the advisor of student with ID 1004?", "question_toks": [ "Who", "is", "the", "advisor", "of", "student", "with", "ID", "1004", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 5, false ], null ], 1004.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT Advisor FROM Student WHERE StuID = 1004", "query_toks": [ "SELECT", "Advisor", "FROM", "Student", "WHERE", "StuID", "=", "1004" ], "query_toks_no_value": [ "select", "advisor", "from", "student", "where", "stuid", "=", "value" ], "question": "Who advises student 1004?", "question_toks": [ "Who", "advises", "student", "1004", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 5, false ], null ], 1004.0, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE city_code = \"HKG\" OR city_code = \"CHI\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "city_code", "=", "``", "HKG", "''", "OR", "city_code", "=", "``", "CHI", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "city_code", "=", "value", "or", "city_code", "=", "value" ], "question": "How many students live in HKG or CHI?", "question_toks": [ "How", "many", "students", "live", "in", "HKG", "or", "CHI", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 12, false ], null ], "\"HKG\"", null ], "or", [ false, 2, [ 0, [ 0, 12, false ], null ], "\"CHI\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE city_code = \"HKG\" OR city_code = \"CHI\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "city_code", "=", "``", "HKG", "''", "OR", "city_code", "=", "``", "CHI", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "city_code", "=", "value", "or", "city_code", "=", "value" ], "question": "Give the number of students living in either HKG or CHI.", "question_toks": [ "Give", "the", "number", "of", "students", "living", "in", "either", "HKG", "or", "CHI", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 12, false ], null ], "\"HKG\"", null ], "or", [ false, 2, [ 0, [ 0, 12, false ], null ], "\"CHI\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT min(age) , avg(age) , max(age) FROM Student", "query_toks": [ "SELECT", "min", "(", "age", ")", ",", "avg", "(", "age", ")", ",", "max", "(", "age", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "min", "(", "age", ")", ",", "avg", "(", "age", ")", ",", "max", "(", "age", ")", "from", "student" ], "question": "Show the minimum, average, and maximum age of all students.", "question_toks": [ "Show", "the", "minimum", ",", "average", ",", "and", "maximum", "age", "of", "all", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 2, [ 0, [ 0, 8, false ], null ] ], [ 5, [ 0, [ 0, 8, false ], null ] ], [ 1, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT min(age) , avg(age) , max(age) FROM Student", "query_toks": [ "SELECT", "min", "(", "age", ")", ",", "avg", "(", "age", ")", ",", "max", "(", "age", ")", "FROM", "Student" ], "query_toks_no_value": [ "select", "min", "(", "age", ")", ",", "avg", "(", "age", ")", ",", "max", "(", "age", ")", "from", "student" ], "question": "What is the minimum, mean, and maximum age across all students?", "question_toks": [ "What", "is", "the", "minimum", ",", "mean", ",", "and", "maximum", "age", "across", "all", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 2, [ 0, [ 0, 8, false ], null ] ], [ 5, [ 0, [ 0, 8, false ], null ] ], [ 1, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)", "query_toks": [ "SELECT", "LName", "FROM", "Student", "WHERE", "age", "=", "(", "SELECT", "min", "(", "age", ")", "FROM", "Student", ")" ], "query_toks_no_value": [ "select", "lname", "from", "student", "where", "age", "=", "(", "select", "min", "(", "age", ")", "from", "student", ")" ], "question": "What is the last name of the youngest student?", "question_toks": [ "What", "is", "the", "last", "name", "of", "the", "youngest", "student", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 2, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)", "query_toks": [ "SELECT", "LName", "FROM", "Student", "WHERE", "age", "=", "(", "SELECT", "min", "(", "age", ")", "FROM", "Student", ")" ], "query_toks_no_value": [ "select", "lname", "from", "student", "where", "age", "=", "(", "select", "min", "(", "age", ")", "from", "student", ")" ], "question": "Provide the last name of the youngest student.", "question_toks": [ "Provide", "the", "last", "name", "of", "the", "youngest", "student", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 2, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "age", "=", "(", "SELECT", "max", "(", "age", ")", "FROM", "Student", ")" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "age", "=", "(", "select", "max", "(", "age", ")", "from", "student", ")" ], "question": "Show the student id of the oldest student.", "question_toks": [ "Show", "the", "student", "id", "of", "the", "oldest", "student", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 1, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "WHERE", "age", "=", "(", "SELECT", "max", "(", "age", ")", "FROM", "Student", ")" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "where", "age", "=", "(", "select", "max", "(", "age", ")", "from", "student", ")" ], "question": "What student id corresponds to the oldest student?", "question_toks": [ "What", "student", "id", "corresponds", "to", "the", "oldest", "student", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 8, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 1, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT major , count(*) FROM Student GROUP BY major", "query_toks": [ "SELECT", "major", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "major" ], "query_toks_no_value": [ "select", "major", ",", "count", "(", "*", ")", "from", "student", "group", "by", "major" ], "question": "Show all majors and corresponding number of students.", "question_toks": [ "Show", "all", "majors", "and", "corresponding", "number", "of", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 10, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 10, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT major , count(*) FROM Student GROUP BY major", "query_toks": [ "SELECT", "major", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "major" ], "query_toks_no_value": [ "select", "major", ",", "count", "(", "*", ")", "from", "student", "group", "by", "major" ], "question": "How many students are there for each major?", "question_toks": [ "How", "many", "students", "are", "there", "for", "each", "major", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 10, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 10, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "major", "FROM", "Student", "GROUP", "BY", "major", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "major", "from", "student", "group", "by", "major", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which major has most number of students?", "question_toks": [ "Which", "major", "has", "most", "number", "of", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 10, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "major", "FROM", "Student", "GROUP", "BY", "major", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "major", "from", "student", "group", "by", "major", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "What is the largest major?", "question_toks": [ "What", "is", "the", "largest", "major", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 10, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT age , count(*) FROM Student GROUP BY age", "query_toks": [ "SELECT", "age", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "age" ], "query_toks_no_value": [ "select", "age", ",", "count", "(", "*", ")", "from", "student", "group", "by", "age" ], "question": "Show all ages and corresponding number of students.", "question_toks": [ "Show", "all", "ages", "and", "corresponding", "number", "of", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 8, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 8, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT age , count(*) FROM Student GROUP BY age", "query_toks": [ "SELECT", "age", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "age" ], "query_toks_no_value": [ "select", "age", ",", "count", "(", "*", ")", "from", "student", "group", "by", "age" ], "question": "How old is each student and how many students are each age?", "question_toks": [ "How", "old", "is", "each", "student", "and", "how", "many", "students", "are", "each", "age", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 8, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 8, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT avg(age) , sex FROM Student GROUP BY sex", "query_toks": [ "SELECT", "avg", "(", "age", ")", ",", "sex", "FROM", "Student", "GROUP", "BY", "sex" ], "query_toks_no_value": [ "select", "avg", "(", "age", ")", ",", "sex", "from", "student", "group", "by", "sex" ], "question": "Show the average age for male and female students.", "question_toks": [ "Show", "the", "average", "age", "for", "male", "and", "female", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 9, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 5, [ 0, [ 0, 8, false ], null ] ], [ 0, [ 0, [ 0, 9, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT avg(age) , sex FROM Student GROUP BY sex", "query_toks": [ "SELECT", "avg", "(", "age", ")", ",", "sex", "FROM", "Student", "GROUP", "BY", "sex" ], "query_toks_no_value": [ "select", "avg", "(", "age", ")", ",", "sex", "from", "student", "group", "by", "sex" ], "question": "What are the average ages for male and female students?", "question_toks": [ "What", "are", "the", "average", "ages", "for", "male", "and", "female", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 9, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 5, [ 0, [ 0, 8, false ], null ] ], [ 0, [ 0, [ 0, 9, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT city_code , count(*) FROM Student GROUP BY city_code", "query_toks": [ "SELECT", "city_code", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "city_code" ], "query_toks_no_value": [ "select", "city_code", ",", "count", "(", "*", ")", "from", "student", "group", "by", "city_code" ], "question": "Show all cities and corresponding number of students.", "question_toks": [ "Show", "all", "cities", "and", "corresponding", "number", "of", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 12, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 12, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT city_code , count(*) FROM Student GROUP BY city_code", "query_toks": [ "SELECT", "city_code", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "city_code" ], "query_toks_no_value": [ "select", "city_code", ",", "count", "(", "*", ")", "from", "student", "group", "by", "city_code" ], "question": "How many students live in each city?", "question_toks": [ "How", "many", "students", "live", "in", "each", "city", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 12, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 12, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT advisor , count(*) FROM Student GROUP BY advisor", "query_toks": [ "SELECT", "advisor", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "advisor" ], "query_toks_no_value": [ "select", "advisor", ",", "count", "(", "*", ")", "from", "student", "group", "by", "advisor" ], "question": "Show all advisors and corresponding number of students.", "question_toks": [ "Show", "all", "advisors", "and", "corresponding", "number", "of", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 11, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT advisor , count(*) FROM Student GROUP BY advisor", "query_toks": [ "SELECT", "advisor", ",", "count", "(", "*", ")", "FROM", "Student", "GROUP", "BY", "advisor" ], "query_toks_no_value": [ "select", "advisor", ",", "count", "(", "*", ")", "from", "student", "group", "by", "advisor" ], "question": "How many students does each advisor have?", "question_toks": [ "How", "many", "students", "does", "each", "advisor", "have", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 11, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "advisor", "FROM", "Student", "GROUP", "BY", "advisor", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "advisor", "from", "student", "group", "by", "advisor", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which advisor has most number of students?", "question_toks": [ "Which", "advisor", "has", "most", "number", "of", "students", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 11, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "advisor", "FROM", "Student", "GROUP", "BY", "advisor", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "advisor", "from", "student", "group", "by", "advisor", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Give the advisor with the most students.", "question_toks": [ "Give", "the", "advisor", "with", "the", "most", "students", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [ [ 0, 11, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 11, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Has_allergy WHERE Allergy = \"Cat\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "where", "allergy", "=", "value" ], "question": "How many students have cat allergies?", "question_toks": [ "How", "many", "students", "have", "cat", "allergies", "?" ], "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": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Has_allergy WHERE Allergy = \"Cat\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "where", "allergy", "=", "value" ], "question": "How many students are affected by cat allergies?", "question_toks": [ "How", "many", "students", "are", "affected", "by", "cat", "allergies", "?" ], "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": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2", "query_toks": [ "SELECT", "StuID", "FROM", "Has_allergy", "GROUP", "BY", "StuID", "HAVING", "count", "(", "*", ")", ">", "=", "2" ], "query_toks_no_value": [ "select", "stuid", "from", "has_allergy", "group", "by", "stuid", "having", "count", "(", "*", ")", ">", "=", "value" ], "question": "Show all student IDs who have at least two allergies.", "question_toks": [ "Show", "all", "student", "IDs", "who", "have", "at", "least", "two", "allergies", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 3, false ] ], "having": [ [ false, 5, [ 0, [ 3, 0, false ], null ], 2.0, null ] ], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2", "query_toks": [ "SELECT", "StuID", "FROM", "Has_allergy", "GROUP", "BY", "StuID", "HAVING", "count", "(", "*", ")", ">", "=", "2" ], "query_toks_no_value": [ "select", "stuid", "from", "has_allergy", "group", "by", "stuid", "having", "count", "(", "*", ")", ">", "=", "value" ], "question": "What are the students ids of students who have more than one allergy?", "question_toks": [ "What", "are", "the", "students", "ids", "of", "students", "who", "have", "more", "than", "one", "allergy", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 3, false ] ], "having": [ [ false, 5, [ 0, [ 3, 0, false ], null ], 2.0, null ] ], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "EXCEPT", "SELECT", "StuID", "FROM", "Has_allergy" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "except", "select", "stuid", "from", "has_allergy" ], "question": "What are the student ids of students who don't have any allergies?", "question_toks": [ "What", "are", "the", "student", "ids", "of", "students", "who", "do", "n't", "have", "any", "allergies", "?" ], "sql": { "except": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [] }, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy", "query_toks": [ "SELECT", "StuID", "FROM", "Student", "EXCEPT", "SELECT", "StuID", "FROM", "Has_allergy" ], "query_toks_no_value": [ "select", "stuid", "from", "student", "except", "select", "stuid", "from", "has_allergy" ], "question": "Which students are unaffected by allergies?", "question_toks": [ "Which", "students", "are", "unaffected", "by", "allergies", "?" ], "sql": { "except": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [] }, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 5, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = \"F\" AND T1.allergy = \"Milk\" OR T1.allergy = \"Eggs\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "has_allergy", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.StuID", "=", "T2.StuID", "WHERE", "T2.sex", "=", "``", "F", "''", "AND", "T1.allergy", "=", "``", "Milk", "''", "OR", "T1.allergy", "=", "``", "Eggs", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "where", "t2", ".", "sex", "=", "value", "and", "t1", ".", "allergy", "=", "value", "or", "t1", ".", "allergy", "=", "value" ], "question": "How many female students have milk or egg allergies?", "question_toks": [ "How", "many", "female", "students", "have", "milk", "or", "egg", "allergies", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 3, false ], null ], [ 0, 5, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"F\"", null ], "and", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ], "or", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Eggs\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = \"F\" AND T1.allergy = \"Milk\" OR T1.allergy = \"Eggs\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "has_allergy", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.StuID", "=", "T2.StuID", "WHERE", "T2.sex", "=", "``", "F", "''", "AND", "T1.allergy", "=", "``", "Milk", "''", "OR", "T1.allergy", "=", "``", "Eggs", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "where", "t2", ".", "sex", "=", "value", "and", "t1", ".", "allergy", "=", "value", "or", "t1", ".", "allergy", "=", "value" ], "question": "How many students who are female are allergic to milk or eggs?", "question_toks": [ "How", "many", "students", "who", "are", "female", "are", "allergic", "to", "milk", "or", "eggs", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 3, false ], null ], [ 0, 5, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"F\"", null ], "and", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ], "or", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Eggs\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = \"food\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_type", "AS", "T2", "ON", "T1.allergy", "=", "T2.allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value" ], "question": "How many students have a food allergy?", "question_toks": [ "How", "many", "students", "have", "a", "food", "allergy", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = \"food\"", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_type", "AS", "T2", "ON", "T1.allergy", "=", "T2.allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value" ], "question": "How many students are affected by food related allergies?", "question_toks": [ "How", "many", "students", "are", "affected", "by", "food", "related", "allergies", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "Allergy", "FROM", "Has_allergy", "GROUP", "BY", "Allergy", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergy", "from", "has_allergy", "group", "by", "allergy", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which allergy has most number of students affected?", "question_toks": [ "Which", "allergy", "has", "most", "number", "of", "students", "affected", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 4, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 4, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1", "query_toks": [ "SELECT", "Allergy", "FROM", "Has_allergy", "GROUP", "BY", "Allergy", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ], "query_toks_no_value": [ "select", "allergy", "from", "has_allergy", "group", "by", "allergy", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ], "question": "Which allergy is the most common?", "question_toks": [ "Which", "allergy", "is", "the", "most", "common", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 4, false ] ], "having": [], "intersect": null, "limit": 1, "orderBy": [ "desc", [ [ 0, [ 3, 0, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 4, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy", "query_toks": [ "SELECT", "Allergy", ",", "count", "(", "*", ")", "FROM", "Has_allergy", "GROUP", "BY", "Allergy" ], "query_toks_no_value": [ "select", "allergy", ",", "count", "(", "*", ")", "from", "has_allergy", "group", "by", "allergy" ], "question": "Show all allergies with number of students affected.", "question_toks": [ "Show", "all", "allergies", "with", "number", "of", "students", "affected", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 4, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 4, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy", "query_toks": [ "SELECT", "Allergy", ",", "count", "(", "*", ")", "FROM", "Has_allergy", "GROUP", "BY", "Allergy" ], "query_toks_no_value": [ "select", "allergy", ",", "count", "(", "*", ")", "from", "has_allergy", "group", "by", "allergy" ], "question": "How many students have each different allergy?", "question_toks": [ "How", "many", "students", "have", "each", "different", "allergy", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [ [ 0, 4, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 4, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype", "query_toks": [ "SELECT", "T2.allergytype", ",", "count", "(", "*", ")", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_type", "AS", "T2", "ON", "T1.allergy", "=", "T2.allergy", "GROUP", "BY", "T2.allergytype" ], "query_toks_no_value": [ "select", "t2", ".", "allergytype", ",", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "group", "by", "t2", ".", "allergytype" ], "question": "Show all allergy type with number of students affected.", "question_toks": [ "Show", "all", "allergy", "type", "with", "number", "of", "students", "affected", "." ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype", "query_toks": [ "SELECT", "T2.allergytype", ",", "count", "(", "*", ")", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_type", "AS", "T2", "ON", "T1.allergy", "=", "T2.allergy", "GROUP", "BY", "T2.allergytype" ], "query_toks_no_value": [ "select", "t2", ".", "allergytype", ",", "count", "(", "*", ")", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "group", "by", "t2", ".", "allergytype" ], "question": "How many students are affected by each allergy type?", "question_toks": [ "How", "many", "students", "are", "affected", "by", "each", "allergy", "type", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [ [ 0, 2, false ] ], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 2, false ], null ] ], [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [] } }, { "db_id": "allergy_1", "query": "SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "query_toks": [ "SELECT", "lname", ",", "age", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Milk", "''", "INTERSECT", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''", ")" ], "query_toks_no_value": [ "select", "lname", ",", "age", "from", "student", "where", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", "intersect", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "Find the last name and age of the student who has allergy to both milk and cat.", "question_toks": [ "Find", "the", "last", "name", "and", "age", "of", "the", "student", "who", "has", "allergy", "to", "both", "milk", "and", "cat", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 6, false ], null ] ], [ 0, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] }, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "query_toks": [ "SELECT", "lname", ",", "age", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Milk", "''", "INTERSECT", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''", ")" ], "query_toks_no_value": [ "select", "lname", ",", "age", "from", "student", "where", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", "intersect", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "What are the last names and ages of the students who are allergic to milk and cat?", "question_toks": [ "What", "are", "the", "last", "names", "and", "ages", "of", "the", "students", "who", "are", "allergic", "to", "milk", "and", "cat", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 6, false ], null ] ], [ 0, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] }, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" ORDER BY T1.Allergy", "query_toks": [ "SELECT", "T1.Allergy", ",", "T1.AllergyType", "FROM", "Allergy_type", "AS", "T1", "JOIN", "Has_allergy", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "JOIN", "Student", "AS", "T3", "ON", "T3.StuID", "=", "T2.StuID", "WHERE", "T3.Fname", "=", "``", "Lisa", "''", "ORDER", "BY", "T1.Allergy" ], "query_toks_no_value": [ "select", "t1", ".", "allergy", ",", "t1", ".", "allergytype", "from", "allergy_type", "as", "t1", "join", "has_allergy", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "join", "student", "as", "t3", "on", "t3", ".", "stuid", "=", "t2", ".", "stuid", "where", "t3", ".", "fname", "=", "value", "order", "by", "t1", ".", "allergy" ], "question": "What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.", "question_toks": [ "What", "are", "the", "allergies", "and", "their", "types", "that", "the", "student", "with", "first", "name", "Lisa", "has", "?", "And", "order", "the", "result", "by", "name", "of", "allergies", "." ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 1, false ], null ], [ 0, 4, false ], null ], "and", [ false, 2, [ 0, [ 0, 5, false ], null ], [ 0, 3, false ], null ] ], "table_units": [ [ "table_unit", 0 ], [ "table_unit", 1 ], [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [ "asc", [ [ 0, [ 0, 1, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 1, false ], null ] ], [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 7, false ], null ], "\"Lisa\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = \"Lisa\" ORDER BY T1.Allergy", "query_toks": [ "SELECT", "T1.Allergy", ",", "T1.AllergyType", "FROM", "Allergy_type", "AS", "T1", "JOIN", "Has_allergy", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "JOIN", "Student", "AS", "T3", "ON", "T3.StuID", "=", "T2.StuID", "WHERE", "T3.Fname", "=", "``", "Lisa", "''", "ORDER", "BY", "T1.Allergy" ], "query_toks_no_value": [ "select", "t1", ".", "allergy", ",", "t1", ".", "allergytype", "from", "allergy_type", "as", "t1", "join", "has_allergy", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "join", "student", "as", "t3", "on", "t3", ".", "stuid", "=", "t2", ".", "stuid", "where", "t3", ".", "fname", "=", "value", "order", "by", "t1", ".", "allergy" ], "question": "What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.", "question_toks": [ "What", "are", "the", "allergies", "the", "girl", "named", "Lisa", "has", "?", "And", "what", "are", "the", "types", "of", "them", "?", "Order", "the", "result", "by", "allergy", "names", "." ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 1, false ], null ], [ 0, 4, false ], null ], "and", [ false, 2, [ 0, [ 0, 5, false ], null ], [ 0, 3, false ], null ] ], "table_units": [ [ "table_unit", 0 ], [ "table_unit", 1 ], [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [ "asc", [ [ 0, [ 0, 1, false ], null ] ] ], "select": [ false, [ [ 0, [ 0, [ 0, 1, false ], null ] ], [ 0, [ 0, [ 0, 2, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 7, false ], null ], "\"Lisa\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "query_toks": [ "SELECT", "fname", ",", "sex", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Milk", "''", "EXCEPT", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "sex", "from", "student", "where", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", "except", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "Find the first name and gender of the student who has allergy to milk but not cat.", "question_toks": [ "Find", "the", "first", "name", "and", "gender", "of", "the", "student", "who", "has", "allergy", "to", "milk", "but", "not", "cat", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 9, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] }, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Milk\" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = \"Cat\")", "query_toks": [ "SELECT", "fname", ",", "sex", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Milk", "''", "EXCEPT", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Cat", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "sex", "from", "student", "where", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", "except", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "What are the first name and gender of the students who have allergy to milk but can put up with cats?", "question_toks": [ "What", "are", "the", "first", "name", "and", "gender", "of", "the", "students", "who", "have", "allergy", "to", "milk", "but", "can", "put", "up", "with", "cats", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 9, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] }, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"animal\")", "query_toks": [ "SELECT", "avg", "(", "age", ")", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", "INTERSECT", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "animal", "''", ")" ], "query_toks_no_value": [ "select", "avg", "(", "age", ")", "from", "student", "where", "stuid", "in", "(", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", "intersect", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "Find the average age of the students who have allergies with food and animal types.", "question_toks": [ "Find", "the", "average", "age", "of", "the", "students", "who", "have", "allergies", "with", "food", "and", "animal", "types", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 5, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] }, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"animal\")", "query_toks": [ "SELECT", "avg", "(", "age", ")", "FROM", "Student", "WHERE", "StuID", "IN", "(", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", "INTERSECT", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "animal", "''", ")" ], "query_toks_no_value": [ "select", "avg", "(", "age", ")", "from", "student", "where", "stuid", "in", "(", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", "intersect", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "How old are the students with allergies to food and animal types on average?", "question_toks": [ "How", "old", "are", "the", "students", "with", "allergies", "to", "food", "and", "animal", "types", "on", "average", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 5, [ 0, [ 0, 8, false ], null ] ] ] ], "union": null, "where": [ [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] }, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "query_toks": [ "SELECT", "fname", ",", "lname", "FROM", "Student", "WHERE", "StuID", "NOT", "IN", "(", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "lname", "from", "student", "where", "stuid", "not", "in", "(", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "List the first and last name of the students who do not have any food type allergy.", "question_toks": [ "List", "the", "first", "and", "last", "name", "of", "the", "students", "who", "do", "not", "have", "any", "food", "type", "allergy", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [ [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "query_toks": [ "SELECT", "fname", ",", "lname", "FROM", "Student", "WHERE", "StuID", "NOT", "IN", "(", "SELECT", "T1.StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "lname", "from", "student", "where", "stuid", "not", "in", "(", "select", "t1", ".", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "What is the full name of each student who is not allergic to any type of food.", "question_toks": [ "What", "is", "the", "full", "name", "of", "each", "student", "who", "is", "not", "allergic", "to", "any", "type", "of", "food", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 6, false ], null ] ] ] ], "union": null, "where": [ [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE sex = \"M\" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "sex", "=", "``", "M", "''", "AND", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", ")" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "sex", "=", "value", "and", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "Find the number of male (sex is 'M') students who have some food type allery.", "question_toks": [ "Find", "the", "number", "of", "male", "(", "sex", "is", "'M", "'", ")", "students", "who", "have", "some", "food", "type", "allery", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"M\"", null ], "and", [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE sex = \"M\" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\")", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "sex", "=", "``", "M", "''", "AND", "StuID", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", ")" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "sex", "=", "value", "and", "stuid", "in", "(", "select", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", ")" ], "question": "How many male students (sex is 'M') are allergic to any type of food?", "question_toks": [ "How", "many", "male", "students", "(", "sex", "is", "'M", "'", ")", "are", "allergic", "to", "any", "type", "of", "food", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 9, false ], null ], "\"M\"", null ], "and", [ false, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = \"Milk\" OR T2.Allergy = \"Cat\"", "query_toks": [ "SELECT", "DISTINCT", "T1.fname", ",", "T1.city_code", "FROM", "Student", "AS", "T1", "JOIN", "Has_Allergy", "AS", "T2", "ON", "T1.stuid", "=", "T2.stuid", "WHERE", "T2.Allergy", "=", "``", "Milk", "''", "OR", "T2.Allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "distinct", "t1", ".", "fname", ",", "t1", ".", "city_code", "from", "student", "as", "t1", "join", "has_allergy", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "where", "t2", ".", "allergy", "=", "value", "or", "t2", ".", "allergy", "=", "value" ], "question": "Find the different first names and cities of the students who have allergy to milk or cat.", "question_toks": [ "Find", "the", "different", "first", "names", "and", "cities", "of", "the", "students", "who", "have", "allergy", "to", "milk", "or", "cat", "." ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 5, false ], null ], [ 0, 3, false ], null ] ], "table_units": [ [ "table_unit", 2 ], [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ], "or", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = \"Milk\" OR T2.Allergy = \"Cat\"", "query_toks": [ "SELECT", "DISTINCT", "T1.fname", ",", "T1.city_code", "FROM", "Student", "AS", "T1", "JOIN", "Has_Allergy", "AS", "T2", "ON", "T1.stuid", "=", "T2.stuid", "WHERE", "T2.Allergy", "=", "``", "Milk", "''", "OR", "T2.Allergy", "=", "``", "Cat", "''" ], "query_toks_no_value": [ "select", "distinct", "t1", ".", "fname", ",", "t1", ".", "city_code", "from", "student", "as", "t1", "join", "has_allergy", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "where", "t2", ".", "allergy", "=", "value", "or", "t2", ".", "allergy", "=", "value" ], "question": "What are the distinct first names and cities of the students who have allergy either to milk or to cat?", "question_toks": [ "What", "are", "the", "distinct", "first", "names", "and", "cities", "of", "the", "students", "who", "have", "allergy", "either", "to", "milk", "or", "to", "cat", "?" ], "sql": { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 5, false ], null ], [ 0, 3, false ], null ] ], "table_units": [ [ "table_unit", 2 ], [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ true, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 12, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Milk\"", null ], "or", [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Cat\"", null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" OR T2.allergytype = \"animal\")", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "age", ">", "18", "AND", "StuID", "NOT", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", "OR", "T2.allergytype", "=", "``", "animal", "''", ")" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "age", ">", "value", "and", "stuid", "not", "in", "(", "select", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", "or", "t2", ".", "allergytype", "=", "value", ")" ], "question": "Find the number of students who are older than 18 and do not have allergy to either food or animal.", "question_toks": [ "Find", "the", "number", "of", "students", "who", "are", "older", "than", "18", "and", "do", "not", "have", "allergy", "to", "either", "food", "or", "animal", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 3, [ 0, [ 0, 8, false ], null ], 18.0, null ], "and", [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ], "or", [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = \"food\" OR T2.allergytype = \"animal\")", "query_toks": [ "SELECT", "count", "(", "*", ")", "FROM", "Student", "WHERE", "age", ">", "18", "AND", "StuID", "NOT", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "AS", "T1", "JOIN", "Allergy_Type", "AS", "T2", "ON", "T1.Allergy", "=", "T2.Allergy", "WHERE", "T2.allergytype", "=", "``", "food", "''", "OR", "T2.allergytype", "=", "``", "animal", "''", ")" ], "query_toks_no_value": [ "select", "count", "(", "*", ")", "from", "student", "where", "age", ">", "value", "and", "stuid", "not", "in", "(", "select", "stuid", "from", "has_allergy", "as", "t1", "join", "allergy_type", "as", "t2", "on", "t1", ".", "allergy", "=", "t2", ".", "allergy", "where", "t2", ".", "allergytype", "=", "value", "or", "t2", ".", "allergytype", "=", "value", ")" ], "question": "How many students are over 18 and do not have allergy to food type or animal type?", "question_toks": [ "How", "many", "students", "are", "over", "18", "and", "do", "not", "have", "allergy", "to", "food", "type", "or", "animal", "type", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 3, [ 0, [ 0, 0, false ], null ] ] ] ], "union": null, "where": [ [ false, 3, [ 0, [ 0, 8, false ], null ], 18.0, null ], "and", [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [ [ false, 2, [ 0, [ 0, 4, false ], null ], [ 0, 1, false ], null ] ], "table_units": [ [ "table_unit", 1 ], [ "table_unit", 0 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 2, false ], null ], "\"food\"", null ], "or", [ false, 2, [ 0, [ 0, 2, false ], null ], "\"animal\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Soy\")", "query_toks": [ "SELECT", "fname", ",", "major", "FROM", "Student", "WHERE", "StuID", "NOT", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Soy", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "major", "from", "student", "where", "stuid", "not", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "Find the first name and major of the students who are not allegry to soy.", "question_toks": [ "Find", "the", "first", "name", "and", "major", "of", "the", "students", "who", "are", "not", "allegry", "to", "soy", "." ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [ [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Soy\"", null ] ] }, null ] ] } }, { "db_id": "allergy_1", "query": "SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = \"Soy\")", "query_toks": [ "SELECT", "fname", ",", "major", "FROM", "Student", "WHERE", "StuID", "NOT", "IN", "(", "SELECT", "StuID", "FROM", "Has_allergy", "WHERE", "Allergy", "=", "``", "Soy", "''", ")" ], "query_toks_no_value": [ "select", "fname", ",", "major", "from", "student", "where", "stuid", "not", "in", "(", "select", "stuid", "from", "has_allergy", "where", "allergy", "=", "value", ")" ], "question": "What are the first name and major of the students who are able to consume soy?", "question_toks": [ "What", "are", "the", "first", "name", "and", "major", "of", "the", "students", "who", "are", "able", "to", "consume", "soy", "?" ], "sql": { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 2 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 7, false ], null ] ], [ 0, [ 0, [ 0, 10, false ], null ] ] ] ], "union": null, "where": [ [ true, 8, [ 0, [ 0, 5, false ], null ], { "except": null, "from": { "conds": [], "table_units": [ [ "table_unit", 1 ] ] }, "groupBy": [], "having": [], "intersect": null, "limit": null, "orderBy": [], "select": [ false, [ [ 0, [ 0, [ 0, 3, false ], null ] ] ] ], "union": null, "where": [ [ false, 2, [ 0, [ 0, 4, false ], null ], "\"Soy\"", null ] ] }, null ] ] } } ]