question stringlengths 12 244 | answer stringlengths 18 557 | context stringlengths 27 489 | text stringlengths 108 1.05k |
|---|---|---|---|
Find the name of tourney that has more than 10 matches. | SELECT tourney_name FROM matches GROUP BY tourney_name HAVING COUNT(*) > 10 | CREATE TABLE matches (tourney_name VARCHAR) | <s>[INST] Find the name of tourney that has more than 10 matches.
context: CREATE TABLE matches (tourney_name VARCHAR) [/INST] SELECT tourney_name FROM matches GROUP BY tourney_name HAVING COUNT(*) > 10 </s> |
List the names of all winners who played in both 2013 and 2016. | SELECT winner_name FROM matches WHERE YEAR = 2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR = 2016 | CREATE TABLE matches (winner_name VARCHAR, YEAR VARCHAR) | <s>[INST] List the names of all winners who played in both 2013 and 2016.
context: CREATE TABLE matches (winner_name VARCHAR, YEAR VARCHAR) [/INST] SELECT winner_name FROM matches WHERE YEAR = 2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR = 2016 </s> |
List the number of all matches who played in years of 2013 or 2016. | SELECT COUNT(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016 | CREATE TABLE matches (YEAR VARCHAR) | <s>[INST] List the number of all matches who played in years of 2013 or 2016.
context: CREATE TABLE matches (YEAR VARCHAR) [/INST] SELECT COUNT(*) FROM matches WHERE YEAR = 2013 OR YEAR = 2016 </s> |
What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open? | SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open' | CREATE TABLE matches (winner_id VARCHAR, tourney_name VARCHAR); CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR) | <s>[INST] What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open?
context: CREATE TABLE matches (winner_id VARCHAR, tourney_name VARCHAR); CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR) [/INST] SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships' INTERSECT SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'Australian Open' </s> |
Find the first name and country code of the oldest player. | SELECT first_name, country_code FROM players ORDER BY birth_date LIMIT 1 | CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR) | <s>[INST] Find the first name and country code of the oldest player.
context: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR) [/INST] SELECT first_name, country_code FROM players ORDER BY birth_date LIMIT 1 </s> |
List the first and last name of all players in the order of birth date. | SELECT first_name, last_name FROM players ORDER BY birth_date | CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR) | <s>[INST] List the first and last name of all players in the order of birth date.
context: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, birth_date VARCHAR) [/INST] SELECT first_name, last_name FROM players ORDER BY birth_date </s> |
List the first and last name of all players who are left / L hand in the order of birth date. | SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date | CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, hand VARCHAR, birth_date VARCHAR) | <s>[INST] List the first and last name of all players who are left / L hand in the order of birth date.
context: CREATE TABLE players (first_name VARCHAR, last_name VARCHAR, hand VARCHAR, birth_date VARCHAR) [/INST] SELECT first_name, last_name FROM players WHERE hand = 'L' ORDER BY birth_date </s> |
Find the first name and country code of the player who did the most number of tours. | SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1 | CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR, tours VARCHAR) | <s>[INST] Find the first name and country code of the player who did the most number of tours.
context: CREATE TABLE players (country_code VARCHAR, first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR, tours VARCHAR) [/INST] SELECT T1.country_code, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id ORDER BY T2.tours DESC LIMIT 1 </s> |
Find the year that has the most number of matches. | SELECT YEAR FROM matches GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE matches (YEAR VARCHAR) | <s>[INST] Find the year that has the most number of matches.
context: CREATE TABLE matches (YEAR VARCHAR) [/INST] SELECT YEAR FROM matches GROUP BY YEAR ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Find the name and rank points of the winner who won the most times. | SELECT winner_name, winner_rank_points FROM matches GROUP BY winner_name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE matches (winner_name VARCHAR, winner_rank_points VARCHAR) | <s>[INST] Find the name and rank points of the winner who won the most times.
context: CREATE TABLE matches (winner_name VARCHAR, winner_rank_points VARCHAR) [/INST] SELECT winner_name, winner_rank_points FROM matches GROUP BY winner_name ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Find the name of the winner who has the highest rank points and participated in the Australian Open tourney. | SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1 | CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_rank_points VARCHAR) | <s>[INST] Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.
context: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_rank_points VARCHAR) [/INST] SELECT winner_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1 </s> |
find the names of loser and winner who played in the match with greatest number of minutes. | SELECT winner_name, loser_name FROM matches ORDER BY minutes DESC LIMIT 1 | CREATE TABLE matches (winner_name VARCHAR, loser_name VARCHAR, minutes VARCHAR) | <s>[INST] find the names of loser and winner who played in the match with greatest number of minutes.
context: CREATE TABLE matches (winner_name VARCHAR, loser_name VARCHAR, minutes VARCHAR) [/INST] SELECT winner_name, loser_name FROM matches ORDER BY minutes DESC LIMIT 1 </s> |
Find the average ranking for each player and their first name. | SELECT AVG(ranking), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name | CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR) | <s>[INST] Find the average ranking for each player and their first name.
context: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR) [/INST] SELECT AVG(ranking), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name </s> |
Find the total ranking points for each player and their first name. | SELECT SUM(ranking_points), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name | CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR) | <s>[INST] Find the total ranking points for each player and their first name.
context: CREATE TABLE players (first_name VARCHAR, player_id VARCHAR); CREATE TABLE rankings (player_id VARCHAR) [/INST] SELECT SUM(ranking_points), T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name </s> |
find the number of players for each country. | SELECT COUNT(*), country_code FROM players GROUP BY country_code | CREATE TABLE players (country_code VARCHAR) | <s>[INST] find the number of players for each country.
context: CREATE TABLE players (country_code VARCHAR) [/INST] SELECT COUNT(*), country_code FROM players GROUP BY country_code </s> |
find the code of the country where has the greatest number of players. | SELECT country_code FROM players GROUP BY country_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE players (country_code VARCHAR) | <s>[INST] find the code of the country where has the greatest number of players.
context: CREATE TABLE players (country_code VARCHAR) [/INST] SELECT country_code FROM players GROUP BY country_code ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Find the codes of countries that have more than 50 players. | SELECT country_code FROM players GROUP BY country_code HAVING COUNT(*) > 50 | CREATE TABLE players (country_code VARCHAR) | <s>[INST] Find the codes of countries that have more than 50 players.
context: CREATE TABLE players (country_code VARCHAR) [/INST] SELECT country_code FROM players GROUP BY country_code HAVING COUNT(*) > 50 </s> |
Find the total number of tours for each ranking date. | SELECT SUM(tours), ranking_date FROM rankings GROUP BY ranking_date | CREATE TABLE rankings (ranking_date VARCHAR, tours INTEGER) | <s>[INST] Find the total number of tours for each ranking date.
context: CREATE TABLE rankings (ranking_date VARCHAR, tours INTEGER) [/INST] SELECT SUM(tours), ranking_date FROM rankings GROUP BY ranking_date </s> |
Find the number of matches happened in each year. | SELECT COUNT(*), YEAR FROM matches GROUP BY YEAR | CREATE TABLE matches (YEAR VARCHAR) | <s>[INST] Find the number of matches happened in each year.
context: CREATE TABLE matches (YEAR VARCHAR) [/INST] SELECT COUNT(*), YEAR FROM matches GROUP BY YEAR </s> |
Find the name and rank of the 3 youngest winners across all matches. | SELECT DISTINCT winner_name, winner_rank FROM matches ORDER BY winner_age LIMIT 3 | CREATE TABLE matches (winner_name VARCHAR, winner_rank VARCHAR, winner_age VARCHAR) | <s>[INST] Find the name and rank of the 3 youngest winners across all matches.
context: CREATE TABLE matches (winner_name VARCHAR, winner_rank VARCHAR, winner_age VARCHAR) [/INST] SELECT DISTINCT winner_name, winner_rank FROM matches ORDER BY winner_age LIMIT 3 </s> |
How many different winners both participated in the WTA Championships and were left handed? | SELECT COUNT(DISTINCT winner_name) FROM matches WHERE tourney_name = 'WTA Championships' AND winner_hand = 'L' | CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_hand VARCHAR) | <s>[INST] How many different winners both participated in the WTA Championships and were left handed?
context: CREATE TABLE matches (winner_name VARCHAR, tourney_name VARCHAR, winner_hand VARCHAR) [/INST] SELECT COUNT(DISTINCT winner_name) FROM matches WHERE tourney_name = 'WTA Championships' AND winner_hand = 'L' </s> |
Find the first name, country code and birth date of the winner who has the highest rank points in all matches. | SELECT T1.first_name, T1.country_code, T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id ORDER BY T2.winner_rank_points DESC LIMIT 1 | CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR, player_id VARCHAR); CREATE TABLE matches (winner_id VARCHAR, winner_rank_points VARCHAR) | <s>[INST] Find the first name, country code and birth date of the winner who has the highest rank points in all matches.
context: CREATE TABLE players (first_name VARCHAR, country_code VARCHAR, birth_date VARCHAR, player_id VARCHAR); CREATE TABLE matches (winner_id VARCHAR, winner_rank_points VARCHAR) [/INST] SELECT T1.first_name, T1.country_code, T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id ORDER BY T2.winner_rank_points DESC LIMIT 1 </s> |
Find the number of players for each hand type. | SELECT COUNT(*), hand FROM players GROUP BY hand | CREATE TABLE players (hand VARCHAR) | <s>[INST] Find the number of players for each hand type.
context: CREATE TABLE players (hand VARCHAR) [/INST] SELECT COUNT(*), hand FROM players GROUP BY hand </s> |
How many ships ended up being 'Captured'? | SELECT COUNT(*) FROM ship WHERE disposition_of_ship = 'Captured' | CREATE TABLE ship (disposition_of_ship VARCHAR) | <s>[INST] How many ships ended up being 'Captured'?
context: CREATE TABLE ship (disposition_of_ship VARCHAR) [/INST] SELECT COUNT(*) FROM ship WHERE disposition_of_ship = 'Captured' </s> |
List the name and tonnage ordered by in descending alphaetical order for the names. | SELECT name, tonnage FROM ship ORDER BY name DESC | CREATE TABLE ship (name VARCHAR, tonnage VARCHAR) | <s>[INST] List the name and tonnage ordered by in descending alphaetical order for the names.
context: CREATE TABLE ship (name VARCHAR, tonnage VARCHAR) [/INST] SELECT name, tonnage FROM ship ORDER BY name DESC </s> |
List the name, date and result of each battle. | SELECT name, date FROM battle | CREATE TABLE battle (name VARCHAR, date VARCHAR) | <s>[INST] List the name, date and result of each battle.
context: CREATE TABLE battle (name VARCHAR, date VARCHAR) [/INST] SELECT name, date FROM battle </s> |
What is maximum and minimum death toll caused each time? | SELECT MAX(killed), MIN(killed) FROM death | CREATE TABLE death (killed INTEGER) | <s>[INST] What is maximum and minimum death toll caused each time?
context: CREATE TABLE death (killed INTEGER) [/INST] SELECT MAX(killed), MIN(killed) FROM death </s> |
What is the average number of injuries caused each time? | SELECT AVG(injured) FROM death | CREATE TABLE death (injured INTEGER) | <s>[INST] What is the average number of injuries caused each time?
context: CREATE TABLE death (injured INTEGER) [/INST] SELECT AVG(injured) FROM death </s> |
What are the death and injury situations caused by the ship with tonnage 't'? | SELECT T1.killed, T1.injured FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id WHERE T2.tonnage = 't' | CREATE TABLE ship (Id VARCHAR); CREATE TABLE death (killed VARCHAR, injured VARCHAR, caused_by_ship_id VARCHAR) | <s>[INST] What are the death and injury situations caused by the ship with tonnage 't'?
context: CREATE TABLE ship (Id VARCHAR); CREATE TABLE death (killed VARCHAR, injured VARCHAR, caused_by_ship_id VARCHAR) [/INST] SELECT T1.killed, T1.injured FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id WHERE T2.tonnage = 't' </s> |
What are the name and results of the battles when the bulgarian commander is not 'Boril' | SELECT name, RESULT FROM battle WHERE bulgarian_commander <> 'Boril' | CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR) | <s>[INST] What are the name and results of the battles when the bulgarian commander is not 'Boril'
context: CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR) [/INST] SELECT name, RESULT FROM battle WHERE bulgarian_commander <> 'Boril' </s> |
What are the different ids and names of the battles that lost any 'Brig' type shipes? | SELECT DISTINCT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.ship_type = 'Brig' | CREATE TABLE ship (lost_in_battle VARCHAR, ship_type VARCHAR); CREATE TABLE battle (id VARCHAR, name VARCHAR) | <s>[INST] What are the different ids and names of the battles that lost any 'Brig' type shipes?
context: CREATE TABLE ship (lost_in_battle VARCHAR, ship_type VARCHAR); CREATE TABLE battle (id VARCHAR, name VARCHAR) [/INST] SELECT DISTINCT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.ship_type = 'Brig' </s> |
What are the ids and names of the battles that led to more than 10 people killed in total. | SELECT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle JOIN death AS T3 ON T2.id = T3.caused_by_ship_id GROUP BY T1.id HAVING SUM(T3.killed) > 10 | CREATE TABLE death (caused_by_ship_id VARCHAR, killed INTEGER); CREATE TABLE battle (id VARCHAR, name VARCHAR); CREATE TABLE ship (lost_in_battle VARCHAR, id VARCHAR) | <s>[INST] What are the ids and names of the battles that led to more than 10 people killed in total.
context: CREATE TABLE death (caused_by_ship_id VARCHAR, killed INTEGER); CREATE TABLE battle (id VARCHAR, name VARCHAR); CREATE TABLE ship (lost_in_battle VARCHAR, id VARCHAR) [/INST] SELECT T1.id, T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle JOIN death AS T3 ON T2.id = T3.caused_by_ship_id GROUP BY T1.id HAVING SUM(T3.killed) > 10 </s> |
What is the ship id and name that caused most total injuries? | SELECT T2.id, T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE death (caused_by_ship_id VARCHAR); CREATE TABLE ship (Id VARCHAR) | <s>[INST] What is the ship id and name that caused most total injuries?
context: CREATE TABLE death (caused_by_ship_id VARCHAR); CREATE TABLE ship (Id VARCHAR) [/INST] SELECT T2.id, T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'? | SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I' | CREATE TABLE battle (name VARCHAR, bulgarian_commander VARCHAR, latin_commander VARCHAR) | <s>[INST] What are the distinct battle names which are between bulgarian commander 'Kaloyan' and latin commander 'Baldwin I'?
context: CREATE TABLE battle (name VARCHAR, bulgarian_commander VARCHAR, latin_commander VARCHAR) [/INST] SELECT name FROM battle WHERE bulgarian_commander = 'Kaloyan' AND latin_commander = 'Baldwin I' </s> |
How many different results are there for the battles? | SELECT COUNT(DISTINCT RESULT) FROM battle | CREATE TABLE battle (RESULT VARCHAR) | <s>[INST] How many different results are there for the battles?
context: CREATE TABLE battle (RESULT VARCHAR) [/INST] SELECT COUNT(DISTINCT RESULT) FROM battle </s> |
How many battles did not lose any ship with tonnage '225'? | SELECT COUNT(*) FROM battle WHERE NOT id IN (SELECT lost_in_battle FROM ship WHERE tonnage = '225') | CREATE TABLE ship (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR); CREATE TABLE battle (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR) | <s>[INST] How many battles did not lose any ship with tonnage '225'?
context: CREATE TABLE ship (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR); CREATE TABLE battle (id VARCHAR, lost_in_battle VARCHAR, tonnage VARCHAR) [/INST] SELECT COUNT(*) FROM battle WHERE NOT id IN (SELECT lost_in_battle FROM ship WHERE tonnage = '225') </s> |
List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta' | SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'Lettice' INTERSECT SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'HMS Atalanta' | CREATE TABLE ship (lost_in_battle VARCHAR, name VARCHAR); CREATE TABLE battle (name VARCHAR, date VARCHAR, id VARCHAR) | <s>[INST] List the name and date the battle that has lost the ship named 'Lettice' and the ship named 'HMS Atalanta'
context: CREATE TABLE ship (lost_in_battle VARCHAR, name VARCHAR); CREATE TABLE battle (name VARCHAR, date VARCHAR, id VARCHAR) [/INST] SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'Lettice' INTERSECT SELECT T1.name, T1.date FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.name = 'HMS Atalanta' </s> |
Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel'. | SELECT name, RESULT, bulgarian_commander FROM battle EXCEPT SELECT T1.name, T1.result, T1.bulgarian_commander FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.location = 'English Channel' | CREATE TABLE ship (lost_in_battle VARCHAR, location VARCHAR); CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR); CREATE TABLE battle (name VARCHAR, result VARCHAR, bulgarian_commander VARCHAR, id VARCHAR) | <s>[INST] Show names, results and bulgarian commanders of the battles with no ships lost in the 'English Channel'.
context: CREATE TABLE ship (lost_in_battle VARCHAR, location VARCHAR); CREATE TABLE battle (name VARCHAR, RESULT VARCHAR, bulgarian_commander VARCHAR); CREATE TABLE battle (name VARCHAR, result VARCHAR, bulgarian_commander VARCHAR, id VARCHAR) [/INST] SELECT name, RESULT, bulgarian_commander FROM battle EXCEPT SELECT T1.name, T1.result, T1.bulgarian_commander FROM battle AS T1 JOIN ship AS T2 ON T1.id = T2.lost_in_battle WHERE T2.location = 'English Channel' </s> |
What are the notes of the death events which has substring 'East'? | SELECT note FROM death WHERE note LIKE '%East%' | CREATE TABLE death (note VARCHAR) | <s>[INST] What are the notes of the death events which has substring 'East'?
context: CREATE TABLE death (note VARCHAR) [/INST] SELECT note FROM death WHERE note LIKE '%East%' </s> |
what are all the addresses including line 1 and line 2? | SELECT line_1, line_2 FROM addresses | CREATE TABLE addresses (line_1 VARCHAR, line_2 VARCHAR) | <s>[INST] what are all the addresses including line 1 and line 2?
context: CREATE TABLE addresses (line_1 VARCHAR, line_2 VARCHAR) [/INST] SELECT line_1, line_2 FROM addresses </s> |
How many courses in total are listed? | SELECT COUNT(*) FROM Courses | CREATE TABLE Courses (Id VARCHAR) | <s>[INST] How many courses in total are listed?
context: CREATE TABLE Courses (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Courses </s> |
How is the math course described? | SELECT course_description FROM Courses WHERE course_name = 'math' | CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR) | <s>[INST] How is the math course described?
context: CREATE TABLE Courses (course_description VARCHAR, course_name VARCHAR) [/INST] SELECT course_description FROM Courses WHERE course_name = 'math' </s> |
What is the zip code of the address in the city Port Chelsea? | SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea' | CREATE TABLE Addresses (zip_postcode VARCHAR, city VARCHAR) | <s>[INST] What is the zip code of the address in the city Port Chelsea?
context: CREATE TABLE Addresses (zip_postcode VARCHAR, city VARCHAR) [/INST] SELECT zip_postcode FROM Addresses WHERE city = 'Port Chelsea' </s> |
Which department offers the most number of degrees? List department name and id. | SELECT T2.department_name, T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_name VARCHAR, department_id VARCHAR) | <s>[INST] Which department offers the most number of degrees? List department name and id.
context: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_name VARCHAR, department_id VARCHAR) [/INST] SELECT T2.department_name, T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
What is the name and id of the department with the most number of degrees ? | SELECT t2.department_name, t1.department_id FROM degree_programs AS t1 JOIN departments AS t2 ON t1.department_id = t2.department_id GROUP BY t1.department_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE degree_programs (department_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR) | <s>[INST] What is the name and id of the department with the most number of degrees ?
context: CREATE TABLE degree_programs (department_id VARCHAR); CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR) [/INST] SELECT t2.department_name, t1.department_id FROM degree_programs AS t1 JOIN departments AS t2 ON t1.department_id = t2.department_id GROUP BY t1.department_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
How many departments offer any degree? | SELECT COUNT(DISTINCT department_id) FROM Degree_Programs | CREATE TABLE Degree_Programs (department_id VARCHAR) | <s>[INST] How many departments offer any degree?
context: CREATE TABLE Degree_Programs (department_id VARCHAR) [/INST] SELECT COUNT(DISTINCT department_id) FROM Degree_Programs </s> |
How many different degree names are offered? | SELECT COUNT(DISTINCT degree_summary_name) FROM Degree_Programs | CREATE TABLE Degree_Programs (degree_summary_name VARCHAR) | <s>[INST] How many different degree names are offered?
context: CREATE TABLE Degree_Programs (degree_summary_name VARCHAR) [/INST] SELECT COUNT(DISTINCT degree_summary_name) FROM Degree_Programs </s> |
How many degrees does the engineering department offer? | SELECT COUNT(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' | CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_id VARCHAR, department_name VARCHAR) | <s>[INST] How many degrees does the engineering department offer?
context: CREATE TABLE Degree_Programs (department_id VARCHAR); CREATE TABLE Departments (department_id VARCHAR, department_name VARCHAR) [/INST] SELECT COUNT(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id = T2.department_id WHERE T1.department_name = 'engineer' </s> |
What are the names and descriptions of all the sections? | SELECT section_name, section_description FROM Sections | CREATE TABLE Sections (section_name VARCHAR, section_description VARCHAR) | <s>[INST] What are the names and descriptions of all the sections?
context: CREATE TABLE Sections (section_name VARCHAR, section_description VARCHAR) [/INST] SELECT section_name, section_description FROM Sections </s> |
What are the names and id of courses having at most 2 sections? | SELECT T1.course_name, T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(*) <= 2 | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Sections (course_id VARCHAR) | <s>[INST] What are the names and id of courses having at most 2 sections?
context: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Sections (course_id VARCHAR) [/INST] SELECT T1.course_name, T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id HAVING COUNT(*) <= 2 </s> |
List the section_name in reversed lexicographical order. | SELECT section_name FROM Sections ORDER BY section_name DESC | CREATE TABLE Sections (section_name VARCHAR) | <s>[INST] List the section_name in reversed lexicographical order.
context: CREATE TABLE Sections (section_name VARCHAR) [/INST] SELECT section_name FROM Sections ORDER BY section_name DESC </s> |
What is the semester which most student registered in? Show both the name and the id. | SELECT T1.semester_name, T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Student_Enrolment (semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR) | <s>[INST] What is the semester which most student registered in? Show both the name and the id.
context: CREATE TABLE Student_Enrolment (semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR) [/INST] SELECT T1.semester_name, T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id = T2.semester_id GROUP BY T1.semester_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
What is the description of the department whose name has the substring the computer? | SELECT department_description FROM Departments WHERE department_name LIKE '%computer%' | CREATE TABLE Departments (department_description VARCHAR, department_name VARCHAR) | <s>[INST] What is the description of the department whose name has the substring the computer?
context: CREATE TABLE Departments (department_description VARCHAR, department_name VARCHAR) [/INST] SELECT department_description FROM Departments WHERE department_name LIKE '%computer%' </s> |
Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id. | SELECT T1.first_name, T1.middle_name, T1.last_name, T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) = 2 | CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) | <s>[INST] Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.
context: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) [/INST] SELECT T1.first_name, T1.middle_name, T1.last_name, T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) = 2 </s> |
Who is enrolled in a Bachelor degree program? List the first name, middle name, last name. | SELECT DISTINCT T1.first_name, T1.middle_name, T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id = T3.degree_program_id WHERE T3.degree_summary_name = 'Bachelor' | CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR, degree_program_id VARCHAR) | <s>[INST] Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.
context: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR, degree_program_id VARCHAR) [/INST] SELECT DISTINCT T1.first_name, T1.middle_name, T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id = T3.degree_program_id WHERE T3.degree_summary_name = 'Bachelor' </s> |
Find the kind of program which most number of students are enrolled in? | SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Student_Enrolment (degree_program_id VARCHAR); CREATE TABLE Degree_Programs (degree_summary_name VARCHAR, degree_program_id VARCHAR) | <s>[INST] Find the kind of program which most number of students are enrolled in?
context: CREATE TABLE Student_Enrolment (degree_program_id VARCHAR); CREATE TABLE Degree_Programs (degree_summary_name VARCHAR, degree_program_id VARCHAR) [/INST] SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Find the program which most number of students are enrolled in. List both the id and the summary. | SELECT T1.degree_program_id, T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Student_Enrolment (degree_program_id VARCHAR) | <s>[INST] Find the program which most number of students are enrolled in. List both the id and the summary.
context: CREATE TABLE Degree_Programs (degree_program_id VARCHAR, degree_summary_name VARCHAR); CREATE TABLE Student_Enrolment (degree_program_id VARCHAR) [/INST] SELECT T1.degree_program_id, T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id. | SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(*), T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) | <s>[INST] Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id.
context: CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) [/INST] SELECT T1.student_id, T1.first_name, T1.middle_name, T1.last_name, COUNT(*), T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Which semesters do not have any student enrolled? List the semester name. | SELECT semester_name FROM Semesters WHERE NOT semester_id IN (SELECT semester_id FROM Student_Enrolment) | CREATE TABLE Student_Enrolment (semester_name VARCHAR, semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR) | <s>[INST] Which semesters do not have any student enrolled? List the semester name.
context: CREATE TABLE Student_Enrolment (semester_name VARCHAR, semester_id VARCHAR); CREATE TABLE Semesters (semester_name VARCHAR, semester_id VARCHAR) [/INST] SELECT semester_name FROM Semesters WHERE NOT semester_id IN (SELECT semester_id FROM Student_Enrolment) </s> |
What are all the course names of the courses which ever have students enrolled in? | SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR) | <s>[INST] What are all the course names of the courses which ever have students enrolled in?
context: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR) [/INST] SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id </s> |
What's the name of the course with most number of enrollments? | SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR) | <s>[INST] What's the name of the course with most number of enrollments?
context: CREATE TABLE Courses (course_name VARCHAR, course_id VARCHAR); CREATE TABLE Student_Enrolment_Courses (course_id VARCHAR) [/INST] SELECT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program. | SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id | CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (last_name VARCHAR, current_address_id VARCHAR); CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) | <s>[INST] Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program.
context: CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (last_name VARCHAR, current_address_id VARCHAR); CREATE TABLE Students (last_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Enrolment (student_id VARCHAR) [/INST] SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id = T4.student_id </s> |
Show the date and id of the transcript with at least 2 course results. | SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING COUNT(*) >= 2 | CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR) | <s>[INST] Show the date and id of the transcript with at least 2 course results.
context: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR) [/INST] SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id HAVING COUNT(*) >= 2 </s> |
What is the phone number of the man with the first name Timmothy and the last name Ward? | SELECT cell_mobile_number FROM Students WHERE first_name = 'Timmothy' AND last_name = 'Ward' | CREATE TABLE Students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR) | <s>[INST] What is the phone number of the man with the first name Timmothy and the last name Ward?
context: CREATE TABLE Students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] SELECT cell_mobile_number FROM Students WHERE first_name = 'Timmothy' AND last_name = 'Ward' </s> |
What is the mobile phone number of the student named Timmothy Ward ? | SELECT cell_mobile_number FROM students WHERE first_name = 'timmothy' AND last_name = 'ward' | CREATE TABLE students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR) | <s>[INST] What is the mobile phone number of the student named Timmothy Ward ?
context: CREATE TABLE students (cell_mobile_number VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] SELECT cell_mobile_number FROM students WHERE first_name = 'timmothy' AND last_name = 'ward' </s> |
Who is the first student to register? List the first name, middle name and last name. | SELECT first_name, middle_name, last_name FROM Students ORDER BY date_first_registered LIMIT 1 | CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_first_registered VARCHAR) | <s>[INST] Who is the first student to register? List the first name, middle name and last name.
context: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_first_registered VARCHAR) [/INST] SELECT first_name, middle_name, last_name FROM Students ORDER BY date_first_registered LIMIT 1 </s> |
Who is the earliest graduate of the school? List the first name, middle name and last name. | SELECT first_name, middle_name, last_name FROM Students ORDER BY date_left LIMIT 1 | CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_left VARCHAR) | <s>[INST] Who is the earliest graduate of the school? List the first name, middle name and last name.
context: CREATE TABLE Students (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR, date_left VARCHAR) [/INST] SELECT first_name, middle_name, last_name FROM Students ORDER BY date_left LIMIT 1 </s> |
Whose permanent address is different from his or her current address? List his or her first name. | SELECT first_name FROM Students WHERE current_address_id <> permanent_address_id | CREATE TABLE Students (first_name VARCHAR, current_address_id VARCHAR, permanent_address_id VARCHAR) | <s>[INST] Whose permanent address is different from his or her current address? List his or her first name.
context: CREATE TABLE Students (first_name VARCHAR, current_address_id VARCHAR, permanent_address_id VARCHAR) [/INST] SELECT first_name FROM Students WHERE current_address_id <> permanent_address_id </s> |
Which address holds the most number of students currently? List the address id and all lines. | SELECT T1.address_id, T1.line_1, T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Addresses (address_id VARCHAR, line_1 VARCHAR, line_2 VARCHAR); CREATE TABLE Students (current_address_id VARCHAR) | <s>[INST] Which address holds the most number of students currently? List the address id and all lines.
context: CREATE TABLE Addresses (address_id VARCHAR, line_1 VARCHAR, line_2 VARCHAR); CREATE TABLE Students (current_address_id VARCHAR) [/INST] SELECT T1.address_id, T1.line_1, T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.current_address_id GROUP BY T1.address_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
On average, when were the transcripts printed? | SELECT AVG(transcript_date) FROM Transcripts | CREATE TABLE Transcripts (transcript_date INTEGER) | <s>[INST] On average, when were the transcripts printed?
context: CREATE TABLE Transcripts (transcript_date INTEGER) [/INST] SELECT AVG(transcript_date) FROM Transcripts </s> |
When is the first transcript released? List the date and details. | SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date LIMIT 1 | CREATE TABLE Transcripts (transcript_date VARCHAR, other_details VARCHAR) | <s>[INST] When is the first transcript released? List the date and details.
context: CREATE TABLE Transcripts (transcript_date VARCHAR, other_details VARCHAR) [/INST] SELECT transcript_date, other_details FROM Transcripts ORDER BY transcript_date LIMIT 1 </s> |
How many transcripts are released? | SELECT COUNT(*) FROM Transcripts | CREATE TABLE Transcripts (Id VARCHAR) | <s>[INST] How many transcripts are released?
context: CREATE TABLE Transcripts (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Transcripts </s> |
What is the last transcript release date? | SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 | CREATE TABLE Transcripts (transcript_date VARCHAR) | <s>[INST] What is the last transcript release date?
context: CREATE TABLE Transcripts (transcript_date VARCHAR) [/INST] SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 </s> |
How many times at most can a course enrollment result show in different transcripts? Also show the course enrollment id. | SELECT COUNT(*), student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Transcript_Contents (student_course_id VARCHAR) | <s>[INST] How many times at most can a course enrollment result show in different transcripts? Also show the course enrollment id.
context: CREATE TABLE Transcript_Contents (student_course_id VARCHAR) [/INST] SELECT COUNT(*), student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Show the date of the transcript which shows the least number of results, also list the id. | SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR) | <s>[INST] Show the date of the transcript which shows the least number of results, also list the id.
context: CREATE TABLE Transcript_Contents (transcript_id VARCHAR); CREATE TABLE Transcripts (transcript_date VARCHAR, transcript_id VARCHAR) [/INST] SELECT T2.transcript_date, T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY COUNT(*) LIMIT 1 </s> |
Find the semester when both Master students and Bachelor students got enrolled in. | SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Bachelor' | CREATE TABLE Degree_Programs (degree_program_id VARCHAR); CREATE TABLE Student_Enrolment (semester_id VARCHAR, degree_program_id VARCHAR) | <s>[INST] Find the semester when both Master students and Bachelor students got enrolled in.
context: CREATE TABLE Degree_Programs (degree_program_id VARCHAR); CREATE TABLE Student_Enrolment (semester_id VARCHAR, degree_program_id VARCHAR) [/INST] SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id = T2.degree_program_id WHERE degree_summary_name = 'Bachelor' </s> |
How many different addresses do the students currently live? | SELECT COUNT(DISTINCT current_address_id) FROM Students | CREATE TABLE Students (current_address_id VARCHAR) | <s>[INST] How many different addresses do the students currently live?
context: CREATE TABLE Students (current_address_id VARCHAR) [/INST] SELECT COUNT(DISTINCT current_address_id) FROM Students </s> |
List all the student details in reversed lexicographical order. | SELECT other_student_details FROM Students ORDER BY other_student_details DESC | CREATE TABLE Students (other_student_details VARCHAR) | <s>[INST] List all the student details in reversed lexicographical order.
context: CREATE TABLE Students (other_student_details VARCHAR) [/INST] SELECT other_student_details FROM Students ORDER BY other_student_details DESC </s> |
Describe the section h. | SELECT section_description FROM Sections WHERE section_name = 'h' | CREATE TABLE Sections (section_description VARCHAR, section_name VARCHAR) | <s>[INST] Describe the section h.
context: CREATE TABLE Sections (section_description VARCHAR, section_name VARCHAR) [/INST] SELECT section_description FROM Sections WHERE section_name = 'h' </s> |
Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 . | SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' | CREATE TABLE students (first_name VARCHAR, permanent_address_id VARCHAR, cell_mobile_number VARCHAR); CREATE TABLE addresses (address_id VARCHAR, country VARCHAR) | <s>[INST] Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .
context: CREATE TABLE students (first_name VARCHAR, permanent_address_id VARCHAR, cell_mobile_number VARCHAR); CREATE TABLE addresses (address_id VARCHAR, country VARCHAR) [/INST] SELECT t1.first_name FROM students AS t1 JOIN addresses AS t2 ON t1.permanent_address_id = t2.address_id WHERE t2.country = 'haiti' OR t1.cell_mobile_number = '09700166582' </s> |
List the title of all cartoons in alphabetical order. | SELECT Title FROM Cartoon ORDER BY title | CREATE TABLE Cartoon (Title VARCHAR, title VARCHAR) | <s>[INST] List the title of all cartoons in alphabetical order.
context: CREATE TABLE Cartoon (Title VARCHAR, title VARCHAR) [/INST] SELECT Title FROM Cartoon ORDER BY title </s> |
List all cartoon directed by "Ben Jones". | SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" | CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR) | <s>[INST] List all cartoon directed by "Ben Jones".
context: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR) [/INST] SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" </s> |
How many cartoons were written by "Joseph Kuhr"? | SELECT COUNT(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr" | CREATE TABLE Cartoon (Written_by VARCHAR) | <s>[INST] How many cartoons were written by "Joseph Kuhr"?
context: CREATE TABLE Cartoon (Written_by VARCHAR) [/INST] SELECT COUNT(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr" </s> |
list all cartoon titles and their directors ordered by their air date | SELECT title, Directed_by FROM Cartoon ORDER BY Original_air_date | CREATE TABLE Cartoon (title VARCHAR, Directed_by VARCHAR, Original_air_date VARCHAR) | <s>[INST] list all cartoon titles and their directors ordered by their air date
context: CREATE TABLE Cartoon (title VARCHAR, Directed_by VARCHAR, Original_air_date VARCHAR) [/INST] SELECT title, Directed_by FROM Cartoon ORDER BY Original_air_date </s> |
List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti". | SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti" | CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR) | <s>[INST] List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti".
context: CREATE TABLE Cartoon (Title VARCHAR, Directed_by VARCHAR) [/INST] SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti" </s> |
Which country has the most of TV Channels? List the country and number of TV Channels it has. | SELECT Country, COUNT(*) FROM TV_Channel GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE TV_Channel (Country VARCHAR) | <s>[INST] Which country has the most of TV Channels? List the country and number of TV Channels it has.
context: CREATE TABLE TV_Channel (Country VARCHAR) [/INST] SELECT Country, COUNT(*) FROM TV_Channel GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 </s> |
List the number of different series names and contents in the TV Channel table. | SELECT COUNT(DISTINCT series_name), COUNT(DISTINCT content) FROM TV_Channel | CREATE TABLE TV_Channel (series_name VARCHAR, content VARCHAR) | <s>[INST] List the number of different series names and contents in the TV Channel table.
context: CREATE TABLE TV_Channel (series_name VARCHAR, content VARCHAR) [/INST] SELECT COUNT(DISTINCT series_name), COUNT(DISTINCT content) FROM TV_Channel </s> |
What is the content of TV Channel with serial name "Sky Radio"? | SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio" | CREATE TABLE TV_Channel (Content VARCHAR, series_name VARCHAR) | <s>[INST] What is the content of TV Channel with serial name "Sky Radio"?
context: CREATE TABLE TV_Channel (Content VARCHAR, series_name VARCHAR) [/INST] SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio" </s> |
What is the Package Option of TV Channel with serial name "Sky Radio"? | SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio" | CREATE TABLE TV_Channel (Package_Option VARCHAR, series_name VARCHAR) | <s>[INST] What is the Package Option of TV Channel with serial name "Sky Radio"?
context: CREATE TABLE TV_Channel (Package_Option VARCHAR, series_name VARCHAR) [/INST] SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio" </s> |
How many TV Channel using language English? | SELECT COUNT(*) FROM TV_Channel WHERE LANGUAGE = "English" | CREATE TABLE TV_Channel (LANGUAGE VARCHAR) | <s>[INST] How many TV Channel using language English?
context: CREATE TABLE TV_Channel (LANGUAGE VARCHAR) [/INST] SELECT COUNT(*) FROM TV_Channel WHERE LANGUAGE = "English" </s> |
List the language used least number of TV Channel. List language and number of TV Channel. | SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE TV_Channel (LANGUAGE VARCHAR) | <s>[INST] List the language used least number of TV Channel. List language and number of TV Channel.
context: CREATE TABLE TV_Channel (LANGUAGE VARCHAR) [/INST] SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY COUNT(*) LIMIT 1 </s> |
List each language and the number of TV Channels using it. | SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE | CREATE TABLE TV_Channel (LANGUAGE VARCHAR) | <s>[INST] List each language and the number of TV Channels using it.
context: CREATE TABLE TV_Channel (LANGUAGE VARCHAR) [/INST] SELECT LANGUAGE, COUNT(*) FROM TV_Channel GROUP BY LANGUAGE </s> |
What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name. | SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!" | CREATE TABLE Cartoon (Channel VARCHAR, Title VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR) | <s>[INST] What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name.
context: CREATE TABLE Cartoon (Channel VARCHAR, Title VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR) [/INST] SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!" </s> |
List the title of all Cartoons showed on TV Channel with series name "Sky Radio". | SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" | CREATE TABLE Cartoon (Title VARCHAR, Channel VARCHAR); CREATE TABLE TV_Channel (id VARCHAR, series_name VARCHAR) | <s>[INST] List the title of all Cartoons showed on TV Channel with series name "Sky Radio".
context: CREATE TABLE Cartoon (Title VARCHAR, Channel VARCHAR); CREATE TABLE TV_Channel (id VARCHAR, series_name VARCHAR) [/INST] SELECT T2.Title FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio" </s> |
List the Episode of all TV series sorted by rating. | SELECT Episode FROM TV_series ORDER BY rating | CREATE TABLE TV_series (Episode VARCHAR, rating VARCHAR) | <s>[INST] List the Episode of all TV series sorted by rating.
context: CREATE TABLE TV_series (Episode VARCHAR, rating VARCHAR) [/INST] SELECT Episode FROM TV_series ORDER BY rating </s> |
List top 3 highest Rating TV series. List the TV series's Episode and Rating. | SELECT Episode, Rating FROM TV_series ORDER BY Rating DESC LIMIT 3 | CREATE TABLE TV_series (Episode VARCHAR, Rating VARCHAR) | <s>[INST] List top 3 highest Rating TV series. List the TV series's Episode and Rating.
context: CREATE TABLE TV_series (Episode VARCHAR, Rating VARCHAR) [/INST] SELECT Episode, Rating FROM TV_series ORDER BY Rating DESC LIMIT 3 </s> |
What is minimum and maximum share of TV series? | SELECT MAX(SHARE), MIN(SHARE) FROM TV_series | CREATE TABLE TV_series (SHARE INTEGER) | <s>[INST] What is minimum and maximum share of TV series?
context: CREATE TABLE TV_series (SHARE INTEGER) [/INST] SELECT MAX(SHARE), MIN(SHARE) FROM TV_series </s> |
What is the air date of TV series with Episode "A Love of a Lifetime"? | SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime" | CREATE TABLE TV_series (Air_Date VARCHAR, Episode VARCHAR) | <s>[INST] What is the air date of TV series with Episode "A Love of a Lifetime"?
context: CREATE TABLE TV_series (Air_Date VARCHAR, Episode VARCHAR) [/INST] SELECT Air_Date FROM TV_series WHERE Episode = "A Love of a Lifetime" </s> |
What is Weekly Rank of TV series with Episode "A Love of a Lifetime"? | SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime" | CREATE TABLE TV_series (Weekly_Rank VARCHAR, Episode VARCHAR) | <s>[INST] What is Weekly Rank of TV series with Episode "A Love of a Lifetime"?
context: CREATE TABLE TV_series (Weekly_Rank VARCHAR, Episode VARCHAR) [/INST] SELECT Weekly_Rank FROM TV_series WHERE Episode = "A Love of a Lifetime" </s> |
What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name. | SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime" | CREATE TABLE TV_series (Channel VARCHAR, Episode VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR) | <s>[INST] What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name.
context: CREATE TABLE TV_series (Channel VARCHAR, Episode VARCHAR); CREATE TABLE TV_Channel (series_name VARCHAR, id VARCHAR) [/INST] SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime" </s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.