File size: 42,474 Bytes
cdc1cad | 1 | [{"id": "dev_0499", "db_id": "battle_death", "query": "select t1.id , t1.name from battle as t1 join ship as t2 on t1.id = t2.lost_in_battle join death as t3 on t2.id = t3.caused_by_ship_id group by t1.id having sum(t3.killed) > 10", "query_toks": ["SELECT", "T1.id", ",", "T1.name", "FROM", "battle", "AS", "T1", "JOIN", "ship", "AS", "T2", "ON", "T1.id", "=", "T2.lost_in_battle", "JOIN", "death", "AS", "T3", "ON", "T2.id", "=", "T3.caused_by_ship_id", "GROUP", "BY", "T1.id", "HAVING", "sum", "(", "T3.killed", ")", ">", "10"], "query_toks_no_value": ["select", "t1", ".", "id", ",", "t1", ".", "name", "from", "battle", "as", "t1", "join", "ship", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "lost_in_battle", "join", "death", "as", "t3", "on", "t2", ".", "id", "=", "t3", ".", "caused_by_ship_id", "group", "by", "t1", ".", "id", "having", "sum", "(", "t3", ".", "killed", ")", ">", "value"], "question": "What are the ids and names of the battles that led to more than 10 people killed in total.", "question_toks": ["What", "are", "the", "ids", "and", "names", "of", "the", "battles", "that", "led", "to", "more", "than", "10", "people", "killed", "in", "total", "."], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 7, false], null], "and", [false, 2, [0, [0, 8, false], null], [0, 14, false], null]]}, "select": [false, [[0, [0, [0, 1, false], null]], [0, [0, [0, 2, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 3, [0, [4, 17, false], null], 10.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0123", "db_id": "car_1", "query": "select t1.countryname , t1.countryid from countries as t1 join car_makers as t2 on t1.countryid = t2.country group by t1.countryid having count(*) >= 1;", "query_toks": ["SELECT", "T1.CountryName", ",", "T1.CountryId", "FROM", "COUNTRIES", "AS", "T1", "JOIN", "CAR_MAKERS", "AS", "T2", "ON", "T1.CountryId", "=", "T2.Country", "GROUP", "BY", "T1.CountryId", "HAVING", "count", "(", "*", ")", ">", "=", "1", ";"], "query_toks_no_value": ["select", "t1", ".", "countryname", ",", "t1", ".", "countryid", "from", "countries", "as", "t1", "join", "car_makers", "as", "t2", "on", "t1", ".", "countryid", "=", "t2", ".", "country", "group", "by", "t1", ".", "countryid", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the countries having at least one car maker? List name and id.", "question_toks": ["What", "are", "the", "countries", "having", "at", "least", "one", "car", "maker", "?", "List", "name", "and", "id", "."], "sql": {"from": {"table_units": [["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 3, false], null], [0, 9, false], null]]}, "select": [false, [[0, [0, [0, 4, false], null]], [0, [0, [0, 3, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 5, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0124", "db_id": "car_1", "query": "select t1.countryname , t1.countryid from countries as t1 join car_makers as t2 on t1.countryid = t2.country group by t1.countryid having count(*) >= 1;", "query_toks": ["SELECT", "T1.CountryName", ",", "T1.CountryId", "FROM", "COUNTRIES", "AS", "T1", "JOIN", "CAR_MAKERS", "AS", "T2", "ON", "T1.CountryId", "=", "T2.Country", "GROUP", "BY", "T1.CountryId", "HAVING", "count", "(", "*", ")", ">", "=", "1", ";"], "query_toks_no_value": ["select", "t1", ".", "countryname", ",", "t1", ".", "countryid", "from", "countries", "as", "t1", "join", "car_makers", "as", "t2", "on", "t1", ".", "countryid", "=", "t2", ".", "country", "group", "by", "t1", ".", "countryid", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the names and ids of all countries with at least one car maker?", "question_toks": ["What", "are", "the", "names", "and", "ids", "of", "all", "countries", "with", "at", "least", "one", "car", "maker", "?"], "sql": {"from": {"table_units": [["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 3, false], null], [0, 9, false], null]]}, "select": [false, [[0, [0, [0, 4, false], null]], [0, [0, [0, 3, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 5, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0397", "db_id": "course_teach", "query": "select hometown from teacher group by hometown having count(*) >= 2", "query_toks": ["SELECT", "Hometown", "FROM", "teacher", "GROUP", "BY", "Hometown", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "hometown", "from", "teacher", "group", "by", "hometown", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "Show the hometowns shared by at least two teachers.", "question_toks": ["Show", "the", "hometowns", "shared", "by", "at", "least", "two", "teachers", "."], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 7, false], null]]]], "where": [], "groupBy": [[0, 7, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0398", "db_id": "course_teach", "query": "select hometown from teacher group by hometown having count(*) >= 2", "query_toks": ["SELECT", "Hometown", "FROM", "teacher", "GROUP", "BY", "Hometown", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "hometown", "from", "teacher", "group", "by", "hometown", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the towns from which at least two teachers come from?", "question_toks": ["What", "are", "the", "towns", "from", "which", "at", "least", "two", "teachers", "come", "from", "?"], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 7, false], null]]]], "where": [], "groupBy": [[0, 7, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0407", "db_id": "course_teach", "query": "select t2.name from course_arrange as t1 join teacher as t2 on t1.teacher_id = t2.teacher_id group by t2.name having count(*) >= 2", "query_toks": ["SELECT", "T2.Name", "FROM", "course_arrange", "AS", "T1", "JOIN", "teacher", "AS", "T2", "ON", "T1.Teacher_ID", "=", "T2.Teacher_ID", "GROUP", "BY", "T2.Name", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "t2", ".", "name", "from", "course_arrange", "as", "t1", "join", "teacher", "as", "t2", "on", "t1", ".", "teacher_id", "=", "t2", ".", "teacher_id", "group", "by", "t2", ".", "name", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "Show names of teachers that teach at least two courses.", "question_toks": ["Show", "names", "of", "teachers", "that", "teach", "at", "least", "two", "courses", "."], "sql": {"from": {"table_units": [["table_unit", 2], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 9, false], null], [0, 4, false], null]]}, "select": [false, [[0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 5, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0408", "db_id": "course_teach", "query": "select t2.name from course_arrange as t1 join teacher as t2 on t1.teacher_id = t2.teacher_id group by t2.name having count(*) >= 2", "query_toks": ["SELECT", "T2.Name", "FROM", "course_arrange", "AS", "T1", "JOIN", "teacher", "AS", "T2", "ON", "T1.Teacher_ID", "=", "T2.Teacher_ID", "GROUP", "BY", "T2.Name", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "t2", ".", "name", "from", "course_arrange", "as", "t1", "join", "teacher", "as", "t2", "on", "t1", ".", "teacher_id", "=", "t2", ".", "teacher_id", "group", "by", "t2", ".", "name", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the names of the teachers who teach at least two courses?", "question_toks": ["What", "are", "the", "names", "of", "the", "teachers", "who", "teach", "at", "least", "two", "courses", "?"], "sql": {"from": {"table_units": [["table_unit", 2], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 9, false], null], [0, 4, false], null]]}, "select": [false, [[0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 5, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0922", "db_id": "dog_kennels", "query": "select professional_id , last_name , cell_number from professionals where state = 'indiana' union select t1.professional_id , t1.last_name , t1.cell_number from professionals as t1 join treatments as t2 on t1.professional_id = t2.professional_id group by t1.professional_id having count(*) > 2", "query_toks": ["SELECT", "professional_id", ",", "last_name", ",", "cell_number", "FROM", "Professionals", "WHERE", "state", "=", "'Indiana", "'", "UNION", "SELECT", "T1.professional_id", ",", "T1.last_name", ",", "T1.cell_number", "FROM", "Professionals", "AS", "T1", "JOIN", "Treatments", "AS", "T2", "ON", "T1.professional_id", "=", "T2.professional_id", "GROUP", "BY", "T1.professional_id", "HAVING", "count", "(", "*", ")", ">", "2"], "query_toks_no_value": ["select", "professional_id", ",", "last_name", ",", "cell_number", "from", "professionals", "where", "state", "=", "value", "union", "select", "t1", ".", "professional_id", ",", "t1", ".", "last_name", ",", "t1", ".", "cell_number", "from", "professionals", "as", "t1", "join", "treatments", "as", "t2", "on", "t1", ".", "professional_id", "=", "t2", ".", "professional_id", "group", "by", "t1", ".", "professional_id", "having", "count", "(", "*", ")", ">", "value"], "question": "Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.", "question_toks": ["Which", "professionals", "live", "in", "the", "state", "of", "Indiana", "or", "have", "done", "treatment", "on", "more", "than", "2", "treatments", "?", "List", "his", "or", "her", "id", ",", "last", "name", "and", "cell", "phone", "."], "sql": {"from": {"table_units": [["table_unit", 6]], "conds": []}, "select": [false, [[0, [0, [0, 33, false], null]], [0, [0, [0, 40, false], null]], [0, [0, [0, 43, false], null]]]], "where": [[false, 2, [0, [0, 38, false], null], "\"Indiana\"", null]], "groupBy": [], "having": [], "orderBy": [], "limit": null, "intersect": null, "union": {"from": {"table_units": [["table_unit", 6], ["table_unit", 7]], "conds": [[false, 2, [0, [0, 33, false], null], [0, 46, false], null]]}, "select": [false, [[0, [0, [0, 33, false], null]], [0, [0, [0, 40, false], null]], [0, [0, [0, 43, false], null]]]], "where": [], "groupBy": [[0, 33, false]], "having": [[false, 3, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0923", "db_id": "dog_kennels", "query": "select professional_id , last_name , cell_number from professionals where state = 'indiana' union select t1.professional_id , t1.last_name , t1.cell_number from professionals as t1 join treatments as t2 on t1.professional_id = t2.professional_id group by t1.professional_id having count(*) > 2", "query_toks": ["SELECT", "professional_id", ",", "last_name", ",", "cell_number", "FROM", "Professionals", "WHERE", "state", "=", "'Indiana", "'", "UNION", "SELECT", "T1.professional_id", ",", "T1.last_name", ",", "T1.cell_number", "FROM", "Professionals", "AS", "T1", "JOIN", "Treatments", "AS", "T2", "ON", "T1.professional_id", "=", "T2.professional_id", "GROUP", "BY", "T1.professional_id", "HAVING", "count", "(", "*", ")", ">", "2"], "query_toks_no_value": ["select", "professional_id", ",", "last_name", ",", "cell_number", "from", "professionals", "where", "state", "=", "value", "union", "select", "t1", ".", "professional_id", ",", "t1", ".", "last_name", ",", "t1", ".", "cell_number", "from", "professionals", "as", "t1", "join", "treatments", "as", "t2", "on", "t1", ".", "professional_id", "=", "t2", ".", "professional_id", "group", "by", "t1", ".", "professional_id", "having", "count", "(", "*", ")", ">", "value"], "question": "Find the id, last name and cell phone of the professionals who live in the state of Indiana or have performed more than two treatments.", "question_toks": ["Find", "the", "id", ",", "last", "name", "and", "cell", "phone", "of", "the", "professionals", "who", "live", "in", "the", "state", "of", "Indiana", "or", "have", "performed", "more", "than", "two", "treatments", "."], "sql": {"from": {"table_units": [["table_unit", 6]], "conds": []}, "select": [false, [[0, [0, [0, 33, false], null]], [0, [0, [0, 40, false], null]], [0, [0, [0, 43, false], null]]]], "where": [[false, 2, [0, [0, 38, false], null], "\"Indiana\"", null]], "groupBy": [], "having": [], "orderBy": [], "limit": null, "intersect": null, "union": {"from": {"table_units": [["table_unit", 6], ["table_unit", 7]], "conds": [[false, 2, [0, [0, 33, false], null], [0, 46, false], null]]}, "select": [false, [[0, [0, [0, 33, false], null]], [0, [0, [0, 40, false], null]], [0, [0, [0, 43, false], null]]]], "where": [], "groupBy": [[0, 33, false]], "having": [[false, 3, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0925", "db_id": "dog_kennels", "query": "select name from dogs where dog_id not in ( select dog_id from treatments group by dog_id having sum(cost_of_treatment) > 1000 )", "query_toks": ["select", "name", "from", "dogs", "where", "dog_id", "not", "in", "(", "select", "dog_id", "from", "treatments", "group", "by", "dog_id", "having", "sum", "(", "cost_of_treatment", ")", ">", "1000", ")"], "query_toks_no_value": ["select", "name", "from", "dogs", "where", "dog_id", "not", "in", "(", "select", "dog_id", "from", "treatments", "group", "by", "dog_id", "having", "sum", "(", "cost_of_treatment", ")", ">", "value", ")"], "question": "What are the names of the dogs for which the owner has not spend more than 1000 for treatment ?", "question_toks": ["What", "are", "the", "names", "of", "the", "dogs", "for", "which", "the", "owner", "has", "not", "spend", "more", "than", "1000", "for", "treatment", "?"], "sql": {"from": {"table_units": [["table_unit", 5]], "conds": []}, "select": [false, [[0, [0, [0, 25, false], null]]]], "where": [[true, 8, [0, [0, 20, false], null], {"from": {"table_units": [["table_unit", 7]], "conds": []}, "select": [false, [[0, [0, [0, 45, false], null]]]], "where": [], "groupBy": [[0, 45, false]], "having": [[false, 3, [0, [4, 49, false], null], 1000.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, null]], "groupBy": [], "having": [], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0943", "db_id": "dog_kennels", "query": "select t1.professional_id , t1.cell_number from professionals as t1 join treatments as t2 on t1.professional_id = t2.professional_id group by t1.professional_id having count(*) >= 2", "query_toks": ["SELECT", "T1.professional_id", ",", "T1.cell_number", "FROM", "Professionals", "AS", "T1", "JOIN", "Treatments", "AS", "T2", "ON", "T1.professional_id", "=", "T2.professional_id", "GROUP", "BY", "T1.professional_id", "HAVING", "count", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "t1", ".", "professional_id", ",", "t1", ".", "cell_number", "from", "professionals", "as", "t1", "join", "treatments", "as", "t2", "on", "t1", ".", "professional_id", "=", "t2", ".", "professional_id", "group", "by", "t1", ".", "professional_id", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "Find the id and cell phone of the professionals who operate two or more types of treatments.", "question_toks": ["Find", "the", "id", "and", "cell", "phone", "of", "the", "professionals", "who", "operate", "two", "or", "more", "types", "of", "treatments", "."], "sql": {"from": {"table_units": [["table_unit", 6], ["table_unit", 7]], "conds": [[false, 2, [0, [0, 33, false], null], [0, 46, false], null]]}, "select": [false, [[0, [0, [0, 33, false], null]], [0, [0, [0, 43, false], null]]]], "where": [], "groupBy": [[0, 33, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0241", "db_id": "flight_2", "query": "select t1.airline from airlines as t1 join flights as t2 on t1.uid = t2.airline group by t1.airline having count(*) > 10", "query_toks": ["SELECT", "T1.Airline", "FROM", "AIRLINES", "AS", "T1", "JOIN", "FLIGHTS", "AS", "T2", "ON", "T1.uid", "=", "T2.Airline", "GROUP", "BY", "T1.Airline", "HAVING", "count", "(", "*", ")", ">", "10"], "query_toks_no_value": ["select", "t1", ".", "airline", "from", "airlines", "as", "t1", "join", "flights", "as", "t2", "on", "t1", ".", "uid", "=", "t2", ".", "airline", "group", "by", "t1", ".", "airline", "having", "count", "(", "*", ")", ">", "value"], "question": "Find all airlines that have at least 10 flights.", "question_toks": ["Find", "all", "airlines", "that", "have", "at", "least", "10", "flights", "."], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 10, false], null]]}, "select": [false, [[0, [0, [0, 2, false], null]]]], "where": [], "groupBy": [[0, 2, false]], "having": [[false, 3, [0, [3, 0, false], null], 10.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0419", "db_id": "museum_visit", "query": "select t1.id , t1.name , t1.age from visitor as t1 join visit as t2 on t1.id = t2.visitor_id group by t1.id having count(*) > 1", "query_toks": ["SELECT", "t1.id", ",", "t1.name", ",", "t1.age", "FROM", "visitor", "AS", "t1", "JOIN", "visit", "AS", "t2", "ON", "t1.id", "=", "t2.visitor_id", "GROUP", "BY", "t1.id", "HAVING", "count", "(", "*", ")", ">", "1"], "query_toks_no_value": ["select", "t1", ".", "id", ",", "t1", ".", "name", ",", "t1", ".", "age", "from", "visitor", "as", "t1", "join", "visit", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "visitor_id", "group", "by", "t1", ".", "id", "having", "count", "(", "*", ")", ">", "value"], "question": "find the id, name and age for visitors who visited some museums more than once.", "question_toks": ["find", "the", "id", ",", "name", "and", "age", "for", "visitors", "who", "visited", "some", "museums", "more", "than", "once", "."], "sql": {"from": {"table_units": [["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 5, false], null], [0, 10, false], null]]}, "select": [false, [[0, [0, [0, 5, false], null]], [0, [0, [0, 6, false], null]], [0, [0, [0, 8, false], null]]]], "where": [], "groupBy": [[0, 5, false]], "having": [[false, 3, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0880", "db_id": "network_1", "query": "select grade from highschooler group by grade having count(*) >= 4", "query_toks": ["SELECT", "grade", "FROM", "Highschooler", "GROUP", "BY", "grade", "HAVING", "count", "(", "*", ")", ">", "=", "4"], "query_toks_no_value": ["select", "grade", "from", "highschooler", "group", "by", "grade", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "Show me all grades that have at least 4 students.", "question_toks": ["Show", "me", "all", "grades", "that", "have", "at", "least", "4", "students", "."], "sql": {"from": {"table_units": [["table_unit", 0]], "conds": []}, "select": [false, [[0, [0, [0, 3, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 5, [0, [3, 0, false], null], 4.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0081", "db_id": "pets_1", "query": "select t1.fname , t1.sex from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid having count(*) > 1", "query_toks": ["SELECT", "T1.fname", ",", "T1.sex", "FROM", "student", "AS", "T1", "JOIN", "has_pet", "AS", "T2", "ON", "T1.stuid", "=", "T2.stuid", "GROUP", "BY", "T1.stuid", "HAVING", "count", "(", "*", ")", ">", "1"], "query_toks_no_value": ["select", "t1", ".", "fname", ",", "t1", ".", "sex", "from", "student", "as", "t1", "join", "has_pet", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "group", "by", "t1", ".", "stuid", "having", "count", "(", "*", ")", ">", "value"], "question": "Find the first name and gender of student who have more than one pet.", "question_toks": ["Find", "the", "first", "name", "and", "gender", "of", "student", "who", "have", "more", "than", "one", "pet", "."], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 9, false], null]]}, "select": [false, [[0, [0, [0, 3, false], null]], [0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 3, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0082", "db_id": "pets_1", "query": "select t1.fname , t1.sex from student as t1 join has_pet as t2 on t1.stuid = t2.stuid group by t1.stuid having count(*) > 1", "query_toks": ["SELECT", "T1.fname", ",", "T1.sex", "FROM", "student", "AS", "T1", "JOIN", "has_pet", "AS", "T2", "ON", "T1.stuid", "=", "T2.stuid", "GROUP", "BY", "T1.stuid", "HAVING", "count", "(", "*", ")", ">", "1"], "query_toks_no_value": ["select", "t1", ".", "fname", ",", "t1", ".", "sex", "from", "student", "as", "t1", "join", "has_pet", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "group", "by", "t1", ".", "stuid", "having", "count", "(", "*", ")", ">", "value"], "question": "What is the first name and gender of the all the students who have more than one pet?", "question_toks": ["What", "is", "the", "first", "name", "and", "gender", "of", "the", "all", "the", "students", "who", "have", "more", "than", "one", "pet", "?"], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 9, false], null]]}, "select": [false, [[0, [0, [0, 3, false], null]], [0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 3, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0677", "db_id": "poker_player", "query": "select nationality from people group by nationality having count(*) >= 2", "query_toks": ["SELECT", "Nationality", "FROM", "people", "GROUP", "BY", "Nationality", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "nationality", "from", "people", "group", "by", "nationality", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the nationalities that are shared by at least two people?", "question_toks": ["What", "are", "the", "nationalities", "that", "are", "shared", "by", "at", "least", "two", "people", "?"], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 8, false], null]]]], "where": [], "groupBy": [[0, 8, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0678", "db_id": "poker_player", "query": "select nationality from people group by nationality having count(*) >= 2", "query_toks": ["SELECT", "Nationality", "FROM", "people", "GROUP", "BY", "Nationality", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "nationality", "from", "people", "group", "by", "nationality", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "Return the nationalities for which there are two or more people.", "question_toks": ["Return", "the", "nationalities", "for", "which", "there", "are", "two", "or", "more", "people", "."], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 8, false], null]]]], "where": [], "groupBy": [[0, 8, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0641", "db_id": "tvshow", "query": "select id from tv_channel group by country having count(*) > 2", "query_toks": ["SELECT", "id", "FROM", "tv_channel", "GROUP", "BY", "country", "HAVING", "count", "(", "*", ")", ">", "2"], "query_toks_no_value": ["select", "id", "from", "tv_channel", "group", "by", "country", "having", "count", "(", "*", ")", ">", "value"], "question": "find id of the tv channels that from the countries where have more than two tv channels.", "question_toks": ["find", "id", "of", "the", "tv", "channels", "that", "from", "the", "countries", "where", "have", "more", "than", "two", "tv", "channels", "."], "sql": {"from": {"table_units": [["table_unit", 0]], "conds": []}, "select": [false, [[0, [0, [0, 1, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 3, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0642", "db_id": "tvshow", "query": "select id from tv_channel group by country having count(*) > 2", "query_toks": ["SELECT", "id", "FROM", "tv_channel", "GROUP", "BY", "country", "HAVING", "count", "(", "*", ")", ">", "2"], "query_toks_no_value": ["select", "id", "from", "tv_channel", "group", "by", "country", "having", "count", "(", "*", ")", ">", "value"], "question": "What are the ids of all tv channels that have more than 2 TV channels?", "question_toks": ["What", "are", "the", "ids", "of", "all", "tv", "channels", "that", "have", "more", "than", "2", "TV", "channels", "?"], "sql": {"from": {"table_units": [["table_unit", 0]], "conds": []}, "select": [false, [[0, [0, [0, 1, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 3, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0445", "db_id": "wta_1", "query": "select tourney_name from matches group by tourney_name having count(*) > 10", "query_toks": ["SELECT", "tourney_name", "FROM", "matches", "GROUP", "BY", "tourney_name", "HAVING", "count", "(", "*", ")", ">", "10"], "query_toks_no_value": ["select", "tourney_name", "from", "matches", "group", "by", "tourney_name", "having", "count", "(", "*", ")", ">", "value"], "question": "Find the name of tourney that has more than 10 matches.", "question_toks": ["Find", "the", "name", "of", "tourney", "that", "has", "more", "than", "10", "matches", "."], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 27, false], null]]]], "where": [], "groupBy": [[0, 27, false]], "having": [[false, 3, [0, [3, 0, false], null], 10.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0446", "db_id": "wta_1", "query": "select tourney_name from matches group by tourney_name having count(*) > 10", "query_toks": ["SELECT", "tourney_name", "FROM", "matches", "GROUP", "BY", "tourney_name", "HAVING", "count", "(", "*", ")", ">", "10"], "query_toks_no_value": ["select", "tourney_name", "from", "matches", "group", "by", "tourney_name", "having", "count", "(", "*", ")", ">", "value"], "question": "What are the names of tournaments that have more than 10 matches?", "question_toks": ["What", "are", "the", "names", "of", "tournaments", "that", "have", "more", "than", "10", "matches", "?"], "sql": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 27, false], null]]]], "where": [], "groupBy": [[0, 27, false]], "having": [[false, 3, [0, [3, 0, false], null], 10.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0477", "db_id": "wta_1", "query": "select country_code from players group by country_code having count(*) > 50", "query_toks": ["SELECT", "country_code", "FROM", "players", "GROUP", "BY", "country_code", "HAVING", "count", "(", "*", ")", ">", "50"], "query_toks_no_value": ["select", "country_code", "from", "players", "group", "by", "country_code", "having", "count", "(", "*", ")", ">", "value"], "question": "Find the codes of countries that have more than 50 players.", "question_toks": ["Find", "the", "codes", "of", "countries", "that", "have", "more", "than", "50", "players", "."], "sql": {"from": {"table_units": [["table_unit", 0]], "conds": []}, "select": [false, [[0, [0, [0, 6, false], null]]]], "where": [], "groupBy": [[0, 6, false]], "having": [[false, 3, [0, [3, 0, false], null], 50.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "dev_0478", "db_id": "wta_1", "query": "select country_code from players group by country_code having count(*) > 50", "query_toks": ["SELECT", "country_code", "FROM", "players", "GROUP", "BY", "country_code", "HAVING", "count", "(", "*", ")", ">", "50"], "query_toks_no_value": ["select", "country_code", "from", "players", "group", "by", "country_code", "having", "count", "(", "*", ")", ">", "value"], "question": "What are the codes of countries with more than 50 players?", "question_toks": ["What", "are", "the", "codes", "of", "countries", "with", "more", "than", "50", "players", "?"], "sql": {"from": {"table_units": [["table_unit", 0]], "conds": []}, "select": [false, [[0, [0, [0, 6, false], null]]]], "where": [], "groupBy": [[0, 6, false]], "having": [[false, 3, [0, [3, 0, false], null], 50.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_DEV", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_4829", "db_id": "aircraft", "query": "select t1.aircraft from aircraft as t1 join match as t2 on t1.aircraft_id = t2.winning_aircraft group by t2.winning_aircraft having count(*) >= 2", "query_toks": ["SELECT", "T1.Aircraft", "FROM", "aircraft", "AS", "T1", "JOIN", "MATCH", "AS", "T2", "ON", "T1.Aircraft_ID", "=", "T2.Winning_Aircraft", "GROUP", "BY", "T2.Winning_Aircraft", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "t1", ".", "aircraft", "from", "aircraft", "as", "t1", "join", "match", "as", "t2", "on", "t1", ".", "aircraft_id", "=", "t2", ".", "winning_aircraft", "group", "by", "t2", ".", "winning_aircraft", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "List the names of aircrafts and that won matches at least twice.", "question_toks": ["List", "the", "names", "of", "aircrafts", "and", "that", "won", "matches", "at", "least", "twice", "."], "sql": {"from": {"table_units": [["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 4, false], null], [0, 16, false], null]]}, "select": [false, [[0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 16, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_4830", "db_id": "aircraft", "query": "select t1.aircraft from aircraft as t1 join match as t2 on t1.aircraft_id = t2.winning_aircraft group by t2.winning_aircraft having count(*) >= 2", "query_toks": ["SELECT", "T1.Aircraft", "FROM", "aircraft", "AS", "T1", "JOIN", "MATCH", "AS", "T2", "ON", "T1.Aircraft_ID", "=", "T2.Winning_Aircraft", "GROUP", "BY", "T2.Winning_Aircraft", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2"], "query_toks_no_value": ["select", "t1", ".", "aircraft", "from", "aircraft", "as", "t1", "join", "match", "as", "t2", "on", "t1", ".", "aircraft_id", "=", "t2", ".", "winning_aircraft", "group", "by", "t2", ".", "winning_aircraft", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the names of all aircrafts that have won a match at least twice?", "question_toks": ["What", "are", "the", "names", "of", "all", "aircrafts", "that", "have", "won", "a", "match", "at", "least", "twice", "?"], "sql": {"from": {"table_units": [["table_unit", 1], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 4, false], null], [0, 16, false], null]]}, "select": [false, [[0, [0, [0, 5, false], null]]]], "where": [], "groupBy": [[0, 16, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_0505", "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": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 3, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_0506", "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": {"from": {"table_units": [["table_unit", 1]], "conds": []}, "select": [false, [[0, [0, [0, 3, false], null]]]], "where": [], "groupBy": [[0, 3, false]], "having": [[false, 5, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_6953", "db_id": "architecture", "query": "select t1.id , t1.name from architect as t1 join bridge as t2 on t1.id = t2.architect_id group by t1.id having count(*) >= 3", "query_toks": ["SELECT", "T1.id", ",", "T1.name", "FROM", "architect", "AS", "T1", "JOIN", "bridge", "AS", "T2", "ON", "T1.id", "=", "T2.architect_id", "GROUP", "BY", "T1.id", "HAVING", "count", "(", "*", ")", ">", "=", "3"], "query_toks_no_value": ["select", "t1", ".", "id", ",", "t1", ".", "name", "from", "architect", "as", "t1", "join", "bridge", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "architect_id", "group", "by", "t1", ".", "id", "having", "count", "(", "*", ")", ">", "=", "value"], "question": "What are the ids and names of the architects who built at least 3 bridges ?", "question_toks": ["What", "are", "the", "ids", "and", "names", "of", "the", "architects", "who", "built", "at", "least", "3", "bridges", "?"], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 5, false], null]]}, "select": [false, [[0, [0, [0, 1, false], null]], [0, [0, [0, 2, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 5, [0, [3, 0, false], null], 3.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}, {"id": "train_6955", "db_id": "architecture", "query": "select t1.id , t1.name , t1.gender from architect as t1 join bridge as t2 on t1.id = t2.architect_id group by t1.id having count(*) = 2 union select t1.id , t1.name , t1.gender from architect as t1 join mill as t2 on t1.id = t2.architect_id group by t1.id having count(*) = 1", "query_toks": ["SELECT", "T1.id", ",", "T1.name", ",", "T1.gender", "FROM", "architect", "AS", "T1", "JOIN", "bridge", "AS", "T2", "ON", "T1.id", "=", "T2.architect_id", "GROUP", "BY", "T1.id", "HAVING", "count", "(", "*", ")", "=", "2", "UNION", "SELECT", "T1.id", ",", "T1.name", ",", "T1.gender", "FROM", "architect", "AS", "T1", "JOIN", "mill", "AS", "T2", "ON", "T1.id", "=", "T2.architect_id", "GROUP", "BY", "T1.id", "HAVING", "count", "(", "*", ")", "=", "1"], "query_toks_no_value": ["select", "t1", ".", "id", ",", "t1", ".", "name", ",", "t1", ".", "gender", "from", "architect", "as", "t1", "join", "bridge", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "architect_id", "group", "by", "t1", ".", "id", "having", "count", "(", "*", ")", "=", "value", "union", "select", "t1", ".", "id", ",", "t1", ".", "name", ",", "t1", ".", "gender", "from", "architect", "as", "t1", "join", "mill", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "architect_id", "group", "by", "t1", ".", "id", "having", "count", "(", "*", ")", "=", "value"], "question": "What are the ids, names and genders of the architects who built two bridges or one mill?", "question_toks": ["What", "are", "the", "ids", ",", "names", "and", "genders", "of", "the", "architects", "who", "built", "two", "bridges", "or", "one", "mill", "?"], "sql": {"from": {"table_units": [["table_unit", 0], ["table_unit", 1]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 11, false], null]]}, "select": [false, [[0, [0, [0, 1, false], null]], [0, [0, [0, 2, false], null]], [0, [0, [0, 4, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 2, [0, [3, 0, false], null], 2.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": {"from": {"table_units": [["table_unit", 0], ["table_unit", 2]], "conds": [[false, 2, [0, [0, 1, false], null], [0, 11, false], null]]}, "select": [false, [[0, [0, [0, 1, false], null]], [0, [0, [0, 2, false], null]], [0, [0, [0, 4, false], null]]]], "where": [], "groupBy": [[0, 1, false]], "having": [[false, 2, [0, [3, 0, false], null], 1.0, null]], "orderBy": [], "limit": null, "intersect": null, "union": null, "except": null}, "except": null}, "tags": ["HAVING_IN_SQL"], "source": "SPIDER_TRAIN", "parents_id": null, "is_simplification": false, "simplifications_tags": []}] |