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
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 minimum salary for the departments whose average salary is above the average payment of all instructors.
SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)
[ "SELECT", "min", "(", "salary", ")", ",", "dept_name", "FROM", "instructor", "GROUP", "BY", "dept_name", "HAVING", "avg", "(", "salary", ")", ">", "(", "SELECT", "avg", "(", "salary", ")", "FROM", "instructor", ")" ]
[ "select", "min", "(", "salary", ")", ",", "dept_name", "from", "instructor", "group", "by", "dept_name", "having", "avg", "(", "salary", ")", ">", "(", "select", "avg", "(", "salary", ")", "from", "instructor", ")" ]
[ "Find", "the", "minimum", "salary", "for", "the", "departments", "whose", "average", "salary", "is", "above", "the", "average", "payment", "of", "all", "instructors", "." ]
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 lowest salary in departments with average salary greater than the overall average.
SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)
[ "SELECT", "min", "(", "salary", ")", ",", "dept_name", "FROM", "instructor", "GROUP", "BY", "dept_name", "HAVING", "avg", "(", "salary", ")", ">", "(", "SELECT", "avg", "(", "salary", ")", "FROM", "instructor", ")" ]
[ "select", "min", "(", "salary", ")", ",", "dept_name", "from", "instructor", "group", "by", "dept_name", "having", "avg", "(", "salary", ")", ">", "(", "select", "avg", "(", "salary", ")", "from", "instructor", ")" ]
[ "What", "is", "the", "lowest", "salary", "in", "departments", "with", "average", "salary", "greater", "than", "the", "overall", "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);" ]
Find the number of courses provided in each semester and year.
SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR
[ "SELECT", "count", "(", "*", ")", ",", "semester", ",", "YEAR", "FROM", "SECTION", "GROUP", "BY", "semester", ",", "YEAR" ]
[ "select", "count", "(", "*", ")", ",", "semester", ",", "year", "from", "section", "group", "by", "semester", ",", "year" ]
[ "Find", "the", "number", "of", "courses", "provided", "in", "each", "semester", "and", "year", "." ]
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 are provided in each semester and year?
SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR
[ "SELECT", "count", "(", "*", ")", ",", "semester", ",", "YEAR", "FROM", "SECTION", "GROUP", "BY", "semester", ",", "YEAR" ]
[ "select", "count", "(", "*", ")", ",", "semester", ",", "year", "from", "section", "group", "by", "semester", ",", "year" ]
[ "How", "many", "courses", "are", "provided", "in", "each", "semester", "and", "year", "?" ]
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 year which offers the largest number of courses.
SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "YEAR", "FROM", "SECTION", "GROUP", "BY", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "year", "from", "section", "group", "by", "year", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "year", "which", "offers", "the", "largest", "number", "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);" ]
Which year had the greatest number of courses?
SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "YEAR", "FROM", "SECTION", "GROUP", "BY", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "year", "from", "section", "group", "by", "year", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "year", "had", "the", "greatest", "number", "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);" ]
Find the year and semester when offers the largest number of courses.
SELECT semester , YEAR FROM SECTION GROUP BY semester , YEAR ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "semester", ",", "YEAR", "FROM", "SECTION", "GROUP", "BY", "semester", ",", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "semester", ",", "year", "from", "section", "group", "by", "semester", ",", "year", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "year", "and", "semester", "when", "offers", "the", "largest", "number", "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 is the year and semester with the most courses?
SELECT semester , YEAR FROM SECTION GROUP BY semester , YEAR ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "semester", ",", "YEAR", "FROM", "SECTION", "GROUP", "BY", "semester", ",", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "semester", ",", "year", "from", "section", "group", "by", "semester", ",", "year", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "year", "and", "semester", "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 department has the highest amount of students?
SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "student", "GROUP", "BY", "dept_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "student", "group", "by", "dept_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "department", "has", "the", "highest", "amount", "of", "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);" ]
What is the name of the deparment with the highest enrollment?
SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "student", "GROUP", "BY", "dept_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "student", "group", "by", "dept_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "deparment", "with", "the", "highest", "enrollment", "?" ]
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 number of students in each department.
SELECT count(*) , dept_name FROM student GROUP BY dept_name
[ "SELECT", "count", "(", "*", ")", ",", "dept_name", "FROM", "student", "GROUP", "BY", "dept_name" ]
[ "select", "count", "(", "*", ")", ",", "dept_name", "from", "student", "group", "by", "dept_name" ]
[ "Find", "the", "total", "number", "of", "students", "in", "each", "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 students are in each department?
SELECT count(*) , dept_name FROM student GROUP BY dept_name
[ "SELECT", "count", "(", "*", ")", ",", "dept_name", "FROM", "student", "GROUP", "BY", "dept_name" ]
[ "select", "count", "(", "*", ")", ",", "dept_name", "from", "student", "group", "by", "dept_name" ]
[ "How", "many", "students", "are", "in", "each", "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 semester and year which has the least number of student taking any class.
SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1
[ "SELECT", "semester", ",", "YEAR", "FROM", "takes", "GROUP", "BY", "semester", ",", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "1" ]
[ "select", "semester", ",", "year", "from", "takes", "group", "by", "semester", ",", "year", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "Find", "the", "semester", "and", "year", "which", "has", "the", "least", "number", "of", "student", "taking", "any", "class", "." ]
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 semeseter and year had the fewest students?
SELECT semester , YEAR FROM takes GROUP BY semester , YEAR ORDER BY count(*) LIMIT 1
[ "SELECT", "semester", ",", "YEAR", "FROM", "takes", "GROUP", "BY", "semester", ",", "YEAR", "ORDER", "BY", "count", "(", "*", ")", "LIMIT", "1" ]
[ "select", "semester", ",", "year", "from", "takes", "group", "by", "semester", ",", "year", "order", "by", "count", "(", "*", ")", "limit", "value" ]
[ "Which", "semeseter", "and", "year", "had", "the", "fewest", "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);" ]
What is the id of the instructor who advises of all students from History department?
SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
[ "SELECT", "i_id", "FROM", "advisor", "AS", "T1", "JOIN", "student", "AS", "T2", "ON", "T1.s_id", "=", "T2.id", "WHERE", "T2.dept_name", "=", "'History", "'" ]
[ "select", "i_id", "from", "advisor", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "s_id", "=", "t2", ".", "id", "where", "t2", ".", "dept_name", "=", "value" ]
[ "What", "is", "the", "id", "of", "the", "instructor", "who", "advises", "of", "all", "students", "from", "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 id of the instructor who advises students in the History department.
SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
[ "SELECT", "i_id", "FROM", "advisor", "AS", "T1", "JOIN", "student", "AS", "T2", "ON", "T1.s_id", "=", "T2.id", "WHERE", "T2.dept_name", "=", "'History", "'" ]
[ "select", "i_id", "from", "advisor", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "s_id", "=", "t2", ".", "id", "where", "t2", ".", "dept_name", "=", "value" ]
[ "Give", "id", "of", "the", "instructor", "who", "advises", "students", "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);" ]
Find the name and salary of the instructors who are advisors of any student from History department?
SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
[ "SELECT", "T2.name", ",", "T2.salary", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'History", "'" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "salary", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value" ]
[ "Find", "the", "name", "and", "salary", "of", "the", "instructors", "who", "are", "advisors", "of", "any", "student", "from", "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);" ]
What are the names and salaries of instructors who advises students in the History department?
SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'History'
[ "SELECT", "T2.name", ",", "T2.salary", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'History", "'" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "salary", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value" ]
[ "What", "are", "the", "names", "and", "salaries", "of", "instructors", "who", "advises", "students", "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);" ]
Find the id of the courses that do not have any prerequisite?
SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
[ "SELECT", "course_id", "FROM", "course", "EXCEPT", "SELECT", "course_id", "FROM", "prereq" ]
[ "select", "course_id", "from", "course", "except", "select", "course_id", "from", "prereq" ]
[ "Find", "the", "id", "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 ids of courses without prerequisites?
SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq
[ "SELECT", "course_id", "FROM", "course", "EXCEPT", "SELECT", "course_id", "FROM", "prereq" ]
[ "select", "course_id", "from", "course", "except", "select", "course_id", "from", "prereq" ]
[ "What", "are", "the", "ids", "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 names 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", "names", "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);" ]
What is the title of the prerequisite class of International Finance course?
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.prereq_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'International", "Finance", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "prereq_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "What", "is", "the", "title", "of", "the", "prerequisite", "class", "of", "International", "Finance", "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);" ]
Give the title of the prerequisite to the course International Finance.
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.prereq_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'International", "Finance", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "prereq_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "Give", "the", "title", "of", "the", "prerequisite", "to", "the", "course", "International", "Finance", "." ]
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 whose prerequisite is course Differential Geometry.
SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.course_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.prereq_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'Differential", "Geometry", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "course_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "prereq_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "Find", "the", "title", "of", "course", "whose", "prerequisite", "is", "course", "Differential", "Geometry", "." ]
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 the course with Differential Geometry as a prerequisite?
SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id = T2.course_id WHERE T2.title = 'Differential Geometry')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.course_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.prereq_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'Differential", "Geometry", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "course_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "prereq_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "What", "is", "the", "title", "of", "the", "course", "with", "Differential", "Geometry", "as", "a", "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);" ]
Find the names of students who have taken any course in the fall semester of year 2003.
SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)
[ "SELECT", "name", "FROM", "student", "WHERE", "id", "IN", "(", "SELECT", "id", "FROM", "takes", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2003", ")" ]
[ "select", "name", "from", "student", "where", "id", "in", "(", "select", "id", "from", "takes", "where", "semester", "=", "value", "and", "year", "=", "value", ")" ]
[ "Find", "the", "names", "of", "students", "who", "have", "taken", "any", "course", "in", "the", "fall", "semester", "of", "year", "2003", "." ]
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 took a course in the Fall of 2003?
SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND YEAR = 2003)
[ "SELECT", "name", "FROM", "student", "WHERE", "id", "IN", "(", "SELECT", "id", "FROM", "takes", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2003", ")" ]
[ "select", "name", "from", "student", "where", "id", "in", "(", "select", "id", "from", "takes", "where", "semester", "=", "value", "and", "year", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "students", "who", "took", "a", "course", "in", "the", "Fall", "of", "2003", "?" ]
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 the course that was offered at building Chandler during the fall semester in the year of 2010?
SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010
[ "SELECT", "T1.title", "FROM", "course", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "building", "=", "'Chandler", "'", "AND", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "t1", ".", "title", "from", "course", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "building", "=", "value", "and", "semester", "=", "value", "and", "year", "=", "value" ]
[ "What", "is", "the", "title", "of", "the", "course", "that", "was", "offered", "at", "building", "Chandler", "during", "the", "fall", "semester", "in", "the", "year", "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);" ]
Give the title of the course offered in Chandler during the Fall of 2010.
SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010
[ "SELECT", "T1.title", "FROM", "course", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "building", "=", "'Chandler", "'", "AND", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "t1", ".", "title", "from", "course", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "building", "=", "value", "and", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Give", "the", "title", "of", "the", "course", "offered", "in", "Chandler", "during", "the", "Fall", "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 the instructors who taught C Programming course before.
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
[ "SELECT", "T1.name", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.id", "=", "T2.id", "JOIN", "course", "AS", "T3", "ON", "T2.course_id", "=", "T3.course_id", "WHERE", "T3.title", "=", "'C", "Programming", "'" ]
[ "select", "t1", ".", "name", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "join", "course", "as", "t3", "on", "t2", ".", "course_id", "=", "t3", ".", "course_id", "where", "t3", ".", "title", "=", "value" ]
[ "Find", "the", "name", "of", "the", "instructors", "who", "taught", "C", "Programming", "course", "before", "." ]
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 have taught C Programming courses?
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
[ "SELECT", "T1.name", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.id", "=", "T2.id", "JOIN", "course", "AS", "T3", "ON", "T2.course_id", "=", "T3.course_id", "WHERE", "T3.title", "=", "'C", "Programming", "'" ]
[ "select", "t1", ".", "name", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "join", "course", "as", "t3", "on", "t2", ".", "course_id", "=", "t3", ".", "course_id", "where", "t3", ".", "title", "=", "value" ]
[ "What", "are", "the", "names", "of", "instructors", "who", "have", "taught", "C", "Programming", "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 and salary of instructors who are advisors of the students from the Math department.
SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
[ "SELECT", "T2.name", ",", "T2.salary", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'Math", "'" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "salary", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value" ]
[ "Find", "the", "name", "and", "salary", "of", "instructors", "who", "are", "advisors", "of", "the", "students", "from", "the", "Math", "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 names and salaries of instructors who advise students in the Math department?
SELECT T2.name , T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math'
[ "SELECT", "T2.name", ",", "T2.salary", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'Math", "'" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "salary", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value" ]
[ "What", "are", "the", "names", "and", "salaries", "of", "instructors", "who", "advise", "students", "in", "the", "Math", "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 name of instructors who are advisors of the students from the Math department, and sort the results by students' total credit.
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred
[ "SELECT", "T2.name", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'Math", "'", "ORDER", "BY", "T3.tot_cred" ]
[ "select", "t2", ".", "name", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value", "order", "by", "t3", ".", "tot_cred" ]
[ "Find", "the", "name", "of", "instructors", "who", "are", "advisors", "of", "the", "students", "from", "the", "Math", "department", ",", "and", "sort", "the", "results", "by", "students", "'", "total", "credit", "." ]
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 all instructors who advise students in the math depart sorted by total credits of the student.
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' ORDER BY T3.tot_cred
[ "SELECT", "T2.name", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "WHERE", "T3.dept_name", "=", "'Math", "'", "ORDER", "BY", "T3.tot_cred" ]
[ "select", "t2", ".", "name", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "where", "t3", ".", "dept_name", "=", "value", "order", "by", "t3", ".", "tot_cred" ]
[ "What", "are", "the", "names", "of", "all", "instructors", "who", "advise", "students", "in", "the", "math", "depart", "sorted", "by", "total", "credits", "of", "the", "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 is the course title of the prerequisite of course Mobile Computing?
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.prereq_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'Mobile", "Computing", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "prereq_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "What", "is", "the", "course", "title", "of", "the", "prerequisite", "of", "course", "Mobile", "Computing", "?" ]
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 the course that is a prerequisite for Mobile Computing?
SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing')
[ "SELECT", "title", "FROM", "course", "WHERE", "course_id", "IN", "(", "SELECT", "T1.prereq_id", "FROM", "prereq", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.title", "=", "'Mobile", "Computing", "'", ")" ]
[ "select", "title", "from", "course", "where", "course_id", "in", "(", "select", "t1", ".", "prereq_id", "from", "prereq", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "title", "=", "value", ")" ]
[ "What", "is", "the", "title", "of", "the", "course", "that", "is", "a", "prerequisite", "for", "Mobile", "Computing", "?" ]
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 instructor who is the advisor of the student who has the highest number of total credits.
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
[ "SELECT", "T2.name", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "ORDER", "BY", "T3.tot_cred", "DESC", "LIMIT", "1" ]
[ "select", "t2", ".", "name", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "order", "by", "t3", ".", "tot_cred", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "instructor", "who", "is", "the", "advisor", "of", "the", "student", "who", "has", "the", "highest", "number", "of", "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 instructor who advises the student with the greatest number of total credits?
SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1
[ "SELECT", "T2.name", "FROM", "advisor", "AS", "T1", "JOIN", "instructor", "AS", "T2", "ON", "T1.i_id", "=", "T2.id", "JOIN", "student", "AS", "T3", "ON", "T1.s_id", "=", "T3.id", "ORDER", "BY", "T3.tot_cred", "DESC", "LIMIT", "1" ]
[ "select", "t2", ".", "name", "from", "advisor", "as", "t1", "join", "instructor", "as", "t2", "on", "t1", ".", "i_id", "=", "t2", ".", "id", "join", "student", "as", "t3", "on", "t1", ".", "s_id", "=", "t3", ".", "id", "order", "by", "t3", ".", "tot_cred", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "instructor", "who", "advises", "the", "student", "with", "the", "greatest", "number", "of", "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);" ]
Find the name of instructors who didn't teach any courses?
SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
[ "SELECT", "name", "FROM", "instructor", "WHERE", "id", "NOT", "IN", "(", "SELECT", "id", "FROM", "teaches", ")" ]
[ "select", "name", "from", "instructor", "where", "id", "not", "in", "(", "select", "id", "from", "teaches", ")" ]
[ "Find", "the", "name", "of", "instructors", "who", "did", "n't", "teach", "any", "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 instructors who didn't teach?
SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches)
[ "SELECT", "name", "FROM", "instructor", "WHERE", "id", "NOT", "IN", "(", "SELECT", "id", "FROM", "teaches", ")" ]
[ "select", "name", "from", "instructor", "where", "id", "not", "in", "(", "select", "id", "from", "teaches", ")" ]
[ "What", "are", "the", "names", "of", "instructors", "who", "did", "n't", "teach", "?" ]
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 didn't teach any courses?
SELECT id FROM instructor EXCEPT SELECT id FROM teaches
[ "SELECT", "id", "FROM", "instructor", "EXCEPT", "SELECT", "id", "FROM", "teaches" ]
[ "select", "id", "from", "instructor", "except", "select", "id", "from", "teaches" ]
[ "Find", "the", "id", "of", "instructors", "who", "did", "n't", "teach", "any", "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 ids of instructors who didnt' teach?
SELECT id FROM instructor EXCEPT SELECT id FROM teaches
[ "SELECT", "id", "FROM", "instructor", "EXCEPT", "SELECT", "id", "FROM", "teaches" ]
[ "select", "id", "from", "instructor", "except", "select", "id", "from", "teaches" ]
[ "What", "are", "the", "ids", "of", "instructors", "who", "didnt", "'", "teach", "?" ]
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 instructors who didn't each any courses in any Spring semester.
SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "id", "NOT", "IN", "(", "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "id", "not", "in", "(", "select", "id", "from", "teaches", "where", "semester", "=", "value", ")" ]
[ "Find", "the", "names", "of", "instructors", "who", "did", "n't", "each", "any", "courses", "in", "any", "Spring", "semester", "." ]
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 didn't teach courses in the Spring?
SELECT name FROM instructor WHERE id NOT IN (SELECT id FROM teaches WHERE semester = 'Spring')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "id", "NOT", "IN", "(", "SELECT", "id", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "id", "not", "in", "(", "select", "id", "from", "teaches", "where", "semester", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "instructors", "who", "did", "n't", "teach", "courses", "in", "the", "Spring", "?" ]
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 which has the highest average salary of professors.
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "instructor", "GROUP", "BY", "dept_name", "ORDER", "BY", "avg", "(", "salary", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "instructor", "group", "by", "dept_name", "order", "by", "avg", "(", "salary", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "the", "department", "which", "has", "the", "highest", "average", "salary", "of", "professors", "." ]
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 highest average instructor salary?
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1
[ "SELECT", "dept_name", "FROM", "instructor", "GROUP", "BY", "dept_name", "ORDER", "BY", "avg", "(", "salary", ")", "DESC", "LIMIT", "1" ]
[ "select", "dept_name", "from", "instructor", "group", "by", "dept_name", "order", "by", "avg", "(", "salary", ")", "desc", "limit", "value" ]
[ "Which", "department", "has", "the", "highest", "average", "instructor", "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);" ]
Find the number and averaged salary of all instructors who are in the department with the highest budget.
SELECT avg(T1.salary) , count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
[ "SELECT", "avg", "(", "T1.salary", ")", ",", "count", "(", "*", ")", "FROM", "instructor", "AS", "T1", "JOIN", "department", "AS", "T2", "ON", "T1.dept_name", "=", "T2.dept_name", "ORDER", "BY", "T2.budget", "DESC", "LIMIT", "1" ]
[ "select", "avg", "(", "t1", ".", "salary", ")", ",", "count", "(", "*", ")", "from", "instructor", "as", "t1", "join", "department", "as", "t2", "on", "t1", ".", "dept_name", "=", "t2", ".", "dept_name", "order", "by", "t2", ".", "budget", "desc", "limit", "value" ]
[ "Find", "the", "number", "and", "averaged", "salary", "of", "all", "instructors", "who", "are", "in", "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);" ]
How many instructors are in the department with the highest budget, and what is their average salary?
SELECT avg(T1.salary) , count(*) FROM instructor AS T1 JOIN department AS T2 ON T1.dept_name = T2.dept_name ORDER BY T2.budget DESC LIMIT 1
[ "SELECT", "avg", "(", "T1.salary", ")", ",", "count", "(", "*", ")", "FROM", "instructor", "AS", "T1", "JOIN", "department", "AS", "T2", "ON", "T1.dept_name", "=", "T2.dept_name", "ORDER", "BY", "T2.budget", "DESC", "LIMIT", "1" ]
[ "select", "avg", "(", "t1", ".", "salary", ")", ",", "count", "(", "*", ")", "from", "instructor", "as", "t1", "join", "department", "as", "t2", "on", "t1", ".", "dept_name", "=", "t2", ".", "dept_name", "order", "by", "t2", ".", "budget", "desc", "limit", "value" ]
[ "How", "many", "instructors", "are", "in", "the", "department", "with", "the", "highest", "budget", ",", "and", "what", "is", "their", "average", "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);" ]
What is the title and credits of the course that is taught in the largest classroom (with the highest capacity)?
SELECT T3.title , T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT max(capacity) FROM classroom)
[ "SELECT", "T3.title", ",", "T3.credits", "FROM", "classroom", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.building", "=", "T2.building", "AND", "T1.room_number", "=", "T2.room_number", "JOIN", "course", "AS", "T3", "ON", "T2.course_id", "=", "T3.course_id", "WHERE", "T1.capacity", "=", "(", "SELECT", "max", "(", "capacity", ")", "FROM", "classroom", ")" ]
[ "select", "t3", ".", "title", ",", "t3", ".", "credits", "from", "classroom", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "building", "=", "t2", ".", "building", "and", "t1", ".", "room_number", "=", "t2", ".", "room_number", "join", "course", "as", "t3", "on", "t2", ".", "course_id", "=", "t3", ".", "course_id", "where", "t1", ".", "capacity", "=", "(", "select", "max", "(", "capacity", ")", "from", "classroom", ")" ]
[ "What", "is", "the", "title", "and", "credits", "of", "the", "course", "that", "is", "taught", "in", "the", "largest", "classroom", "(", "with", "the", "highest", "capacity", ")", "?" ]
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 title and credits for the course that is taught in the classroom with the greatest capacity.
SELECT T3.title , T3.credits FROM classroom AS T1 JOIN SECTION AS T2 ON T1.building = T2.building AND T1.room_number = T2.room_number JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.capacity = (SELECT max(capacity) FROM classroom)
[ "SELECT", "T3.title", ",", "T3.credits", "FROM", "classroom", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.building", "=", "T2.building", "AND", "T1.room_number", "=", "T2.room_number", "JOIN", "course", "AS", "T3", "ON", "T2.course_id", "=", "T3.course_id", "WHERE", "T1.capacity", "=", "(", "SELECT", "max", "(", "capacity", ")", "FROM", "classroom", ")" ]
[ "select", "t3", ".", "title", ",", "t3", ".", "credits", "from", "classroom", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "building", "=", "t2", ".", "building", "and", "t1", ".", "room_number", "=", "t2", ".", "room_number", "join", "course", "as", "t3", "on", "t2", ".", "course_id", "=", "t3", ".", "course_id", "where", "t1", ".", "capacity", "=", "(", "select", "max", "(", "capacity", ")", "from", "classroom", ")" ]
[ "Give", "the", "title", "and", "credits", "for", "the", "course", "that", "is", "taught", "in", "the", "classroom", "with", "the", "greatest", "capacity", "." ]
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 didn't take any course from Biology department.
SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
[ "SELECT", "name", "FROM", "student", "WHERE", "id", "NOT", "IN", "(", "SELECT", "T1.id", "FROM", "takes", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "student", "where", "id", "not", "in", "(", "select", "t1", ".", "id", "from", "takes", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "dept_name", "=", "value", ")" ]
[ "Find", "the", "name", "of", "students", "who", "did", "n't", "take", "any", "course", "from", "Biology", "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 names of students who haven't taken any Biology courses?
SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
[ "SELECT", "name", "FROM", "student", "WHERE", "id", "NOT", "IN", "(", "SELECT", "T1.id", "FROM", "takes", "AS", "T1", "JOIN", "course", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T2.dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "student", "where", "id", "not", "in", "(", "select", "t1", ".", "id", "from", "takes", "as", "t1", "join", "course", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t2", ".", "dept_name", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "students", "who", "have", "n't", "taken", "any", "Biology", "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 total number of students and total number of instructors for each department.
SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
[ "SELECT", "count", "(", "DISTINCT", "T2.id", ")", ",", "count", "(", "DISTINCT", "T3.id", ")", ",", "T3.dept_name", "FROM", "department", "AS", "T1", "JOIN", "student", "AS", "T2", "ON", "T1.dept_name", "=", "T2.dept_name", "JOIN", "instructor", "AS", "T3", "ON", "T1.dept_name", "=", "T3.dept_name", "GROUP", "BY", "T3.dept_name" ]
[ "select", "count", "(", "distinct", "t2", ".", "id", ")", ",", "count", "(", "distinct", "t3", ".", "id", ")", ",", "t3", ".", "dept_name", "from", "department", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "dept_name", "=", "t2", ".", "dept_name", "join", "instructor", "as", "t3", "on", "t1", ".", "dept_name", "=", "t3", ".", "dept_name", "group", "by", "t3", ".", "dept_name" ]
[ "Find", "the", "total", "number", "of", "students", "and", "total", "number", "of", "instructors", "for", "each", "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 students and instructors are in each department?
SELECT count(DISTINCT T2.id) , count(DISTINCT T3.id) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
[ "SELECT", "count", "(", "DISTINCT", "T2.id", ")", ",", "count", "(", "DISTINCT", "T3.id", ")", ",", "T3.dept_name", "FROM", "department", "AS", "T1", "JOIN", "student", "AS", "T2", "ON", "T1.dept_name", "=", "T2.dept_name", "JOIN", "instructor", "AS", "T3", "ON", "T1.dept_name", "=", "T3.dept_name", "GROUP", "BY", "T3.dept_name" ]
[ "select", "count", "(", "distinct", "t2", ".", "id", ")", ",", "count", "(", "distinct", "t3", ".", "id", ")", ",", "t3", ".", "dept_name", "from", "department", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "dept_name", "=", "t2", ".", "dept_name", "join", "instructor", "as", "t3", "on", "t1", ".", "dept_name", "=", "t3", ".", "dept_name", "group", "by", "t3", ".", "dept_name" ]
[ "How", "many", "students", "and", "instructors", "are", "in", "each", "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 name of students who have taken the prerequisite course of the course with title International Finance.
SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
[ "SELECT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.id", "=", "T2.id", "WHERE", "T2.course_id", "IN", "(", "SELECT", "T4.prereq_id", "FROM", "course", "AS", "T3", "JOIN", "prereq", "AS", "T4", "ON", "T3.course_id", "=", "T4.course_id", "WHERE", "T3.title", "=", "'International", "Finance", "'", ")" ]
[ "select", "t1", ".", "name", "from", "student", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "t2", ".", "course_id", "in", "(", "select", "t4", ".", "prereq_id", "from", "course", "as", "t3", "join", "prereq", "as", "t4", "on", "t3", ".", "course_id", "=", "t4", ".", "course_id", "where", "t3", ".", "title", "=", "value", ")" ]
[ "Find", "the", "name", "of", "students", "who", "have", "taken", "the", "prerequisite", "course", "of", "the", "course", "with", "title", "International", "Finance", "." ]
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 taken the prerequisite for the course International Finance?
SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance')
[ "SELECT", "T1.name", "FROM", "student", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.id", "=", "T2.id", "WHERE", "T2.course_id", "IN", "(", "SELECT", "T4.prereq_id", "FROM", "course", "AS", "T3", "JOIN", "prereq", "AS", "T4", "ON", "T3.course_id", "=", "T4.course_id", "WHERE", "T3.title", "=", "'International", "Finance", "'", ")" ]
[ "select", "t1", ".", "name", "from", "student", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "t2", ".", "course_id", "in", "(", "select", "t4", ".", "prereq_id", "from", "course", "as", "t3", "join", "prereq", "as", "t4", "on", "t3", ".", "course_id", "=", "t4", ".", "course_id", "where", "t3", ".", "title", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "students", "who", "have", "taken", "the", "prerequisite", "for", "the", "course", "International", "Finance", "?" ]
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 salary of instructors whose salary is below the average salary of the instructors in the Physics department.
SELECT name , salary FROM instructor WHERE salary < (SELECT avg(salary) FROM instructor WHERE dept_name = 'Physics')
[ "SELECT", "name", ",", "salary", "FROM", "instructor", "WHERE", "salary", "<", "(", "SELECT", "avg", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Physics", "'", ")" ]
[ "select", "name", ",", "salary", "from", "instructor", "where", "salary", "<", "(", "select", "avg", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "Find", "the", "name", "and", "salary", "of", "instructors", "whose", "salary", "is", "below", "the", "average", "salary", "of", "the", "instructors", "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);" ]
What are the names and salaries for instructors who earn less than the average salary of instructors in the Physics department?
SELECT name , salary FROM instructor WHERE salary < (SELECT avg(salary) FROM instructor WHERE dept_name = 'Physics')
[ "SELECT", "name", ",", "salary", "FROM", "instructor", "WHERE", "salary", "<", "(", "SELECT", "avg", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Physics", "'", ")" ]
[ "select", "name", ",", "salary", "from", "instructor", "where", "salary", "<", "(", "select", "avg", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "What", "are", "the", "names", "and", "salaries", "for", "instructors", "who", "earn", "less", "than", "the", "average", "salary", "of", "instructors", "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 name of students who took some course offered by Statistics department.
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
[ "SELECT", "T3.name", "FROM", "course", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "JOIN", "student", "AS", "T3", "ON", "T2.id", "=", "T3.id", "WHERE", "T1.dept_name", "=", "'Statistics", "'" ]
[ "select", "t3", ".", "name", "from", "course", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "join", "student", "as", "t3", "on", "t2", ".", "id", "=", "t3", ".", "id", "where", "t1", ".", "dept_name", "=", "value" ]
[ "Find", "the", "name", "of", "students", "who", "took", "some", "course", "offered", "by", "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);" ]
What are the names of students who have taken Statistics courses?
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
[ "SELECT", "T3.name", "FROM", "course", "AS", "T1", "JOIN", "takes", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "JOIN", "student", "AS", "T3", "ON", "T2.id", "=", "T3.id", "WHERE", "T1.dept_name", "=", "'Statistics", "'" ]
[ "select", "t3", ".", "name", "from", "course", "as", "t1", "join", "takes", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "join", "student", "as", "t3", "on", "t2", ".", "id", "=", "t3", ".", "id", "where", "t1", ".", "dept_name", "=", "value" ]
[ "What", "are", "the", "names", "of", "students", "who", "have", "taken", "Statistics", "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 building, room number, semester and year of all courses offered by Psychology department sorted by course titles.
SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
[ "SELECT", "T2.building", ",", "T2.room_number", ",", "T2.semester", ",", "T2.year", "FROM", "course", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T1.dept_name", "=", "'Psychology", "'", "ORDER", "BY", "T1.title" ]
[ "select", "t2", ".", "building", ",", "t2", ".", "room_number", ",", "t2", ".", "semester", ",", "t2", ".", "year", "from", "course", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t1", ".", "dept_name", "=", "value", "order", "by", "t1", ".", "title" ]
[ "Find", "the", "building", ",", "room", "number", ",", "semester", "and", "year", "of", "all", "courses", "offered", "by", "Psychology", "department", "sorted", "by", "course", "titles", "." ]
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 building, room number, semester and year of courses in the Psychology department, sorted using course title?
SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
[ "SELECT", "T2.building", ",", "T2.room_number", ",", "T2.semester", ",", "T2.year", "FROM", "course", "AS", "T1", "JOIN", "SECTION", "AS", "T2", "ON", "T1.course_id", "=", "T2.course_id", "WHERE", "T1.dept_name", "=", "'Psychology", "'", "ORDER", "BY", "T1.title" ]
[ "select", "t2", ".", "building", ",", "t2", ".", "room_number", ",", "t2", ".", "semester", ",", "t2", ".", "year", "from", "course", "as", "t1", "join", "section", "as", "t2", "on", "t1", ".", "course_id", "=", "t2", ".", "course_id", "where", "t1", ".", "dept_name", "=", "value", "order", "by", "t1", ".", "title" ]
[ "What", "are", "the", "building", ",", "room", "number", ",", "semester", "and", "year", "of", "courses", "in", "the", "Psychology", "department", ",", "sorted", "using", "course", "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 names of all instructors in computer science department
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Comp", ".", "Sci", ".", "'" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value" ]
[ "Find", "the", "names", "of", "all", "instructors", "in", "computer", "science", "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 names of all instructors in the Comp. Sci. department?
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Comp", ".", "Sci", ".", "'" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value" ]
[ "What", "are", "the", "names", "of", "all", "instructors", "in", "the", "Comp", ".", "Sci", ".", "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 names of all instructors in Comp. Sci. department with salary > 80000.
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Comp", ".", "Sci", ".", "'", "AND", "salary", ">", "80000" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value", "and", "salary", ">", "value" ]
[ "Find", "the", "names", "of", "all", "instructors", "in", "Comp", ".", "Sci", ".", "department", "with", "salary", ">", "80000", "." ]
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 instructors in the Comp. Sci. department who earn more than 80000?
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' AND salary > 80000
[ "SELECT", "name", "FROM", "instructor", "WHERE", "dept_name", "=", "'Comp", ".", "Sci", ".", "'", "AND", "salary", ">", "80000" ]
[ "select", "name", "from", "instructor", "where", "dept_name", "=", "value", "and", "salary", ">", "value" ]
[ "What", "are", "the", "names", "of", "the", "instructors", "in", "the", "Comp", ".", "Sci", ".", "department", "who", "earn", "more", "than", "80000", "?" ]
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 all instructors who have taught some course and the course_id.
SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID
[ "SELECT", "name", ",", "course_id", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.ID", "=", "T2.ID" ]
[ "select", "name", ",", "course_id", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id" ]
[ "Find", "the", "names", "of", "all", "instructors", "who", "have", "taught", "some", "course", "and", "the", "course_id", "." ]
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 all instructors who have taught a course, as well as the corresponding course id?
SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID
[ "SELECT", "name", ",", "course_id", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.ID", "=", "T2.ID" ]
[ "select", "name", ",", "course_id", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id" ]
[ "What", "are", "the", "names", "of", "all", "instructors", "who", "have", "taught", "a", "course", ",", "as", "well", "as", "the", "corresponding", "course", "id", "?" ]
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 all instructors in the Art department who have taught some course and the course_id.
SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'
[ "SELECT", "name", ",", "course_id", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.ID", "=", "T2.ID", "WHERE", "T1.dept_name", "=", "'Art", "'" ]
[ "select", "name", ",", "course_id", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "t1", ".", "dept_name", "=", "value" ]
[ "Find", "the", "names", "of", "all", "instructors", "in", "the", "Art", "department", "who", "have", "taught", "some", "course", "and", "the", "course_id", "." ]
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 Art instructors who have taught a course, and the corresponding course id?
SELECT name , course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art'
[ "SELECT", "name", ",", "course_id", "FROM", "instructor", "AS", "T1", "JOIN", "teaches", "AS", "T2", "ON", "T1.ID", "=", "T2.ID", "WHERE", "T1.dept_name", "=", "'Art", "'" ]
[ "select", "name", ",", "course_id", "from", "instructor", "as", "t1", "join", "teaches", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "id", "where", "t1", ".", "dept_name", "=", "value" ]
[ "What", "are", "the", "names", "of", "Art", "instructors", "who", "have", "taught", "a", "course", ",", "and", "the", "corresponding", "course", "id", "?" ]
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 all instructors whose name includes the substring “dar”.
SELECT name FROM instructor WHERE name LIKE '%dar%'
[ "SELECT", "name", "FROM", "instructor", "WHERE", "name", "LIKE", "'", "%", "dar", "%", "'" ]
[ "select", "name", "from", "instructor", "where", "name", "like", "value" ]
[ "Find", "the", "names", "of", "all", "instructors", "whose", "name", "includes", "the", "substring", "“dar”", "." ]
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 all instructors with names that include "dar"?
SELECT name FROM instructor WHERE name LIKE '%dar%'
[ "SELECT", "name", "FROM", "instructor", "WHERE", "name", "LIKE", "'", "%", "dar", "%", "'" ]
[ "select", "name", "from", "instructor", "where", "name", "like", "value" ]
[ "What", "are", "the", "names", "of", "all", "instructors", "with", "names", "that", "include", "``", "dar", "''", "?" ]
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 the names of all distinct instructors.
SELECT DISTINCT name FROM instructor ORDER BY name
[ "SELECT", "DISTINCT", "name", "FROM", "instructor", "ORDER", "BY", "name" ]
[ "select", "distinct", "name", "from", "instructor", "order", "by", "name" ]
[ "List", "in", "alphabetic", "order", "the", "names", "of", "all", "distinct", "instructors", "." ]
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 distinct names of the instructors, ordered by name.
SELECT DISTINCT name FROM instructor ORDER BY name
[ "SELECT", "DISTINCT", "name", "FROM", "instructor", "ORDER", "BY", "name" ]
[ "select", "distinct", "name", "from", "instructor", "order", "by", "name" ]
[ "List", "the", "distinct", "names", "of", "the", "instructors", ",", "ordered", "by", "name", "." ]
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 courses that ran in Fall 2009 or in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "UNION", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "union", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Find", "courses", "that", "ran", "in", "Fall", "2009", "or", "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 for courses in the Fall of 2009 or the Spring of 2010?
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 UNION SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "UNION", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "union", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "What", "are", "the", "ids", "for", "courses", "in", "the", "Fall", "of", "2009", "or", "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 courses that ran in Fall 2009 and in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "INTERSECT", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "intersect", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Find", "courses", "that", "ran", "in", "Fall", "2009", "and", "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 for courses that were offered in both Fall of 2009 and Spring of 2010?
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "INTERSECT", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "intersect", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "What", "are", "the", "ids", "for", "courses", "that", "were", "offered", "in", "both", "Fall", "of", "2009", "and", "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 courses that ran in Fall 2009 but not in Spring 2010.
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "EXCEPT", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "except", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Find", "courses", "that", "ran", "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 courses offered in Fall of 2009 but not in Spring of 2010?
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Fall", "'", "AND", "YEAR", "=", "2009", "EXCEPT", "SELECT", "course_id", "FROM", "SECTION", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value", "except", "select", "course_id", "from", "section", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "What", "are", "the", "ids", "of", "courses", "offered", "in", "Fall", "of", "2009", "but", "not", "in", "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 salaries of all distinct instructors that are less than the largest salary.
SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT max(salary) FROM instructor)
[ "SELECT", "DISTINCT", "salary", "FROM", "instructor", "WHERE", "salary", "<", "(", "SELECT", "max", "(", "salary", ")", "FROM", "instructor", ")" ]
[ "select", "distinct", "salary", "from", "instructor", "where", "salary", "<", "(", "select", "max", "(", "salary", ")", "from", "instructor", ")" ]
[ "Find", "the", "salaries", "of", "all", "distinct", "instructors", "that", "are", "less", "than", "the", "largest", "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);" ]
What are the distinct salaries of all instructors who earned less than the maximum salary?
SELECT DISTINCT salary FROM instructor WHERE salary < (SELECT max(salary) FROM instructor)
[ "SELECT", "DISTINCT", "salary", "FROM", "instructor", "WHERE", "salary", "<", "(", "SELECT", "max", "(", "salary", ")", "FROM", "instructor", ")" ]
[ "select", "distinct", "salary", "from", "instructor", "where", "salary", "<", "(", "select", "max", "(", "salary", ")", "from", "instructor", ")" ]
[ "What", "are", "the", "distinct", "salaries", "of", "all", "instructors", "who", "earned", "less", "than", "the", "maximum", "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);" ]
Find the total number of instructors who teach a course in the Spring 2010 semester.
SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "COUNT", "(", "DISTINCT", "ID", ")", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "count", "(", "distinct", "id", ")", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "Find", "the", "total", "number", "of", "instructors", "who", "teach", "a", "course", "in", "the", "Spring", "2010", "semester", "." ]
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 instructors teach a course in the Spring of 2010?
SELECT COUNT (DISTINCT ID) FROM teaches WHERE semester = 'Spring' AND YEAR = 2010
[ "SELECT", "COUNT", "(", "DISTINCT", "ID", ")", "FROM", "teaches", "WHERE", "semester", "=", "'Spring", "'", "AND", "YEAR", "=", "2010" ]
[ "select", "count", "(", "distinct", "id", ")", "from", "teaches", "where", "semester", "=", "value", "and", "year", "=", "value" ]
[ "How", "many", "instructors", "teach", "a", "course", "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 names and average salaries of all departments whose average salary is greater than 42000.
SELECT dept_name , AVG (salary) FROM instructor GROUP BY dept_name HAVING AVG (salary) > 42000
[ "SELECT", "dept_name", ",", "AVG", "(", "salary", ")", "FROM", "instructor", "GROUP", "BY", "dept_name", "HAVING", "AVG", "(", "salary", ")", ">", "42000" ]
[ "select", "dept_name", ",", "avg", "(", "salary", ")", "from", "instructor", "group", "by", "dept_name", "having", "avg", "(", "salary", ")", ">", "value" ]
[ "Find", "the", "names", "and", "average", "salaries", "of", "all", "departments", "whose", "average", "salary", "is", "greater", "than", "42000", "." ]
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 average salaries for departments with average salary higher than 42000?
SELECT dept_name , AVG (salary) FROM instructor GROUP BY dept_name HAVING AVG (salary) > 42000
[ "SELECT", "dept_name", ",", "AVG", "(", "salary", ")", "FROM", "instructor", "GROUP", "BY", "dept_name", "HAVING", "AVG", "(", "salary", ")", ">", "42000" ]
[ "select", "dept_name", ",", "avg", "(", "salary", ")", "from", "instructor", "group", "by", "dept_name", "having", "avg", "(", "salary", ")", ">", "value" ]
[ "What", "are", "the", "names", "and", "average", "salaries", "for", "departments", "with", "average", "salary", "higher", "than", "42000", "?" ]
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 names of instructors with salary greater than that of some (at least one) instructor in the Biology department.
SELECT name FROM instructor WHERE salary > (SELECT min(salary) FROM instructor WHERE dept_name = 'Biology')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "salary", ">", "(", "SELECT", "min", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "salary", ">", "(", "select", "min", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "Find", "names", "of", "instructors", "with", "salary", "greater", "than", "that", "of", "some", "(", "at", "least", "one", ")", "instructor", "in", "the", "Biology", "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 names of instructors who earn more than at least one instructor from the Biology department?
SELECT name FROM instructor WHERE salary > (SELECT min(salary) FROM instructor WHERE dept_name = 'Biology')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "salary", ">", "(", "SELECT", "min", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "salary", ">", "(", "select", "min", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "instructors", "who", "earn", "more", "than", "at", "least", "one", "instructor", "from", "the", "Biology", "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 names of all instructors whose salary is greater than the salary of all instructors in the Biology department.
SELECT name FROM instructor WHERE salary > (SELECT max(salary) FROM instructor WHERE dept_name = 'Biology')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "salary", ">", "(", "SELECT", "max", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "salary", ">", "(", "select", "max", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "Find", "the", "names", "of", "all", "instructors", "whose", "salary", "is", "greater", "than", "the", "salary", "of", "all", "instructors", "in", "the", "Biology", "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 names of all instructors with a higher salary than any of the instructors in the Biology department?
SELECT name FROM instructor WHERE salary > (SELECT max(salary) FROM instructor WHERE dept_name = 'Biology')
[ "SELECT", "name", "FROM", "instructor", "WHERE", "salary", ">", "(", "SELECT", "max", "(", "salary", ")", "FROM", "instructor", "WHERE", "dept_name", "=", "'Biology", "'", ")" ]
[ "select", "name", "from", "instructor", "where", "salary", ">", "(", "select", "max", "(", "salary", ")", "from", "instructor", "where", "dept_name", "=", "value", ")" ]
[ "What", "are", "the", "names", "of", "all", "instructors", "with", "a", "higher", "salary", "than", "any", "of", "the", "instructors", "in", "the", "Biology", "department", "?" ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
How many debates are there?
SELECT count(*) FROM debate
[ "SELECT", "count", "(", "*", ")", "FROM", "debate" ]
[ "select", "count", "(", "*", ")", "from", "debate" ]
[ "How", "many", "debates", "are", "there", "?" ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
List the venues of debates in ascending order of the number of audience.
SELECT Venue FROM debate ORDER BY Num_of_Audience ASC
[ "SELECT", "Venue", "FROM", "debate", "ORDER", "BY", "Num_of_Audience", "ASC" ]
[ "select", "venue", "from", "debate", "order", "by", "num_of_audience", "asc" ]
[ "List", "the", "venues", "of", "debates", "in", "ascending", "order", "of", "the", "number", "of", "audience", "." ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
What are the date and venue of each debate?
SELECT Date , Venue FROM debate
[ "SELECT", "Date", ",", "Venue", "FROM", "debate" ]
[ "select", "date", ",", "venue", "from", "debate" ]
[ "What", "are", "the", "date", "and", "venue", "of", "each", "debate", "?" ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
List the dates of debates with number of audience bigger than 150
SELECT Date FROM debate WHERE Num_of_Audience > 150
[ "SELECT", "Date", "FROM", "debate", "WHERE", "Num_of_Audience", ">", "150" ]
[ "select", "date", "from", "debate", "where", "num_of_audience", ">", "value" ]
[ "List", "the", "dates", "of", "debates", "with", "number", "of", "audience", "bigger", "than", "150" ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
Show the names of people aged either 35 or 36.
SELECT Name FROM people WHERE Age = 35 OR Age = 36
[ "SELECT", "Name", "FROM", "people", "WHERE", "Age", "=", "35", "OR", "Age", "=", "36" ]
[ "select", "name", "from", "people", "where", "age", "=", "value", "or", "age", "=", "value" ]
[ "Show", "the", "names", "of", "people", "aged", "either", "35", "or", "36", "." ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
What is the party of the youngest people?
SELECT Party FROM people ORDER BY Age ASC LIMIT 1
[ "SELECT", "Party", "FROM", "people", "ORDER", "BY", "Age", "ASC", "LIMIT", "1" ]
[ "select", "party", "from", "people", "order", "by", "age", "asc", "limit", "value" ]
[ "What", "is", "the", "party", "of", "the", "youngest", "people", "?" ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
Show different parties of people along with the number of people in each party.
SELECT Party , COUNT(*) FROM people GROUP BY Party
[ "SELECT", "Party", ",", "COUNT", "(", "*", ")", "FROM", "people", "GROUP", "BY", "Party" ]
[ "select", "party", ",", "count", "(", "*", ")", "from", "people", "group", "by", "party" ]
[ "Show", "different", "parties", "of", "people", "along", "with", "the", "number", "of", "people", "in", "each", "party", "." ]
debate
[ "CREATE TABLE \"people\" (\n\"People_ID\" int,\n\"District\" text,\n\"Name\" text,\n\"Party\" text,\n\"Age\" int,\nPRIMARY KEY (\"People_ID\")\n);", "CREATE TABLE \"debate\" (\n\"Debate_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Num_of_Audience\" int,\nPRIMARY KEY (\"Debate_ID\")\n);", "CREATE TABLE \"debate_people\" (\n\"Debate_ID\" int,\n\"Affirmative\" int,\n\"Negative\" int,\n\"If_Affirmative_Win\" bool,\nPRIMARY KEY (\"Debate_ID\",\"Affirmative\",\"Negative\"),\nFOREIGN KEY (\"Debate_ID\") REFERENCES `debate`(\"Debate_ID\"),\nFOREIGN KEY (\"Affirmative\") REFERENCES `people`(\"People_ID\"),\nFOREIGN KEY (\"Negative\") REFERENCES `people`(\"People_ID\")\n);" ]
Show the party that has the most people.
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
[ "SELECT", "Party", "FROM", "people", "GROUP", "BY", "Party", "ORDER", "BY", "COUNT", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "party", "from", "people", "group", "by", "party", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "party", "that", "has", "the", "most", "people", "." ]