answer stringlengths 18 557 | context stringlengths 27 489 | question stringlengths 12 244 | text stringlengths 275 1.7k |
|---|---|---|---|
SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = "Cancelled" | CREATE TABLE Lessons (lesson_status_code VARCHAR) | How many lessons were in cancelled state? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Lessons WHERE lesson_status_code = "Cancelled" Context: CREATE TABLE Lessons (lesson_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many lessons were in cancelled state? The answer to your q... |
SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%" | CREATE TABLE Lessons (lesson_id VARCHAR, staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) | List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%" Context: CREATE TABLE Lessons (lesson_id VARCHAR, staff_id VARCHAR); CREATE TABLE Staff (st... |
SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" | CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR) | How many lessons taught by staff whose first name has letter 'a' in it? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" Context: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query ... |
SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) | How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? | <s>[INST] Given the following SQL query and context: Query: SELECT SUM(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" Context: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, las... |
SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name VARCHAR) | What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" Context: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (staff_id VARCHAR, first_name VARCHAR, last_name... |
SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray" | CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR); CREATE TABLE Lessons (customer_id VARCHAR) | How many lesson does customer with first name Ray took? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray" Context: CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR); CREATE TABLE Lessons (customer_id VARCHAR) [/INST] Based on the pr... |
SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff | CREATE TABLE Customers (last_name VARCHAR); CREATE TABLE Staff (last_name VARCHAR) | Which last names are both used by customers and by staff? | <s>[INST] Given the following SQL query and context: Query: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff Context: CREATE TABLE Customers (last_name VARCHAR); CREATE TABLE Staff (last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which last names are both u... |
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id | CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (first_name VARCHAR); CREATE TABLE Staff (first_name VARCHAR, staff_id VARCHAR) | What is the first name of the staff who did not give any lesson? | <s>[INST] Given the following SQL query and context: Query: SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id Context: CREATE TABLE Lessons (staff_id VARCHAR); CREATE TABLE Staff (first_name VARCHAR); CREATE TABLE Staff (first_name VARCHAR, staff_i... |
SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Lessons (vehicle_id VARCHAR); CREATE TABLE Vehicles (vehicle_id VARCHAR, vehicle_details VARCHAR) | What is the id and detail of the vehicle used in lessons for most of the times? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.vehicle_id, T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Lessons (vehicle_id VARCHAR); CREATE TABLE Vehicles (vehicle_id VARCHAR... |
SELECT COUNT(*) FROM Faculty | CREATE TABLE Faculty (Id VARCHAR) | How many faculty do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Faculty Context: CREATE TABLE Faculty (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty do we have? The answer to your question is: SELECT COUNT(*) FROM Faculty. [/s> |
SELECT DISTINCT rank FROM Faculty | CREATE TABLE Faculty (rank VARCHAR) | What ranks do we have for faculty? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT rank FROM Faculty Context: CREATE TABLE Faculty (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What ranks do we have for faculty? The answer to your question is: SELECT DISTINCT rank FROM Faculty. [/s> |
SELECT DISTINCT building FROM Faculty | CREATE TABLE Faculty (building VARCHAR) | Show all the distinct buildings that have faculty rooms. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT building FROM Faculty Context: CREATE TABLE Faculty (building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the distinct buildings that have faculty rooms. The answer to your question is: SELECT DISTIN... |
SELECT rank, Fname, Lname FROM Faculty | CREATE TABLE Faculty (rank VARCHAR, Fname VARCHAR, Lname VARCHAR) | Show the rank, first name, and last name for all the faculty. | <s>[INST] Given the following SQL query and context: Query: SELECT rank, Fname, Lname FROM Faculty Context: CREATE TABLE Faculty (rank VARCHAR, Fname VARCHAR, Lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the rank, first name, and last name for all the faculty. The answer to... |
SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F' | CREATE TABLE Faculty (Fname VARCHAR, Lname VARCHAR, phone VARCHAR, Sex VARCHAR) | Show the first name, last name, and phone number for all female faculty members. | <s>[INST] Given the following SQL query and context: Query: SELECT Fname, Lname, phone FROM Faculty WHERE Sex = 'F' Context: CREATE TABLE Faculty (Fname VARCHAR, Lname VARCHAR, phone VARCHAR, Sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the first name, last name, and phone nu... |
SELECT FacID FROM Faculty WHERE Sex = 'M' | CREATE TABLE Faculty (FacID VARCHAR, Sex VARCHAR) | Show ids for all the male faculty. | <s>[INST] Given the following SQL query and context: Query: SELECT FacID FROM Faculty WHERE Sex = 'M' Context: CREATE TABLE Faculty (FacID VARCHAR, Sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids for all the male faculty. The answer to your question is: SELECT FacID FROM Fac... |
SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor" | CREATE TABLE Faculty (Sex VARCHAR, Rank VARCHAR) | How many female Professors do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor" Context: CREATE TABLE Faculty (Sex VARCHAR, Rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many female Professors do we have? The answer to your quest... |
SELECT phone, room, building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince" | CREATE TABLE Faculty (phone VARCHAR, room VARCHAR, building VARCHAR, Fname VARCHAR, Lname VARCHAR) | Show the phone, room, and building for the faculty named Jerry Prince. | <s>[INST] Given the following SQL query and context: Query: SELECT phone, room, building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince" Context: CREATE TABLE Faculty (phone VARCHAR, room VARCHAR, building VARCHAR, Fname VARCHAR, Lname VARCHAR) [/INST] Based on the provided SQL query and context, your question ... |
SELECT COUNT(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" | CREATE TABLE Faculty (Rank VARCHAR, building VARCHAR) | How many Professors are in building NEB? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" Context: CREATE TABLE Faculty (Rank VARCHAR, building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many Professors are in building NEB? The answer... |
SELECT fname, lname FROM Faculty WHERE Rank = "Instructor" | CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, Rank VARCHAR) | Show the first name and last name for all the instructors. | <s>[INST] Given the following SQL query and context: Query: SELECT fname, lname FROM Faculty WHERE Rank = "Instructor" Context: CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, Rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the first name and last name for all the instructo... |
SELECT building, COUNT(*) FROM Faculty GROUP BY building | CREATE TABLE Faculty (building VARCHAR) | Show all the buildings along with the number of faculty members the buildings have. | <s>[INST] Given the following SQL query and context: Query: SELECT building, COUNT(*) FROM Faculty GROUP BY building Context: CREATE TABLE Faculty (building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the buildings along with the number of faculty members the buildings have.... |
SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Faculty (building VARCHAR) | Which building has most faculty members? | <s>[INST] Given the following SQL query and context: Query: SELECT building FROM Faculty GROUP BY building ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Faculty (building VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which building has most faculty members? The answer to your qu... |
SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING COUNT(*) >= 10 | CREATE TABLE Faculty (building VARCHAR, rank VARCHAR) | Show all the buildings that have at least 10 professors. | <s>[INST] Given the following SQL query and context: Query: SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING COUNT(*) >= 10 Context: CREATE TABLE Faculty (building VARCHAR, rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the buildings that have... |
SELECT rank, COUNT(*) FROM Faculty GROUP BY rank | CREATE TABLE Faculty (rank VARCHAR) | For each faculty rank, show the number of faculty members who have it. | <s>[INST] Given the following SQL query and context: Query: SELECT rank, COUNT(*) FROM Faculty GROUP BY rank Context: CREATE TABLE Faculty (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each faculty rank, show the number of faculty members who have it. The answer to your quest... |
SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex | CREATE TABLE Faculty (rank VARCHAR, sex VARCHAR) | Show all the ranks and the number of male and female faculty for each rank. | <s>[INST] Given the following SQL query and context: Query: SELECT rank, sex, COUNT(*) FROM Faculty GROUP BY rank, sex Context: CREATE TABLE Faculty (rank VARCHAR, sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the ranks and the number of male and female faculty for each ra... |
SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE Faculty (rank VARCHAR) | Which rank has the smallest number of faculty members? | <s>[INST] Given the following SQL query and context: Query: SELECT rank FROM Faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Faculty (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which rank has the smallest number of faculty members? The answer to your quest... |
SELECT sex, COUNT(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex | CREATE TABLE Faculty (sex VARCHAR, rank VARCHAR) | Show the number of male and female assistant professors. | <s>[INST] Given the following SQL query and context: Query: SELECT sex, COUNT(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex Context: CREATE TABLE Faculty (sex VARCHAR, rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of male and female assistant professors. The... |
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" | CREATE TABLE Student (advisor VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) | What are the first name and last name of Linda Smith's advisor? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" Context: CREATE TABLE Student (advisor VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname V... |
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor" | CREATE TABLE Student (StuID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty (FacID VARCHAR, rank VARCHAR) | Show the ids of students whose advisors are professors. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor" Context: CREATE TABLE Student (StuID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty (FacID VARCHAR, rank VARCHAR) [/INST] Based on the provided SQL quer... |
SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich" | CREATE TABLE Faculty (FacID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Student (fname VARCHAR, lname VARCHAR, advisor VARCHAR) | Show first name and last name for all the students advised by Michael Goodrich. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.fname, T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich" Context: CREATE TABLE Faculty (FacID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Student (fname VARCHAR, lnam... |
SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID | CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) | Show the faculty id of each faculty member, along with the number of students he or she advises. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID Context: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question ... |
SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank | CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (rank VARCHAR, FacID VARCHAR) | Show all the faculty ranks and the number of students advised by each rank. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank Context: CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (rank VARCHAR, FacID VARCHAR) [/INST] Based on the provided SQL query and context, yo... |
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) | What are the first and last name of the faculty who has the most students? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Student (advisor VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR) [/INST... |
SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2 | CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) | Show the ids for all the faculty members who have at least 2 students. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING COUNT(*) >= 2 Context: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Student (advisor VARCHAR) [/INST] Based on the provided SQL query and context, you... |
SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student | CREATE TABLE Faculty (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR) | Show ids for the faculty members who don't advise any student. | <s>[INST] Given the following SQL query and context: Query: SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student Context: CREATE TABLE Faculty (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids f... |
SELECT activity_name FROM Activity | CREATE TABLE Activity (activity_name VARCHAR) | What activities do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT activity_name FROM Activity Context: CREATE TABLE Activity (activity_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What activities do we have? The answer to your question is: SELECT activity_name FROM Activity. [/s... |
SELECT COUNT(*) FROM Activity | CREATE TABLE Activity (Id VARCHAR) | How many activities do we have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Activity Context: CREATE TABLE Activity (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many activities do we have? The answer to your question is: SELECT COUNT(*) FROM Activity. [/s> |
SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in | CREATE TABLE Faculty_participates_in (FacID VARCHAR) | How many faculty members participate in an activity? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in Context: CREATE TABLE Faculty_participates_in (FacID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty members participate in an activity? The answer to yo... |
SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in | CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR) | Show the ids of the faculty who don't participate in any activity. | <s>[INST] Given the following SQL query and context: Query: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in Context: CREATE TABLE Faculty (FacID VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ids o... |
SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student | CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR, advisor VARCHAR) | Show the ids of all the faculty members who participate in an activity and advise a student. | <s>[INST] Given the following SQL query and context: Query: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student Context: CREATE TABLE Student (FacID VARCHAR, advisor VARCHAR); CREATE TABLE Faculty_participates_in (FacID VARCHAR, advisor VARCHAR) [/INST] Based on the provided SQL query and co... |
SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" | CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR) | How many activities does Mark Giuliano participate in? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" Context: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, ln... |
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" | CREATE TABLE Activity (activity_name VARCHAR, actid VARCHAR); CREATE TABLE Faculty (facID VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR) | Show the names of all the activities Mark Giuliano participates in. | <s>[INST] Given the following SQL query and context: Query: SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano" Context: CREATE TABLE Activity (activity_name VARCHAR, actid VARCH... |
SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID | CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) | Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.fname, T1.lname, COUNT(*), T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID Context: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacI... |
SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID | CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) | Show all the activity names and the number of faculty involved in each activity. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID Context: CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) [/INST... |
SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VARCHAR, FacID VARCHAR, facID VARCHAR) | What is the first and last name of the faculty participating in the most activities? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Faculty_participates_in (facID VARCHAR); CREATE TABLE Faculty (fname VARCHAR, lname VA... |
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) | What is the name of the activity that has the most faculty members involved in? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Faculty_participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, ... |
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in | CREATE TABLE Participates_in (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) | Show the ids of the students who don't participate in any activity. | <s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in Context: CREATE TABLE Participates_in (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ids of the students w... |
SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20 | CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR, age INTEGER) | Show the ids for all the students who participate in an activity and are under 20. | <s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20 Context: CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Participates_in (StuID VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your... |
SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Participates_in (StuID VARCHAR) | What is the first and last name of the student participating in the most activities? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Participates_in (StuID VAR... |
SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) | What is the name of the activity with the most students? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Participates_in (actID VARCHAR); CREATE TABLE Activity (activity_name VARCHAR, actID VARCHAR) [... |
SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' | CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) | Find the first names of the faculty members who are playing Canoeing or Kayaking. | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' Context: CREATE TABLE activity (activity_name ... |
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' | CREATE TABLE faculty (lname VARCHAR, rank VARCHAR); CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) | Find the first names of professors who are not playing Canoeing or Kayaking. | <s>[INST] Given the following SQL query and context: Query: SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name =... |
SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WH... | CREATE TABLE activity (activity_name VARCHAR); CREATE TABLE Faculty_participates_in (facID VARCHAR, actid VARCHAR); CREATE TABLE Faculty (lname VARCHAR, facID VARCHAR) | Find the first names of the faculty members who participate in Canoeing and Kayaking. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.fa... |
SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' | CREATE TABLE activity (actid VARCHAR, activity_name VARCHAR); CREATE TABLE participates_in (stuid VARCHAR) | Find the ids of the students who participate in Canoeing and Kayaking. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' Contex... |
SELECT name FROM airports WHERE city = 'Goroka' | CREATE TABLE airports (name VARCHAR, city VARCHAR) | Find the name of the airport in the city of Goroka. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM airports WHERE city = 'Goroka' Context: CREATE TABLE airports (name VARCHAR, city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the airport in the city of Goroka. The answer to your question i... |
SELECT name, city, country, elevation FROM airports WHERE city = 'New York' | CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) | Find the name, city, country, and altitude (or elevation) of the airports in the city of New York. | <s>[INST] Given the following SQL query and context: Query: SELECT name, city, country, elevation FROM airports WHERE city = 'New York' Context: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, ci... |
SELECT COUNT(*) FROM airlines | CREATE TABLE airlines (Id VARCHAR) | How many airlines are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airlines Context: CREATE TABLE airlines (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many airlines are there? The answer to your question is: SELECT COUNT(*) FROM airlines. [/s> |
SELECT COUNT(*) FROM airlines WHERE country = 'Russia' | CREATE TABLE airlines (country VARCHAR) | How many airlines does Russia has? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airlines WHERE country = 'Russia' Context: CREATE TABLE airlines (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many airlines does Russia has? The answer to your question is: SELECT COUNT(*) FR... |
SELECT MAX(elevation) FROM airports WHERE country = 'Iceland' | CREATE TABLE airports (elevation INTEGER, country VARCHAR) | What is the maximum elevation of all airports in the country of Iceland? | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(elevation) FROM airports WHERE country = 'Iceland' Context: CREATE TABLE airports (elevation INTEGER, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the maximum elevation of all airports in the countr... |
SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' | CREATE TABLE airports (name VARCHAR, country VARCHAR) | Find the name of the airports located in Cuba or Argentina. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' Context: CREATE TABLE airports (name VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the airports located in Cuba or Arg... |
SELECT country FROM airlines WHERE name LIKE 'Orbit%' | CREATE TABLE airlines (country VARCHAR, name VARCHAR) | Find the country of the airlines whose name starts with 'Orbit'. | <s>[INST] Given the following SQL query and context: Query: SELECT country FROM airlines WHERE name LIKE 'Orbit%' Context: CREATE TABLE airlines (country VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the country of the airlines whose name starts with 'Orbit'. The ans... |
SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 | CREATE TABLE airports (name VARCHAR, elevation INTEGER) | Find the name of airports whose altitude is between -50 and 50. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 Context: CREATE TABLE airports (name VARCHAR, elevation INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of airports whose altitude is between -50 and 50.... |
SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 | CREATE TABLE airports (country VARCHAR, elevation VARCHAR) | Which country is the airport that has the highest altitude located in? | <s>[INST] Given the following SQL query and context: Query: SELECT country FROM airports ORDER BY elevation DESC LIMIT 1 Context: CREATE TABLE airports (country VARCHAR, elevation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which country is the airport that has the highest altitude l... |
SELECT COUNT(*) FROM airports WHERE name LIKE '%International%' | CREATE TABLE airports (name VARCHAR) | Find the number of airports whose name contain the word 'International'. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airports WHERE name LIKE '%International%' Context: CREATE TABLE airports (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of airports whose name contain the word 'International'. The an... |
SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland' | CREATE TABLE airports (city VARCHAR, country VARCHAR) | How many different cities do have some airport in the country of Greenland? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT city) FROM airports WHERE country = 'Greenland' Context: CREATE TABLE airports (city VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different cities do have some airport in the co... |
SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) | Find the number of routes operated by American Airlines. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' Context: CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, ... |
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' | CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR) | Find the number of routes whose destination airports are in Canada. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' Context: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR) [/INST] Based on the provided SQL query and context, your question is:... |
SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1 | CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) | Find the name, city, and country of the airport that has the lowest altitude. | <s>[INST] Given the following SQL query and context: Query: SELECT name, city, country FROM airports ORDER BY elevation LIMIT 1 Context: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, city, and ... |
SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1 | CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) | Find the name, city, and country of the airport that has the highest latitude. | <s>[INST] Given the following SQL query and context: Query: SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1 Context: CREATE TABLE airports (name VARCHAR, city VARCHAR, country VARCHAR, elevation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, city,... |
SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) | Find the name and city of the airport which is the destination of the most number of routes. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.city, T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (dst_apid VAR... |
SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10 | CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) | Find the names of the top 10 airlines that operate the most number of routes. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10 Context: CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) [/INST] Based on the provided SQ... |
SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) | Find the name and city of the airport which is the source for the most number of flight routes. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.city, T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airports (name VARCHAR, city VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VAR... |
SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' | CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) | Find the number of different airports which are the destinations of the American Airlines. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' Context: CREATE TABLE routes (alid VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) [/INST] Based on the provided SQL que... |
SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE airlines (country VARCHAR) | Which countries has the most number of airlines? | <s>[INST] Given the following SQL query and context: Query: SELECT country FROM airlines GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airlines (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which countries has the most number of airlines? The answer to ... |
SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE airlines (country VARCHAR, active VARCHAR) | Which countries has the most number of airlines whose active status is 'Y'? | <s>[INST] Given the following SQL query and context: Query: SELECT country FROM airlines WHERE active = 'Y' GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airlines (country VARCHAR, active VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which countries has the most... |
SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC | CREATE TABLE airlines (country VARCHAR) | List all countries and their number of airlines in the descending order of number of airlines. | <s>[INST] Given the following SQL query and context: Query: SELECT country, COUNT(*) FROM airlines GROUP BY country ORDER BY COUNT(*) DESC Context: CREATE TABLE airlines (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all countries and their number of airlines in the descen... |
SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC | CREATE TABLE airports (country VARCHAR) | How many airports are there per country? Order the countries by decreasing number of airports. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC Context: CREATE TABLE airports (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many airports are there per country? Order the countries ... |
SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC | CREATE TABLE airports (city VARCHAR, country VARCHAR) | How many airports are there per city in the United States? Order the cities by decreasing number of airports. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC Context: CREATE TABLE airports (city VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many airports are... |
SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3 | CREATE TABLE airports (city VARCHAR, country VARCHAR) | Return the cities with more than 3 airports in the United States. | <s>[INST] Given the following SQL query and context: Query: SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING COUNT(*) > 3 Context: CREATE TABLE airports (city VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the cities with more than 3... |
SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3) | CREATE TABLE airports (city VARCHAR) | How many cities are there that have more than 3 airports? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM (SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 3) Context: CREATE TABLE airports (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many cities are there that have more than 3 airports? Th... |
SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1 | CREATE TABLE airports (city VARCHAR) | List the cities which have more than one airport and number of airports. | <s>[INST] Given the following SQL query and context: Query: SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1 Context: CREATE TABLE airports (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the cities which have more than one airport and number of airports. ... |
SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) | CREATE TABLE airports (city VARCHAR) | List the cities which have more than 2 airports sorted by the number of airports. | <s>[INST] Given the following SQL query and context: Query: SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*) Context: CREATE TABLE airports (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the cities which have more than 2 airports sorted by the num... |
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name | CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) | Find the number of routes for each source airport and the airport name. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name Context: CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) [/INST] Based on the provided SQL query and context, yo... |
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC | CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) | Find the number of routes and airport name for each source airport, order the results by decreasing number of routes. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY COUNT(*) DESC Context: CREATE TABLE airports (name VARCHAR, apid VARCHAR); CREATE TABLE routes (src_apid VARCHAR) [/INST] Based on the provided SQ... |
SELECT AVG(elevation), country FROM airports GROUP BY country | CREATE TABLE airports (country VARCHAR, elevation INTEGER) | Find the average elevation of all airports for each country. | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(elevation), country FROM airports GROUP BY country Context: CREATE TABLE airports (country VARCHAR, elevation INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average elevation of all airports for each country... |
SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2 | CREATE TABLE airports (city VARCHAR) | Find the cities which have exactly two airports. | <s>[INST] Given the following SQL query and context: Query: SELECT city FROM airports GROUP BY city HAVING COUNT(*) = 2 Context: CREATE TABLE airports (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the cities which have exactly two airports. The answer to your question is: SE... |
SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name | CREATE TABLE airlines (country VARCHAR, name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) | For each country and airline name, how many routes are there? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.country, T1.name, COUNT(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country, T1.name Context: CREATE TABLE airlines (country VARCHAR, name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) [/INST] Based on the p... |
SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' | CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR) | Find the number of routes with destination airports in Italy. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' Context: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context... |
SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' | CREATE TABLE routes (dst_apid VARCHAR, alid VARCHAR); CREATE TABLE airports (apid VARCHAR, country VARCHAR); CREATE TABLE airlines (alid VARCHAR, name VARCHAR) | Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' Context: CREATE TABLE routes (dst_apid VARCHAR, alid VARCHAR); CREATE TABLE air... |
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' | CREATE TABLE airports (apid VARCHAR, name VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) | Find the number of routes that have destination John F Kennedy International Airport. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' Context: CREATE TABLE airports (apid VARCHAR, name VARCHAR); CREATE TABLE routes (dst_apid VARCHAR) [/INST] Based on the provi... |
SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') | CREATE TABLE airports (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE routes (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) | Find the number of routes from the United States to Canada. | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') Context: CREATE TABLE airports (dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, cou... |
SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') | CREATE TABLE routes (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR); CREATE TABLE airports (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid VARCHAR, country VARCHAR) | Find the id of routes whose source and destination airports are in the United States. | <s>[INST] Given the following SQL query and context: Query: SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') Context: CREATE TABLE routes (rid VARCHAR, dst_apid VARCHAR, src_apid VARCHAR, apid... |
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) | Find the name of airline which runs the most number of routes. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airlines (name VARCHAR, alid VARCHAR); CREATE TABLE routes (alid VARCHAR) [/INST] Based on the provided SQL query an... |
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE routes (src_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) | Find the busiest source airport that runs most number of routes in China. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE routes (src_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country... |
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country VARCHAR) | Find the busiest destination airport that runs most number of routes in China. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE routes (dst_apid VARCHAR); CREATE TABLE airports (name VARCHAR, apid VARCHAR, country... |
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 | CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) | What is the id of the most recent order? | <s>[INST] Given the following SQL query and context: Query: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1 Context: CREATE TABLE orders (order_id VARCHAR, date_order_placed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the most recent order? The a... |
SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1 | CREATE TABLE orders (order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR) | what are the order id and customer id of the oldest order? | <s>[INST] Given the following SQL query and context: Query: SELECT order_id, customer_id FROM orders ORDER BY date_order_placed LIMIT 1 Context: CREATE TABLE orders (order_id VARCHAR, customer_id VARCHAR, date_order_placed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what are the orde... |
SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" | CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR) | Find the id of the order whose shipment tracking number is "3452". | <s>[INST] Given the following SQL query and context: Query: SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" Context: CREATE TABLE shipments (order_id VARCHAR, shipment_tracking_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id of the order whose sh... |
SELECT order_item_id FROM order_items WHERE product_id = 11 | CREATE TABLE order_items (order_item_id VARCHAR, product_id VARCHAR) | Find the ids of all the order items whose product id is 11. | <s>[INST] Given the following SQL query and context: Query: SELECT order_item_id FROM order_items WHERE product_id = 11 Context: CREATE TABLE order_items (order_item_id VARCHAR, product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ids of all the order items whose product i... |
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" | CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR) | List the name of all the distinct customers who have orders with status "Packing". | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" Context: CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_name VARCHAR... |
SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" | CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_details VARCHAR, customer_id VARCHAR) | Find the details of all the distinct customers who have orders with status "On Road". | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" Context: CREATE TABLE orders (customer_id VARCHAR, order_status VARCHAR); CREATE TABLE customers (customer_details V... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.