db_id
stringclasses
140 values
schema
listlengths
0
26
question
stringlengths
16
224
query
stringlengths
18
577
query_toks
listlengths
4
90
query_toks_no_value
listlengths
4
125
question_toks
listlengths
4
44
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
List the names of all left-footed players who have overall rating between 85 and 90.
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90
[ "SELECT", "DISTINCT", "T1.player_name", "FROM", "Player", "AS", "T1", "JOIN", "Player_Attributes", "AS", "T2", "ON", "T1.player_api_id", "=", "T2.player_api_id", "WHERE", "T2.preferred_foot", "=", "``", "left", "''", "AND", "T2.overall_rating", ">", "=", "85", "AND", "T2.overall_rating", "<", "=", "90" ]
[ "select", "distinct", "t1", ".", "player_name", "from", "player", "as", "t1", "join", "player_attributes", "as", "t2", "on", "t1", ".", "player_api_id", "=", "t2", ".", "player_api_id", "where", "t2", ".", "preferred_foot", "=", "value", "and", "t2", ".", "overall_rating", ">", "=", "value", "and", "t2", ".", "overall_rating", "<", "=", "value" ]
[ "List", "the", "names", "of", "all", "left-footed", "players", "who", "have", "overall", "rating", "between", "85", "and", "90", "." ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
What is the average rating for right-footed players and left-footed players?
SELECT preferred_foot , avg(overall_rating) FROM Player_Attributes GROUP BY preferred_foot
[ "SELECT", "preferred_foot", ",", "avg", "(", "overall_rating", ")", "FROM", "Player_Attributes", "GROUP", "BY", "preferred_foot" ]
[ "select", "preferred_foot", ",", "avg", "(", "overall_rating", ")", "from", "player_attributes", "group", "by", "preferred_foot" ]
[ "What", "is", "the", "average", "rating", "for", "right-footed", "players", "and", "left-footed", "players", "?" ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot
[ "SELECT", "preferred_foot", ",", "count", "(", "*", ")", "FROM", "Player_Attributes", "WHERE", "overall_rating", ">", "80", "GROUP", "BY", "preferred_foot" ]
[ "select", "preferred_foot", ",", "count", "(", "*", ")", "from", "player_attributes", "where", "overall_rating", ">", "value", "group", "by", "preferred_foot" ]
[ "Of", "all", "players", "with", "an", "overall", "rating", "greater", "than", "80", ",", "how", "many", "are", "right-footed", "and", "left-footed", "?" ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
List all of the player ids with a height of at least 180cm and an overall rating higher than 85.
SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85
[ "SELECT", "player_api_id", "FROM", "Player", "WHERE", "height", ">", "=", "180", "INTERSECT", "SELECT", "player_api_id", "FROM", "Player_Attributes", "WHERE", "overall_rating", ">", "85" ]
[ "select", "player_api_id", "from", "player", "where", "height", ">", "=", "value", "intersect", "select", "player_api_id", "from", "player_attributes", "where", "overall_rating", ">", "value" ]
[ "List", "all", "of", "the", "player", "ids", "with", "a", "height", "of", "at", "least", "180cm", "and", "an", "overall", "rating", "higher", "than", "85", "." ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
List all of the ids for left-footed players with a height between 180cm and 190cm.
SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left"
[ "SELECT", "player_api_id", "FROM", "Player", "WHERE", "height", ">", "=", "180", "AND", "height", "<", "=", "190", "INTERSECT", "SELECT", "player_api_id", "FROM", "Player_Attributes", "WHERE", "preferred_foot", "=", "``", "left", "''" ]
[ "select", "player_api_id", "from", "player", "where", "height", ">", "=", "value", "and", "height", "<", "=", "value", "intersect", "select", "player_api_id", "from", "player_attributes", "where", "preferred_foot", "=", "value" ]
[ "List", "all", "of", "the", "ids", "for", "left-footed", "players", "with", "a", "height", "between", "180cm", "and", "190cm", "." ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
Who are the top 3 players in terms of overall rating?
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3
[ "SELECT", "DISTINCT", "T1.player_name", "FROM", "Player", "AS", "T1", "JOIN", "Player_Attributes", "AS", "T2", "ON", "T1.player_api_id", "=", "T2.player_api_id", "ORDER", "BY", "overall_rating", "DESC", "LIMIT", "3" ]
[ "select", "distinct", "t1", ".", "player_name", "from", "player", "as", "t1", "join", "player_attributes", "as", "t2", "on", "t1", ".", "player_api_id", "=", "t2", ".", "player_api_id", "order", "by", "overall_rating", "desc", "limit", "value" ]
[ "Who", "are", "the", "top", "3", "players", "in", "terms", "of", "overall", "rating", "?" ]
soccer_1
[ "CREATE TABLE \"Player_Attributes\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_fifa_api_id`\tINTEGER,\n\t`player_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`overall_rating`\tINTEGER,\n\t`potential`\tINTEGER,\n\t`preferred_foot`\tTEXT,\n\t`attacking_work_rate`\tTEXT,\n\t`defensive_work_rate`\tTEXT,\n\t`crossing`\tINTEGER,\n\t`finishing`\tINTEGER,\n\t`heading_accuracy`\tINTEGER,\n\t`short_passing`\tINTEGER,\n\t`volleys`\tINTEGER,\n\t`dribbling`\tINTEGER,\n\t`curve`\tINTEGER,\n\t`free_kick_accuracy`\tINTEGER,\n\t`long_passing`\tINTEGER,\n\t`ball_control`\tINTEGER,\n\t`acceleration`\tINTEGER,\n\t`sprint_speed`\tINTEGER,\n\t`agility`\tINTEGER,\n\t`reactions`\tINTEGER,\n\t`balance`\tINTEGER,\n\t`shot_power`\tINTEGER,\n\t`jumping`\tINTEGER,\n\t`stamina`\tINTEGER,\n\t`strength`\tINTEGER,\n\t`long_shots`\tINTEGER,\n\t`aggression`\tINTEGER,\n\t`interceptions`\tINTEGER,\n\t`positioning`\tINTEGER,\n\t`vision`\tINTEGER,\n\t`penalties`\tINTEGER,\n\t`marking`\tINTEGER,\n\t`standing_tackle`\tINTEGER,\n\t`sliding_tackle`\tINTEGER,\n\t`gk_diving`\tINTEGER,\n\t`gk_handling`\tINTEGER,\n\t`gk_kicking`\tINTEGER,\n\t`gk_positioning`\tINTEGER,\n\t`gk_reflexes`\tINTEGER,\n\tFOREIGN KEY(`player_fifa_api_id`) REFERENCES `Player`(`player_fifa_api_id`),\n\tFOREIGN KEY(`player_api_id`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `Player` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`player_api_id`\tINTEGER UNIQUE,\n\t`player_name`\tTEXT,\n\t`player_fifa_api_id`\tINTEGER UNIQUE,\n\t`birthday`\tTEXT,\n\t`height`\tINTEGER,\n\t`weight`\tINTEGER\n);", "CREATE TABLE `Match` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`league_id`\tINTEGER,\n\t`season`\tTEXT,\n\t`stage`\tINTEGER,\n\t`date`\tTEXT,\n\t`match_api_id`\tINTEGER UNIQUE,\n\t`home_team_api_id`\tINTEGER,\n\t`away_team_api_id`\tINTEGER,\n\t`home_team_goal`\tINTEGER,\n\t`away_team_goal`\tINTEGER,\n\t`home_player_X1`\tINTEGER,\n\t`home_player_X2`\tINTEGER,\n\t`home_player_X3`\tINTEGER,\n\t`home_player_X4`\tINTEGER,\n\t`home_player_X5`\tINTEGER,\n\t`home_player_X6`\tINTEGER,\n\t`home_player_X7`\tINTEGER,\n\t`home_player_X8`\tINTEGER,\n\t`home_player_X9`\tINTEGER,\n\t`home_player_X10`\tINTEGER,\n\t`home_player_X11`\tINTEGER,\n\t`away_player_X1`\tINTEGER,\n\t`away_player_X2`\tINTEGER,\n\t`away_player_X3`\tINTEGER,\n\t`away_player_X4`\tINTEGER,\n\t`away_player_X5`\tINTEGER,\n\t`away_player_X6`\tINTEGER,\n\t`away_player_X7`\tINTEGER,\n\t`away_player_X8`\tINTEGER,\n\t`away_player_X9`\tINTEGER,\n\t`away_player_X10`\tINTEGER,\n\t`away_player_X11`\tINTEGER,\n\t`home_player_Y1`\tINTEGER,\n\t`home_player_Y2`\tINTEGER,\n\t`home_player_Y3`\tINTEGER,\n\t`home_player_Y4`\tINTEGER,\n\t`home_player_Y5`\tINTEGER,\n\t`home_player_Y6`\tINTEGER,\n\t`home_player_Y7`\tINTEGER,\n\t`home_player_Y8`\tINTEGER,\n\t`home_player_Y9`\tINTEGER,\n\t`home_player_Y10`\tINTEGER,\n\t`home_player_Y11`\tINTEGER,\n\t`away_player_Y1`\tINTEGER,\n\t`away_player_Y2`\tINTEGER,\n\t`away_player_Y3`\tINTEGER,\n\t`away_player_Y4`\tINTEGER,\n\t`away_player_Y5`\tINTEGER,\n\t`away_player_Y6`\tINTEGER,\n\t`away_player_Y7`\tINTEGER,\n\t`away_player_Y8`\tINTEGER,\n\t`away_player_Y9`\tINTEGER,\n\t`away_player_Y10`\tINTEGER,\n\t`away_player_Y11`\tINTEGER,\n\t`home_player_1`\tINTEGER,\n\t`home_player_2`\tINTEGER,\n\t`home_player_3`\tINTEGER,\n\t`home_player_4`\tINTEGER,\n\t`home_player_5`\tINTEGER,\n\t`home_player_6`\tINTEGER,\n\t`home_player_7`\tINTEGER,\n\t`home_player_8`\tINTEGER,\n\t`home_player_9`\tINTEGER,\n\t`home_player_10`\tINTEGER,\n\t`home_player_11`\tINTEGER,\n\t`away_player_1`\tINTEGER,\n\t`away_player_2`\tINTEGER,\n\t`away_player_3`\tINTEGER,\n\t`away_player_4`\tINTEGER,\n\t`away_player_5`\tINTEGER,\n\t`away_player_6`\tINTEGER,\n\t`away_player_7`\tINTEGER,\n\t`away_player_8`\tINTEGER,\n\t`away_player_9`\tINTEGER,\n\t`away_player_10`\tINTEGER,\n\t`away_player_11`\tINTEGER,\n\t`goal`\tTEXT,\n\t`shoton`\tTEXT,\n\t`shotoff`\tTEXT,\n\t`foulcommit`\tTEXT,\n\t`card`\tTEXT,\n\t`cross`\tTEXT,\n\t`corner`\tTEXT,\n\t`possession`\tTEXT,\n\t`B365H`\tNUMERIC,\n\t`B365D`\tNUMERIC,\n\t`B365A`\tNUMERIC,\n\t`BWH`\tNUMERIC,\n\t`BWD`\tNUMERIC,\n\t`BWA`\tNUMERIC,\n\t`IWH`\tNUMERIC,\n\t`IWD`\tNUMERIC,\n\t`IWA`\tNUMERIC,\n\t`LBH`\tNUMERIC,\n\t`LBD`\tNUMERIC,\n\t`LBA`\tNUMERIC,\n\t`PSH`\tNUMERIC,\n\t`PSD`\tNUMERIC,\n\t`PSA`\tNUMERIC,\n\t`WHH`\tNUMERIC,\n\t`WHD`\tNUMERIC,\n\t`WHA`\tNUMERIC,\n\t`SJH`\tNUMERIC,\n\t`SJD`\tNUMERIC,\n\t`SJA`\tNUMERIC,\n\t`VCH`\tNUMERIC,\n\t`VCD`\tNUMERIC,\n\t`VCA`\tNUMERIC,\n\t`GBH`\tNUMERIC,\n\t`GBD`\tNUMERIC,\n\t`GBA`\tNUMERIC,\n\t`BSH`\tNUMERIC,\n\t`BSD`\tNUMERIC,\n\t`BSA`\tNUMERIC,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`),\n\tFOREIGN KEY(`league_id`) REFERENCES `League`(`id`),\n\tFOREIGN KEY(`home_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`away_team_api_id`) REFERENCES `Team`(`team_api_id`),\n\tFOREIGN KEY(`home_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`home_player_11`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_1`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_2`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_3`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_4`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_5`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_6`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_7`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_8`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_9`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_10`) REFERENCES `Player`(`player_api_id`),\n\tFOREIGN KEY(`away_player_11`) REFERENCES `Player`(`player_api_id`)\n);", "CREATE TABLE `League` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`country_id`\tINTEGER,\n\t`name`\tTEXT UNIQUE,\n\tFOREIGN KEY(`country_id`) REFERENCES `Country`(`id`)\n);", "CREATE TABLE `Country` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`name`\tTEXT UNIQUE\n);", "CREATE TABLE \"Team\" (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_api_id`\tINTEGER UNIQUE,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_long_name`\tTEXT,\n\t`team_short_name`\tTEXT\n);", "CREATE TABLE `Team_Attributes` (\n\t`id`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`team_fifa_api_id`\tINTEGER,\n\t`team_api_id`\tINTEGER,\n\t`date`\tTEXT,\n\t`buildUpPlaySpeed`\tINTEGER,\n\t`buildUpPlaySpeedClass`\tTEXT,\n\t`buildUpPlayDribbling`\tINTEGER,\n\t`buildUpPlayDribblingClass`\tTEXT,\n\t`buildUpPlayPassing`\tINTEGER,\n\t`buildUpPlayPassingClass`\tTEXT,\n\t`buildUpPlayPositioningClass`\tTEXT,\n\t`chanceCreationPassing`\tINTEGER,\n\t`chanceCreationPassingClass`\tTEXT,\n\t`chanceCreationCrossing`\tINTEGER,\n\t`chanceCreationCrossingClass`\tTEXT,\n\t`chanceCreationShooting`\tINTEGER,\n\t`chanceCreationShootingClass`\tTEXT,\n\t`chanceCreationPositioningClass`\tTEXT,\n\t`defencePressure`\tINTEGER,\n\t`defencePressureClass`\tTEXT,\n\t`defenceAggression`\tINTEGER,\n\t`defenceAggressionClass`\tTEXT,\n\t`defenceTeamWidth`\tINTEGER,\n\t`defenceTeamWidthClass`\tTEXT,\n\t`defenceDefenderLineClass`\tTEXT,\n\tFOREIGN KEY(`team_fifa_api_id`) REFERENCES `Team`(`team_fifa_api_id`),\n\tFOREIGN KEY(`team_api_id`) REFERENCES `Team`(`team_api_id`)\n);" ]
List the names and birthdays of the top five players in terms of potential.
SELECT DISTINCT T1.player_name , T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5
[ "SELECT", "DISTINCT", "T1.player_name", ",", "T1.birthday", "FROM", "Player", "AS", "T1", "JOIN", "Player_Attributes", "AS", "T2", "ON", "T1.player_api_id", "=", "T2.player_api_id", "ORDER", "BY", "potential", "DESC", "LIMIT", "5" ]
[ "select", "distinct", "t1", ".", "player_name", ",", "t1", ".", "birthday", "from", "player", "as", "t1", "join", "player_attributes", "as", "t2", "on", "t1", ".", "player_api_id", "=", "t2", ".", "player_api_id", "order", "by", "potential", "desc", "limit", "value" ]
[ "List", "the", "names", "and", "birthdays", "of", "the", "top", "five", "players", "in", "terms", "of", "potential", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
How many performances are there?
SELECT count(*) FROM performance
[ "SELECT", "count", "(", "*", ")", "FROM", "performance" ]
[ "select", "count", "(", "*", ")", "from", "performance" ]
[ "How", "many", "performances", "are", "there", "?" ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
List the hosts of performances in ascending order of attendance.
SELECT HOST FROM performance ORDER BY Attendance ASC
[ "SELECT", "HOST", "FROM", "performance", "ORDER", "BY", "Attendance", "ASC" ]
[ "select", "host", "from", "performance", "order", "by", "attendance", "asc" ]
[ "List", "the", "hosts", "of", "performances", "in", "ascending", "order", "of", "attendance", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
What are the dates and locations of performances?
SELECT Date , LOCATION FROM performance
[ "SELECT", "Date", ",", "LOCATION", "FROM", "performance" ]
[ "select", "date", ",", "location", "from", "performance" ]
[ "What", "are", "the", "dates", "and", "locations", "of", "performances", "?" ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the attendances of the performances at location "TD Garden" or "Bell Centre"
SELECT Attendance FROM performance WHERE LOCATION = "TD Garden" OR LOCATION = "Bell Centre"
[ "SELECT", "Attendance", "FROM", "performance", "WHERE", "LOCATION", "=", "``", "TD", "Garden", "''", "OR", "LOCATION", "=", "``", "Bell", "Centre", "''" ]
[ "select", "attendance", "from", "performance", "where", "location", "=", "value", "or", "location", "=", "value" ]
[ "Show", "the", "attendances", "of", "the", "performances", "at", "location", "``", "TD", "Garden", "''", "or", "``", "Bell", "Centre", "''" ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
What is the average number of attendees for performances?
SELECT avg(Attendance) FROM performance
[ "SELECT", "avg", "(", "Attendance", ")", "FROM", "performance" ]
[ "select", "avg", "(", "attendance", ")", "from", "performance" ]
[ "What", "is", "the", "average", "number", "of", "attendees", "for", "performances", "?" ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
What is the date of the performance with the highest number of attendees?
SELECT Date FROM performance ORDER BY Attendance DESC LIMIT 1
[ "SELECT", "Date", "FROM", "performance", "ORDER", "BY", "Attendance", "DESC", "LIMIT", "1" ]
[ "select", "date", "from", "performance", "order", "by", "attendance", "desc", "limit", "value" ]
[ "What", "is", "the", "date", "of", "the", "performance", "with", "the", "highest", "number", "of", "attendees", "?" ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show different locations and the number of performances at each location.
SELECT LOCATION , COUNT(*) FROM performance GROUP BY LOCATION
[ "SELECT", "LOCATION", ",", "COUNT", "(", "*", ")", "FROM", "performance", "GROUP", "BY", "LOCATION" ]
[ "select", "location", ",", "count", "(", "*", ")", "from", "performance", "group", "by", "location" ]
[ "Show", "different", "locations", "and", "the", "number", "of", "performances", "at", "each", "location", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the most common location of performances.
SELECT LOCATION FROM performance GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "LOCATION", "FROM", "performance", "GROUP", "BY", "LOCATION", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "location", "from", "performance", "group", "by", "location", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "most", "common", "location", "of", "performances", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the locations that have at least two performances.
SELECT LOCATION FROM performance GROUP BY LOCATION HAVING COUNT(*) >= 2
[ "SELECT", "LOCATION", "FROM", "performance", "GROUP", "BY", "LOCATION", "HAVING", "COUNT", "(", "*", ")", ">", "=", "2" ]
[ "select", "location", "from", "performance", "group", "by", "location", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "the", "locations", "that", "have", "at", "least", "two", "performances", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.
SELECT LOCATION FROM performance WHERE Attendance > 2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance < 1000
[ "SELECT", "LOCATION", "FROM", "performance", "WHERE", "Attendance", ">", "2000", "INTERSECT", "SELECT", "LOCATION", "FROM", "performance", "WHERE", "Attendance", "<", "1000" ]
[ "select", "location", "from", "performance", "where", "attendance", ">", "value", "intersect", "select", "location", "from", "performance", "where", "attendance", "<", "value" ]
[ "Show", "the", "locations", "that", "have", "both", "performances", "with", "more", "than", "2000", "attendees", "and", "performances", "with", "less", "than", "1000", "attendees", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the names of members and the location of the performances they attended.
SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID
[ "SELECT", "T2.Name", ",", "T3.Location", "FROM", "member_attendance", "AS", "T1", "JOIN", "member", "AS", "T2", "ON", "T1.Member_ID", "=", "T2.Member_ID", "JOIN", "performance", "AS", "T3", "ON", "T1.Performance_ID", "=", "T3.Performance_ID" ]
[ "select", "t2", ".", "name", ",", "t3", ".", "location", "from", "member_attendance", "as", "t1", "join", "member", "as", "t2", "on", "t1", ".", "member_id", "=", "t2", ".", "member_id", "join", "performance", "as", "t3", "on", "t1", ".", "performance_id", "=", "t3", ".", "performance_id" ]
[ "Show", "the", "names", "of", "members", "and", "the", "location", "of", "the", "performances", "they", "attended", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name ASC
[ "SELECT", "T2.Name", ",", "T3.Location", "FROM", "member_attendance", "AS", "T1", "JOIN", "member", "AS", "T2", "ON", "T1.Member_ID", "=", "T2.Member_ID", "JOIN", "performance", "AS", "T3", "ON", "T1.Performance_ID", "=", "T3.Performance_ID", "ORDER", "BY", "T2.Name", "ASC" ]
[ "select", "t2", ".", "name", ",", "t3", ".", "location", "from", "member_attendance", "as", "t1", "join", "member", "as", "t2", "on", "t1", ".", "member_id", "=", "t2", ".", "member_id", "join", "performance", "as", "t3", "on", "t1", ".", "performance_id", "=", "t3", ".", "performance_id", "order", "by", "t2", ".", "name", "asc" ]
[ "Show", "the", "names", "of", "members", "and", "the", "location", "of", "performances", "they", "attended", "in", "ascending", "alphabetical", "order", "of", "their", "names", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the dates of performances with attending members whose roles are "Violin".
SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin"
[ "SELECT", "T3.Date", "FROM", "member_attendance", "AS", "T1", "JOIN", "member", "AS", "T2", "ON", "T1.Member_ID", "=", "T2.Member_ID", "JOIN", "performance", "AS", "T3", "ON", "T1.Performance_ID", "=", "T3.Performance_ID", "WHERE", "T2.Role", "=", "``", "Violin", "''" ]
[ "select", "t3", ".", "date", "from", "member_attendance", "as", "t1", "join", "member", "as", "t2", "on", "t1", ".", "member_id", "=", "t2", ".", "member_id", "join", "performance", "as", "t3", "on", "t1", ".", "performance_id", "=", "t3", ".", "performance_id", "where", "t2", ".", "role", "=", "value" ]
[ "Show", "the", "dates", "of", "performances", "with", "attending", "members", "whose", "roles", "are", "``", "Violin", "''", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
Show the names of members and the dates of performances they attended in descending order of attendance of the performances.
SELECT T2.Name , T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T3.Attendance DESC
[ "SELECT", "T2.Name", ",", "T3.Date", "FROM", "member_attendance", "AS", "T1", "JOIN", "member", "AS", "T2", "ON", "T1.Member_ID", "=", "T2.Member_ID", "JOIN", "performance", "AS", "T3", "ON", "T1.Performance_ID", "=", "T3.Performance_ID", "ORDER", "BY", "T3.Attendance", "DESC" ]
[ "select", "t2", ".", "name", ",", "t3", ".", "date", "from", "member_attendance", "as", "t1", "join", "member", "as", "t2", "on", "t1", ".", "member_id", "=", "t2", ".", "member_id", "join", "performance", "as", "t3", "on", "t1", ".", "performance_id", "=", "t3", ".", "performance_id", "order", "by", "t3", ".", "attendance", "desc" ]
[ "Show", "the", "names", "of", "members", "and", "the", "dates", "of", "performances", "they", "attended", "in", "descending", "order", "of", "attendance", "of", "the", "performances", "." ]
performance_attendance
[ "CREATE TABLE \"member\" (\n \"Member_ID\" text,\n \"Name\" text,\n \"Nationality\" text,\n \"Role\" text,\n PRIMARY KEY (\"Member_ID\")\n);", "CREATE TABLE \"performance\" (\n \"Performance_ID\" real,\n \"Date\" text,\n \"Host\" text,\n \"Location\" text,\n \"Attendance\" int,\n PRIMARY KEY (\"Performance_ID\")\n);", "CREATE TABLE \"member_attendance\" (\n \"Member_ID\" int,\n \"Performance_ID\" int,\n \"Num_of_Pieces\" int,\n PRIMARY KEY (\"Member_ID\",\"Performance_ID\"),\n FOREIGN KEY (\"Member_ID\") REFERENCES `member`(\"Member_ID\"),\n FOREIGN KEY (\"Performance_ID\") REFERENCES `performance`(\"Performance_ID\")\n);" ]
List the names of members who did not attend any performance.
SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM member_attendance)
[ "SELECT", "Name", "FROM", "member", "WHERE", "Member_ID", "NOT", "IN", "(", "SELECT", "Member_ID", "FROM", "member_attendance", ")" ]
[ "select", "name", "from", "member", "where", "member_id", "not", "in", "(", "select", "member_id", "from", "member_attendance", ")" ]
[ "List", "the", "names", "of", "members", "who", "did", "not", "attend", "any", "performance", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the buildings which have rooms with capacity more than 50.
SELECT DISTINCT building FROM classroom WHERE capacity > 50
[ "SELECT", "DISTINCT", "building", "FROM", "classroom", "WHERE", "capacity", ">", "50" ]
[ "select", "distinct", "building", "from", "classroom", "where", "capacity", ">", "value" ]
[ "Find", "the", "buildings", "which", "have", "rooms", "with", "capacity", "more", "than", "50", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the distinct buildings with capacities of greater than 50?
SELECT DISTINCT building FROM classroom WHERE capacity > 50
[ "SELECT", "DISTINCT", "building", "FROM", "classroom", "WHERE", "capacity", ">", "50" ]
[ "select", "distinct", "building", "from", "classroom", "where", "capacity", ">", "value" ]
[ "What", "are", "the", "distinct", "buildings", "with", "capacities", "of", "greater", "than", "50", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of rooms that are not in the Lamberton building.
SELECT count(*) FROM classroom WHERE building != 'Lamberton'
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "!", "=", "'Lamberton", "'" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "!", "=", "value" ]
[ "Count", "the", "number", "of", "rooms", "that", "are", "not", "in", "the", "Lamberton", "building", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many classrooms are not in Lamberton?
SELECT count(*) FROM classroom WHERE building != 'Lamberton'
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "!", "=", "'Lamberton", "'" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "!", "=", "value" ]
[ "How", "many", "classrooms", "are", "not", "in", "Lamberton", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the name and building of the departments whose budget is more than the average budget?
SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "WHERE", "budget", ">", "(", "SELECT", "avg", "(", "budget", ")", "FROM", "department", ")" ]
[ "select", "dept_name", ",", "building", "from", "department", "where", "budget", ">", "(", "select", "avg", "(", "budget", ")", "from", "department", ")" ]
[ "What", "is", "the", "name", "and", "building", "of", "the", "departments", "whose", "budget", "is", "more", "than", "the", "average", "budget", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give the name and building of the departments with greater than average budget.
SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "WHERE", "budget", ">", "(", "SELECT", "avg", "(", "budget", ")", "FROM", "department", ")" ]
[ "select", "dept_name", ",", "building", "from", "department", "where", "budget", ">", "(", "select", "avg", "(", "budget", ")", "from", "department", ")" ]
[ "Give", "the", "name", "and", "building", "of", "the", "departments", "with", "greater", "than", "average", "budget", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the room number of the rooms which can sit 50 to 100 students and their buildings.
SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
[ "SELECT", "building", ",", "room_number", "FROM", "classroom", "WHERE", "capacity", "BETWEEN", "50", "AND", "100" ]
[ "select", "building", ",", "room_number", "from", "classroom", "where", "capacity", "between", "value", "and", "value" ]
[ "Find", "the", "room", "number", "of", "the", "rooms", "which", "can", "sit", "50", "to", "100", "students", "and", "their", "buildings", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students?
SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100
[ "SELECT", "building", ",", "room_number", "FROM", "classroom", "WHERE", "capacity", "BETWEEN", "50", "AND", "100" ]
[ "select", "building", ",", "room_number", "from", "classroom", "where", "capacity", "between", "value", "and", "value" ]
[ "What", "are", "the", "room", "numbers", "and", "corresponding", "buildings", "for", "classrooms", "which", "can", "seat", "between", "50", "to", "100", "students", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name and building of the department with the highest budget.
SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "ORDER", "BY", "budget", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", ",", "building", "from", "department", "order", "by", "budget", "desc", "limit", "value" ]
[ "Find", "the", "name", "and", "building", "of", "the", "department", "with", "the", "highest", "budget", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the department name and corresponding building for the department with the greatest budget?
SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "ORDER", "BY", "budget", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", ",", "building", "from", "department", "order", "by", "budget", "desc", "limit", "value" ]
[ "What", "is", "the", "department", "name", "and", "corresponding", "building", "for", "the", "department", "with", "the", "greatest", "budget", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the name of the student who has the highest total credits in the History department.
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
[ "SELECT", "name", "FROM", "student", "WHERE", "dept_name", "=", "'History", "'", "ORDER", "BY", "tot_cred", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "student", "where", "dept_name", "=", "value", "order", "by", "tot_cred", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "student", "who", "has", "the", "highest", "total", "credits", "in", "the", "History", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give the name of the student in the History department with the most credits.
SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1
[ "SELECT", "name", "FROM", "student", "WHERE", "dept_name", "=", "'History", "'", "ORDER", "BY", "tot_cred", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "student", "where", "dept_name", "=", "value", "order", "by", "tot_cred", "desc", "limit", "value" ]
[ "Give", "the", "name", "of", "the", "student", "in", "the", "History", "department", "with", "the", "most", "credits", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many rooms does the Lamberton building have?
SELECT count(*) FROM classroom WHERE building = 'Lamberton'
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "=", "'Lamberton", "'" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "=", "value" ]
[ "How", "many", "rooms", "does", "the", "Lamberton", "building", "have", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of classrooms in Lamberton.
SELECT count(*) FROM classroom WHERE building = 'Lamberton'
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "=", "'Lamberton", "'" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "=", "value" ]
[ "Count", "the", "number", "of", "classrooms", "in", "Lamberton", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many students have advisors?
SELECT count(DISTINCT s_id) FROM advisor
[ "SELECT", "count", "(", "DISTINCT", "s_id", ")", "FROM", "advisor" ]
[ "select", "count", "(", "distinct", "s_id", ")", "from", "advisor" ]
[ "How", "many", "students", "have", "advisors", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of students who have advisors.
SELECT count(DISTINCT s_id) FROM advisor
[ "SELECT", "count", "(", "DISTINCT", "s_id", ")", "FROM", "advisor" ]
[ "select", "count", "(", "distinct", "s_id", ")", "from", "advisor" ]
[ "Count", "the", "number", "of", "students", "who", "have", "advisors", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many departments offer courses?
SELECT count(DISTINCT dept_name) FROM course
[ "SELECT", "count", "(", "DISTINCT", "dept_name", ")", "FROM", "course" ]
[ "select", "count", "(", "distinct", "dept_name", ")", "from", "course" ]
[ "How", "many", "departments", "offer", "courses", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of departments which offer courses.
SELECT count(DISTINCT dept_name) FROM course
[ "SELECT", "count", "(", "DISTINCT", "dept_name", ")", "FROM", "course" ]
[ "select", "count", "(", "distinct", "dept_name", ")", "from", "course" ]
[ "Count", "the", "number", "of", "departments", "which", "offer", "courses", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many different courses offered by Physics department?
SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
[ "SELECT", "count", "(", "DISTINCT", "course_id", ")", "FROM", "course", "WHERE", "dept_name", "=", "'Physics", "'" ]
[ "select", "count", "(", "distinct", "course_id", ")", "from", "course", "where", "dept_name", "=", "value" ]
[ "How", "many", "different", "courses", "offered", "by", "Physics", "department", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of courses in the Physics department.
SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
[ "SELECT", "count", "(", "DISTINCT", "course_id", ")", "FROM", "course", "WHERE", "dept_name", "=", "'Physics", "'" ]
[ "select", "count", "(", "distinct", "course_id", ")", "from", "course", "where", "dept_name", "=", "value" ]
[ "Count", "the", "number", "of", "courses", "in", "the", "Physics", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the title of courses that have two prerequisites?
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2
[ "SELECT", "T1.title", "FROM", "course", "AS", "T1", "JOIN", "prereq", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "GROUP", "BY", "T2.course_id", "HAVING", "count", "(", "*", ")", "=", "2" ]
[ "select", "t1", ".", "title", "from", "course", "as", "t1", "join", "prereq", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "group", "by", "t2", ".", "course_id", "having", "count", "(", "*", ")", "=", "value" ]
[ "Find", "the", "title", "of", "courses", "that", "have", "two", "prerequisites", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the titles for courses with two prerequisites?
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2
[ "SELECT", "T1.title", "FROM", "course", "AS", "T1", "JOIN", "prereq", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "GROUP", "BY", "T2.course_id", "HAVING", "count", "(", "*", ")", "=", "2" ]
[ "select", "t1", ".", "title", "from", "course", "as", "t1", "join", "prereq", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "group", "by", "t2", ".", "course_id", "having", "count", "(", "*", ")", "=", "value" ]
[ "What", "are", "the", "titles", "for", "courses", "with", "two", "prerequisites", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the title, credit, and department name of courses that have more than one prerequisites?
SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1
[ "SELECT", "T1.title", ",", "T1.credits", ",", "T1.dept_name", "FROM", "course", "AS", "T1", "JOIN", "prereq", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "GROUP", "BY", "T2.course_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "title", ",", "t1", ".", "credits", ",", "t1", ".", "dept_name", "from", "course", "as", "t1", "join", "prereq", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "group", "by", "t2", ".", "course_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "title", ",", "credit", ",", "and", "department", "name", "of", "courses", "that", "have", "more", "than", "one", "prerequisites", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the title, credit value, and department name for courses with more than one prerequisite?
SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1
[ "SELECT", "T1.title", ",", "T1.credits", ",", "T1.dept_name", "FROM", "course", "AS", "T1", "JOIN", "prereq", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "GROUP", "BY", "T2.course_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "title", ",", "t1", ".", "credits", ",", "t1", ".", "dept_name", "from", "course", "as", "t1", "join", "prereq", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "group", "by", "t2", ".", "course_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "is", "the", "title", ",", "credit", "value", ",", "and", "department", "name", "for", "courses", "with", "more", "than", "one", "prerequisite", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many courses that do not have prerequisite?
SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
[ "SELECT", "count", "(", "*", ")", "FROM", "course", "WHERE", "course_id", "NOT", "IN", "(", "SELECT", "course_id", "FROM", "prereq", ")" ]
[ "select", "count", "(", "*", ")", "from", "course", "where", "course_id", "not", "in", "(", "select", "course_id", "from", "prereq", ")" ]
[ "How", "many", "courses", "that", "do", "not", "have", "prerequisite", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of courses without prerequisites.
SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
[ "SELECT", "count", "(", "*", ")", "FROM", "course", "WHERE", "course_id", "NOT", "IN", "(", "SELECT", "course_id", "FROM", "prereq", ")" ]
[ "select", "count", "(", "*", ")", "from", "course", "where", "course_id", "not", "in", "(", "select", "course_id", "from", "prereq", ")" ]
[ "Count", "the", "number", "of", "courses", "without", "prerequisites", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of the courses that do not have any prerequisite?
SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "NOT", "IN", "(", "SELECT", "course_id", "FROM", "prereq", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "not", "in", "(", "select", "course_id", "from", "prereq", ")" ]
[ "Find", "the", "name", "of", "the", "courses", "that", "do", "not", "have", "any", "prerequisite", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the titles of courses without prerequisites?
SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "NOT", "IN", "(", "SELECT", "course_id", "FROM", "prereq", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "not", "in", "(", "select", "course_id", "from", "prereq", ")" ]
[ "What", "are", "the", "titles", "of", "courses", "without", "prerequisites", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many different instructors have taught some course?
SELECT COUNT (DISTINCT id) FROM teaches
[ "SELECT", "COUNT", "(", "DISTINCT", "id", ")", "FROM", "teaches" ]
[ "select", "count", "(", "distinct", "id", ")", "from", "teaches" ]
[ "How", "many", "different", "instructors", "have", "taught", "some", "course", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of distinct instructors who have taught a course.
SELECT COUNT (DISTINCT id) FROM teaches
[ "SELECT", "COUNT", "(", "DISTINCT", "id", ")", "FROM", "teaches" ]
[ "select", "count", "(", "distinct", "id", ")", "from", "teaches" ]
[ "Count", "the", "number", "of", "distinct", "instructors", "who", "have", "taught", "a", "course", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the total budgets of the Marketing or Finance department.
SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
[ "SELECT", "sum", "(", "budget", ")", "FROM", "department", "WHERE", "dept_name", "=", "'Marketing", "'", "OR", "dept_name", "=", "'Finance", "'" ]
[ "select", "sum", "(", "budget", ")", "from", "department", "where", "dept_name", "=", "value", "or", "dept_name", "=", "value" ]
[ "Find", "the", "total", "budgets", "of", "the", "Marketing", "or", "Finance", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the sum of budgets of the Marketing and Finance departments?
SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'
[ "SELECT", "sum", "(", "budget", ")", "FROM", "department", "WHERE", "dept_name", "=", "'Marketing", "'", "OR", "dept_name", "=", "'Finance", "'" ]
[ "select", "sum", "(", "budget", ")", "from", "department", "where", "dept_name", "=", "value", "or", "dept_name", "=", "value" ]
[ "What", "is", "the", "sum", "of", "budgets", "of", "the", "Marketing", "and", "Finance", "departments", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the department name of the instructor whose name contains 'Soisalon'.
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
[ "SELECT", "dept_name", "FROM", "instructor", "WHERE", "name", "LIKE", "'", "%", "Soisalon", "%", "'" ]
[ "select", "dept_name", "from", "instructor", "where", "name", "like", "value" ]
[ "Find", "the", "department", "name", "of", "the", "instructor", "whose", "name", "contains", "'Soisalon", "'", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the name of the department with an instructure who has a name like 'Soisalon'?
SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'
[ "SELECT", "dept_name", "FROM", "instructor", "WHERE", "name", "LIKE", "'", "%", "Soisalon", "%", "'" ]
[ "select", "dept_name", "from", "instructor", "where", "name", "like", "value" ]
[ "What", "is", "the", "name", "of", "the", "department", "with", "an", "instructure", "who", "has", "a", "name", "like", "'Soisalon", "'", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many rooms whose capacity is less than 50 does the Lamberton building have?
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "=", "'Lamberton", "'", "AND", "capacity", "<", "50" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "=", "value", "and", "capacity", "<", "value" ]
[ "How", "many", "rooms", "whose", "capacity", "is", "less", "than", "50", "does", "the", "Lamberton", "building", "have", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Count the number of rooms in Lamberton with capacity lower than 50.
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
[ "SELECT", "count", "(", "*", ")", "FROM", "classroom", "WHERE", "building", "=", "'Lamberton", "'", "AND", "capacity", "<", "50" ]
[ "select", "count", "(", "*", ")", "from", "classroom", "where", "building", "=", "value", "and", "capacity", "<", "value" ]
[ "Count", "the", "number", "of", "rooms", "in", "Lamberton", "with", "capacity", "lower", "than", "50", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name and budget of departments whose budgets are more than the average budget.
SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)
[ "SELECT", "dept_name", ",", "budget", "FROM", "department", "WHERE", "budget", ">", "(", "SELECT", "avg", "(", "budget", ")", "FROM", "department", ")" ]
[ "select", "dept_name", ",", "budget", "from", "department", "where", "budget", ">", "(", "select", "avg", "(", "budget", ")", "from", "department", ")" ]
[ "Find", "the", "name", "and", "budget", "of", "departments", "whose", "budgets", "are", "more", "than", "the", "average", "budget", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names and budgets of departments with budgets greater than the average?
SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)
[ "SELECT", "dept_name", ",", "budget", "FROM", "department", "WHERE", "budget", ">", "(", "SELECT", "avg", "(", "budget", ")", "FROM", "department", ")" ]
[ "select", "dept_name", ",", "budget", "from", "department", "where", "budget", ">", "(", "select", "avg", "(", "budget", ")", "from", "department", ")" ]
[ "What", "are", "the", "names", "and", "budgets", "of", "departments", "with", "budgets", "greater", "than", "the", "average", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
what is the name of the instructor who is in Statistics department and earns the lowest salary?
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Statistics", "'", "ORDER", "BY", "salary", "LIMIT", "1" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value", "order", "by", "salary", "limit", "value" ]
[ "what", "is", "the", "name", "of", "the", "instructor", "who", "is", "in", "Statistics", "department", "and", "earns", "the", "lowest", "salary", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give the name of the lowest earning instructor in the Statistics department.
SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Statistics", "'", "ORDER", "BY", "salary", "LIMIT", "1" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value", "order", "by", "salary", "limit", "value" ]
[ "Give", "the", "name", "of", "the", "lowest", "earning", "instructor", "in", "the", "Statistics", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the title of course that is provided by both Statistics and Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
[ "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Statistics", "'", "INTERSECT", "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Psychology", "'" ]
[ "select", "title", "from", "course", "where", "dept_name", "=", "value", "intersect", "select", "title", "from", "course", "where", "dept_name", "=", "value" ]
[ "Find", "the", "title", "of", "course", "that", "is", "provided", "by", "both", "Statistics", "and", "Psychology", "departments", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the title of a course that is listed in both the Statistics and Psychology departments?
SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'
[ "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Statistics", "'", "INTERSECT", "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Psychology", "'" ]
[ "select", "title", "from", "course", "where", "dept_name", "=", "value", "intersect", "select", "title", "from", "course", "where", "dept_name", "=", "value" ]
[ "What", "is", "the", "title", "of", "a", "course", "that", "is", "listed", "in", "both", "the", "Statistics", "and", "Psychology", "departments", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the title of course that is provided by Statistics but not Psychology departments.
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
[ "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Statistics", "'", "EXCEPT", "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Psychology", "'" ]
[ "select", "title", "from", "course", "where", "dept_name", "=", "value", "except", "select", "title", "from", "course", "where", "dept_name", "=", "value" ]
[ "Find", "the", "title", "of", "course", "that", "is", "provided", "by", "Statistics", "but", "not", "Psychology", "departments", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the titles of courses that are in the Statistics department but not the Psychology department?
SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'
[ "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Statistics", "'", "EXCEPT", "SELECT", "title", "FROM", "course", "WHERE", "dept_name", "=", "'Psychology", "'" ]
[ "select", "title", "from", "course", "where", "dept_name", "=", "value", "except", "select", "title", "from", "course", "where", "dept_name", "=", "value" ]
[ "What", "are", "the", "titles", "of", "courses", "that", "are", "in", "the", "Statistics", "department", "but", "not", "the", "Psychology", "department", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "EXCEPT", "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "id", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value", "except", "select", "id", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Find", "the", "id", "of", "instructors", "who", "taught", "a", "class", "in", "Fall", "2009", "but", "not", "in", "Spring", "2010", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010?
SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "EXCEPT", "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "id", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value", "except", "select", "id", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "What", "are", "the", "ids", "of", "instructors", "who", "taught", "in", "the", "Fall", "of", "2009", "but", "not", "in", "the", "Spring", "of", "2010", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of students who took any class in the years of 2009 and 2010.
SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
[ "SELECT", "DISTINCT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.id", "=", "T2.id", "WHERE", "YEAR", "=", "2009", "OR", "YEAR", "=", "2010" ]
[ "select", "distinct", "t1", ".", "name", "from", "student", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "year", "=", "value", "or", "year", "=", "value" ]
[ "Find", "the", "name", "of", "students", "who", "took", "any", "class", "in", "the", "years", "of", "2009", "and", "2010", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names of the students who took classes in 2009 or 2010?
SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010
[ "SELECT", "DISTINCT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.id", "=", "T2.id", "WHERE", "YEAR", "=", "2009", "OR", "YEAR", "=", "2010" ]
[ "select", "distinct", "t1", ".", "name", "from", "student", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "year", "=", "value", "or", "year", "=", "value" ]
[ "What", "are", "the", "names", "of", "the", "students", "who", "took", "classes", "in", "2009", "or", "2010", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the names of the top 3 departments that provide the largest amount of courses?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
[ "SELECT", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "3" ]
[ "select", "dept_name", "from", "course", "group", "by", "dept_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "names", "of", "the", "top", "3", "departments", "that", "provide", "the", "largest", "amount", "of", "courses", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names of the 3 departments with the most courses?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3
[ "SELECT", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "3" ]
[ "select", "dept_name", "from", "course", "group", "by", "dept_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "are", "the", "names", "of", "the", "3", "departments", "with", "the", "most", "courses", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of the department that offers the highest total credits?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name", "ORDER", "BY", "sum", "(", "credits", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "course", "group", "by", "dept_name", "order", "by", "sum", "(", "credits", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "the", "department", "that", "offers", "the", "highest", "total", "credits", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What is the name of the department with the most credits?
SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name", "ORDER", "BY", "sum", "(", "credits", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "course", "group", "by", "dept_name", "order", "by", "sum", "(", "credits", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "department", "with", "the", "most", "credits", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
List the names of all courses ordered by their titles and credits.
SELECT title FROM course ORDER BY title , credits
[ "SELECT", "title", "FROM", "course", "ORDER", "BY", "title", ",", "credits" ]
[ "select", "title", "from", "course", "order", "by", "title", ",", "credits" ]
[ "List", "the", "names", "of", "all", "courses", "ordered", "by", "their", "titles", "and", "credits", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Given the titles of all courses, in order of titles and credits.
SELECT title FROM course ORDER BY title , credits
[ "SELECT", "title", "FROM", "course", "ORDER", "BY", "title", ",", "credits" ]
[ "select", "title", "from", "course", "order", "by", "title", ",", "credits" ]
[ "Given", "the", "titles", "of", "all", "courses", ",", "in", "order", "of", "titles", "and", "credits", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Which department has the lowest budget?
SELECT dept_name FROM department ORDER BY budget LIMIT 1
[ "SELECT", "dept_name", "FROM", "department", "ORDER", "BY", "budget", "LIMIT", "1" ]
[ "select", "dept_name", "from", "department", "order", "by", "budget", "limit", "value" ]
[ "Which", "department", "has", "the", "lowest", "budget", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give the name of the department with the lowest budget.
SELECT dept_name FROM department ORDER BY budget LIMIT 1
[ "SELECT", "dept_name", "FROM", "department", "ORDER", "BY", "budget", "LIMIT", "1" ]
[ "select", "dept_name", "from", "department", "order", "by", "budget", "limit", "value" ]
[ "Give", "the", "name", "of", "the", "department", "with", "the", "lowest", "budget", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
List the names and buildings of all departments sorted by the budget from large to small.
SELECT dept_name , building FROM department ORDER BY budget DESC
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "ORDER", "BY", "budget", "DESC" ]
[ "select", "dept_name", ",", "building", "from", "department", "order", "by", "budget", "desc" ]
[ "List", "the", "names", "and", "buildings", "of", "all", "departments", "sorted", "by", "the", "budget", "from", "large", "to", "small", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names and buildings of the deparments, sorted by budget descending?
SELECT dept_name , building FROM department ORDER BY budget DESC
[ "SELECT", "dept_name", ",", "building", "FROM", "department", "ORDER", "BY", "budget", "DESC" ]
[ "select", "dept_name", ",", "building", "from", "department", "order", "by", "budget", "desc" ]
[ "What", "are", "the", "names", "and", "buildings", "of", "the", "deparments", ",", "sorted", "by", "budget", "descending", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Who is the instructor with the highest salary?
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
[ "SELECT", "name", "FROM", "instructor", "ORDER", "BY", "salary", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "instructor", "order", "by", "salary", "desc", "limit", "value" ]
[ "Who", "is", "the", "instructor", "with", "the", "highest", "salary", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give the name of the highest paid instructor.
SELECT name FROM instructor ORDER BY salary DESC LIMIT 1
[ "SELECT", "name", "FROM", "instructor", "ORDER", "BY", "salary", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "instructor", "order", "by", "salary", "desc", "limit", "value" ]
[ "Give", "the", "name", "of", "the", "highest", "paid", "instructor", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
List the information of all instructors ordered by their salary in ascending order.
SELECT * FROM instructor ORDER BY salary
[ "SELECT", "*", "FROM", "instructor", "ORDER", "BY", "salary" ]
[ "select", "*", "from", "instructor", "order", "by", "salary" ]
[ "List", "the", "information", "of", "all", "instructors", "ordered", "by", "their", "salary", "in", "ascending", "order", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Give all information regarding instructors, in order of salary from least to greatest.
SELECT * FROM instructor ORDER BY salary
[ "SELECT", "*", "FROM", "instructor", "ORDER", "BY", "salary" ]
[ "select", "*", "from", "instructor", "order", "by", "salary" ]
[ "Give", "all", "information", "regarding", "instructors", ",", "in", "order", "of", "salary", "from", "least", "to", "greatest", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of the students and their department names sorted by their total credits in ascending order.
SELECT name , dept_name FROM student ORDER BY tot_cred
[ "SELECT", "name", ",", "dept_name", "FROM", "student", "ORDER", "BY", "tot_cred" ]
[ "select", "name", ",", "dept_name", "from", "student", "order", "by", "tot_cred" ]
[ "Find", "the", "name", "of", "the", "students", "and", "their", "department", "names", "sorted", "by", "their", "total", "credits", "in", "ascending", "order", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names of students and their respective departments, ordered by number of credits from least to greatest?
SELECT name , dept_name FROM student ORDER BY tot_cred
[ "SELECT", "name", ",", "dept_name", "FROM", "student", "ORDER", "BY", "tot_cred" ]
[ "select", "name", ",", "dept_name", "from", "student", "order", "by", "tot_cred" ]
[ "What", "are", "the", "names", "of", "students", "and", "their", "respective", "departments", ",", "ordered", "by", "number", "of", "credits", "from", "least", "to", "greatest", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
list in alphabetic order all course names and their instructors' names in year 2008.
SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title
[ "SELECT", "T1.title", ",", "T3.name", "FROM", "course", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "JOIN", "instructor", "AS", "T3", "ON", "T2.id", "=", "T3.id", "WHERE", "YEAR", "=", "2008", "ORDER", "BY", "T1.title" ]
[ "select", "t1", ".", "title", ",", "t3", ".", "name", "from", "course", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "join", "instructor", "as", "t3", "on", "t2", ".", "id", "=", "t3", ".", "id", "where", "year", "=", "value", "order", "by", "t1", ".", "title" ]
[ "list", "in", "alphabetic", "order", "all", "course", "names", "and", "their", "instructors", "'", "names", "in", "year", "2008", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Show all titles and their instructors' names for courses in 2008, in alphabetical order by title.
SELECT T1.title , T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE YEAR = 2008 ORDER BY T1.title
[ "SELECT", "T1.title", ",", "T3.name", "FROM", "course", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "JOIN", "instructor", "AS", "T3", "ON", "T2.id", "=", "T3.id", "WHERE", "YEAR", "=", "2008", "ORDER", "BY", "T1.title" ]
[ "select", "t1", ".", "title", ",", "t3", ".", "name", "from", "course", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "join", "instructor", "as", "t3", "on", "t2", ".", "id", "=", "t3", ".", "id", "where", "year", "=", "value", "order", "by", "t1", ".", "title" ]
[ "Show", "all", "titles", "and", "their", "instructors", "'", "names", "for", "courses", "in", "2008", ",", "in", "alphabetical", "order", "by", "title", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of instructors who are advising more than one student.
SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1
[ "SELECT", "T1.name", "FROM", "instructor", "AS", "T1", "JOIN", "advisor", "AS", "T2", "ON", "T1.id", "=", "T2.i_id", "GROUP", "BY", "T2.i_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "name", "from", "instructor", "as", "t1", "join", "advisor", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "i_id", "group", "by", "t2", ".", "i_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "name", "of", "instructors", "who", "are", "advising", "more", "than", "one", "student", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names of instructors who advise more than one student?
SELECT T1.name FROM instructor AS T1 JOIN advisor AS T2 ON T1.id = T2.i_id GROUP BY T2.i_id HAVING count(*) > 1
[ "SELECT", "T1.name", "FROM", "instructor", "AS", "T1", "JOIN", "advisor", "AS", "T2", "ON", "T1.id", "=", "T2.i_id", "GROUP", "BY", "T2.i_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "name", "from", "instructor", "as", "t1", "join", "advisor", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "i_id", "group", "by", "t2", ".", "i_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "names", "of", "instructors", "who", "advise", "more", "than", "one", "student", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the name of the students who have more than one advisor?
SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1
[ "SELECT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "advisor", "AS", "T2", "ON", "T1.id", "=", "T2.s_id", "GROUP", "BY", "T2.s_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "name", "from", "student", "as", "t1", "join", "advisor", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "s_id", "group", "by", "t2", ".", "s_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "name", "of", "the", "students", "who", "have", "more", "than", "one", "advisor", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the names of students who have more than one advisor?
SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id = T2.s_id GROUP BY T2.s_id HAVING count(*) > 1
[ "SELECT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "advisor", "AS", "T2", "ON", "T1.id", "=", "T2.s_id", "GROUP", "BY", "T2.s_id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "name", "from", "student", "as", "t1", "join", "advisor", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "s_id", "group", "by", "t2", ".", "s_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "names", "of", "students", "who", "have", "more", "than", "one", "advisor", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the number of rooms with more than 50 capacity for each building.
SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building
[ "SELECT", "count", "(", "*", ")", ",", "building", "FROM", "classroom", "WHERE", "capacity", ">", "50", "GROUP", "BY", "building" ]
[ "select", "count", "(", "*", ")", ",", "building", "from", "classroom", "where", "capacity", ">", "value", "group", "by", "building" ]
[ "Find", "the", "number", "of", "rooms", "with", "more", "than", "50", "capacity", "for", "each", "building", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many rooms in each building have a capacity of over 50?
SELECT count(*) , building FROM classroom WHERE capacity > 50 GROUP BY building
[ "SELECT", "count", "(", "*", ")", ",", "building", "FROM", "classroom", "WHERE", "capacity", ">", "50", "GROUP", "BY", "building" ]
[ "select", "count", "(", "*", ")", ",", "building", "from", "classroom", "where", "capacity", ">", "value", "group", "by", "building" ]
[ "How", "many", "rooms", "in", "each", "building", "have", "a", "capacity", "of", "over", "50", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the maximum and average capacity among rooms in each building.
SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building
[ "SELECT", "max", "(", "capacity", ")", ",", "avg", "(", "capacity", ")", ",", "building", "FROM", "classroom", "GROUP", "BY", "building" ]
[ "select", "max", "(", "capacity", ")", ",", "avg", "(", "capacity", ")", ",", "building", "from", "classroom", "group", "by", "building" ]
[ "Find", "the", "maximum", "and", "average", "capacity", "among", "rooms", "in", "each", "building", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the greatest and average capacity for rooms in each building?
SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building
[ "SELECT", "max", "(", "capacity", ")", ",", "avg", "(", "capacity", ")", ",", "building", "FROM", "classroom", "GROUP", "BY", "building" ]
[ "select", "max", "(", "capacity", ")", ",", "avg", "(", "capacity", ")", ",", "building", "from", "classroom", "group", "by", "building" ]
[ "What", "are", "the", "greatest", "and", "average", "capacity", "for", "rooms", "in", "each", "building", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the title of the course that is offered by more than one department.
SELECT title FROM course GROUP BY title HAVING count(*) > 1
[ "SELECT", "title", "FROM", "course", "GROUP", "BY", "title", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "title", "from", "course", "group", "by", "title", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "title", "of", "the", "course", "that", "is", "offered", "by", "more", "than", "one", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
What are the titles of courses that are offered in more than one department?
SELECT title FROM course GROUP BY title HAVING count(*) > 1
[ "SELECT", "title", "FROM", "course", "GROUP", "BY", "title", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "title", "from", "course", "group", "by", "title", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "titles", "of", "courses", "that", "are", "offered", "in", "more", "than", "one", "department", "?" ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
Find the total credits of courses provided by different department.
SELECT sum(credits) , dept_name FROM course GROUP BY dept_name
[ "SELECT", "sum", "(", "credits", ")", ",", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name" ]
[ "select", "sum", "(", "credits", ")", ",", "dept_name", "from", "course", "group", "by", "dept_name" ]
[ "Find", "the", "total", "credits", "of", "courses", "provided", "by", "different", "department", "." ]
college_2
[ "create table classroom\n\t(building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t capacity\t\tnumeric(4,0),\n\t primary key (building, room_number)\n\t);", "create table department\n\t(dept_name\t\tvarchar(20),\n\t building\t\tvarchar(15),\n\t budget\t\t numeric(12,2) check (budget > 0),\n\t primary key (dept_name)\n\t);", "create table course\n\t(course_id\t\tvarchar(8),\n\t title\t\t\tvarchar(50),\n\t dept_name\t\tvarchar(20) NULL,\n\t credits\t\tnumeric(2,0) check (credits > 0),\n\t primary key (course_id),\n FOREIGN KEY (dept_name)\n REFERENCES `department` (dept_name)\n ON DELETE SET NULL\n-- ON UPDATE NO ACTION\n-- foreign key (dept_name) references department\n-- on delete set null\n );", "create table instructor\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t salary\t\t\tnumeric(8,2) check (salary > 29000),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table section\n\t(course_id\t\tvarchar(8),\n sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6)\n\t\tcheck (semester in ('Fall', 'Winter', 'Spring', 'Summer')),\n\t year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),\n\t building\t\tvarchar(15),\n\t room_number\t\tvarchar(7),\n\t time_slot_id\t\tvarchar(4),\n\t primary key (course_id, sec_id, semester, year),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (building, room_number) references classroom (building, room_number)\n\t\ton delete set null\n\t);", "create table teaches\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references instructor (ID)\n\t\ton delete cascade\n\t);", "create table student\n\t(ID\t\t\tvarchar(5),\n\t name\t\t\tvarchar(20) not null,\n\t dept_name\t\tvarchar(20),\n\t tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),\n\t primary key (ID),\n\t foreign key (dept_name) references department (dept_name)\n\t\ton delete set null\n\t);", "create table takes\n\t(ID\t\t\tvarchar(5),\n\t course_id\t\tvarchar(8),\n\t sec_id\t\t\tvarchar(8),\n\t semester\t\tvarchar(6),\n\t year\t\t\tnumeric(4,0),\n\t grade\t\t varchar(2),\n\t primary key (ID, course_id, sec_id, semester, year),\n\t foreign key (course_id,sec_id, semester, year) references section (course_id, sec_id, semester, year)\n\t\ton delete cascade,\n\t foreign key (ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table advisor\n\t(s_ID\t\t\tvarchar(5),\n\t i_ID\t\t\tvarchar(5),\n\t primary key (s_ID),\n\t foreign key (i_ID) references instructor (ID)\n\t\ton delete set null,\n\t foreign key (s_ID) references student (ID)\n\t\ton delete cascade\n\t);", "create table time_slot\n\t(time_slot_id\t\tvarchar(4),\n\t day\t\t\tvarchar(1),\n\t start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),\n\t start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),\n\t end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),\n\t end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),\n\t primary key (time_slot_id, day, start_hr, start_min)\n\t);", "create table prereq\n\t(course_id\t\tvarchar(8),\n\t prereq_id\t\tvarchar(8),\n\t primary key (course_id, prereq_id),\n\t foreign key (course_id) references course (course_id)\n\t\ton delete cascade,\n\t foreign key (prereq_id) references course (course_id)\n\t);" ]
How many total credits are offered by each department?
SELECT sum(credits) , dept_name FROM course GROUP BY dept_name
[ "SELECT", "sum", "(", "credits", ")", ",", "dept_name", "FROM", "course", "GROUP", "BY", "dept_name" ]
[ "select", "sum", "(", "credits", ")", ",", "dept_name", "from", "course", "group", "by", "dept_name" ]
[ "How", "many", "total", "credits", "are", "offered", "by", "each", "department", "?" ]