answer stringlengths 18 557 | context stringlengths 27 489 | question stringlengths 12 244 | text stringlengths 275 1.7k |
|---|---|---|---|
SELECT Name FROM country ORDER BY Population DESC LIMIT 3 | CREATE TABLE country (Name VARCHAR, Population VARCHAR) | What are names of countries with the top 3 largest population? | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM country ORDER BY Population DESC LIMIT 3 Context: CREATE TABLE country (Name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are names of countries with the top 3 largest population? The... |
SELECT Name FROM country ORDER BY Population LIMIT 3 | CREATE TABLE country (Name VARCHAR, Population VARCHAR) | What are the names of the nations with the 3 lowest populations? | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM country ORDER BY Population LIMIT 3 Context: CREATE TABLE country (Name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the nations with the 3 lowest populations? The an... |
SELECT COUNT(*) FROM country WHERE continent = "Asia" | CREATE TABLE country (continent VARCHAR) | how many countries are in Asia? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM country WHERE continent = "Asia" Context: CREATE TABLE country (continent VARCHAR) [/INST] Based on the provided SQL query and context, your question is: how many countries are in Asia? The answer to your question is: SELECT COUNT(*) FROM ... |
SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" | CREATE TABLE country (Name VARCHAR, continent VARCHAR, Population VARCHAR) | What are the names of the countries that are in the continent of Europe and have a population of 80000? | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" Context: CREATE TABLE country (Name VARCHAR, continent VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the co... |
SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000 | CREATE TABLE country (population INTEGER, surfacearea INTEGER, continent VARCHAR) | What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 ? | <s>[INST] Given the following SQL query and context: Query: SELECT SUM(population), AVG(surfacearea) FROM country WHERE continent = "north america" AND surfacearea > 3000 Context: CREATE TABLE country (population INTEGER, surfacearea INTEGER, continent VARCHAR) [/INST] Based on the provided SQL query and context, your ... |
SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000 | CREATE TABLE city (name VARCHAR, Population INTEGER) | What are the cities whose population is between 160000 and 900000? | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000 Context: CREATE TABLE city (name VARCHAR, Population INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the cities whose population is between 160000 and 900... |
SELECT name FROM city WHERE population BETWEEN 160000 AND 900000 | CREATE TABLE city (name VARCHAR, population INTEGER) | Return the names of cities that have a population between 160000 and 900000 . | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM city WHERE population BETWEEN 160000 AND 900000 Context: CREATE TABLE city (name VARCHAR, population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Return the names of cities that have a population between 1600... |
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE countrylanguage (LANGUAGE VARCHAR) | Which language is spoken by the largest number of countries? | <s>[INST] Given the following SQL query and context: Query: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE countrylanguage (LANGUAGE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which language is spoken by the largest number... |
SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode | CREATE TABLE countrylanguage (LANGUAGE VARCHAR, CountryCode VARCHAR, Percentage INTEGER) | What is the language spoken by the largest percentage of people in each country? | <s>[INST] Given the following SQL query and context: Query: SELECT LANGUAGE, CountryCode, MAX(Percentage) FROM countrylanguage GROUP BY CountryCode Context: CREATE TABLE countrylanguage (LANGUAGE VARCHAR, CountryCode VARCHAR, Percentage INTEGER) [/INST] Based on the provided SQL query and context, your question is: Wha... |
SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | CREATE TABLE countrylanguage (Percentage INTEGER, CountryCode VARCHAR, LANGUAGE VARCHAR) | What is the total number of countries where Spanish is spoken by the largest percentage of people? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode Context: CREATE TABLE countrylanguage (Percentage INTEGER, CountryCode VARCHAR, LANGUAGE VARCHAR) [/INST] Based on the provided SQL query and context, your qu... |
SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | CREATE TABLE countrylanguage (CountryCode VARCHAR, Percentage INTEGER, LANGUAGE VARCHAR) | What are the codes of countries where Spanish is spoken by the largest percentage of people? | <s>[INST] Given the following SQL query and context: Query: SELECT CountryCode, MAX(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode Context: CREATE TABLE countrylanguage (CountryCode VARCHAR, Percentage INTEGER, LANGUAGE VARCHAR) [/INST] Based on the provided SQL query and context, your... |
SELECT COUNT(*) FROM conductor | CREATE TABLE conductor (Id VARCHAR) | How many conductors are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM conductor Context: CREATE TABLE conductor (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many conductors are there? The answer to your question is: SELECT COUNT(*) FROM conductor. [/s> |
SELECT Name FROM conductor ORDER BY Age | CREATE TABLE conductor (Name VARCHAR, Age VARCHAR) | List the names of conductors in ascending order of age. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM conductor ORDER BY Age Context: CREATE TABLE conductor (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of conductors in ascending order of age. The answer to your question is: S... |
SELECT Name FROM conductor WHERE Nationality <> 'USA' | CREATE TABLE conductor (Name VARCHAR, Nationality VARCHAR) | What are the names of conductors whose nationalities are not "USA"? | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM conductor WHERE Nationality <> 'USA' Context: CREATE TABLE conductor (Name VARCHAR, Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of conductors whose nationalities are not "USA"?... |
SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC | CREATE TABLE orchestra (Record_Company VARCHAR, Year_of_Founded VARCHAR) | What are the record companies of orchestras in descending order of years in which they were founded? | <s>[INST] Given the following SQL query and context: Query: SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC Context: CREATE TABLE orchestra (Record_Company VARCHAR, Year_of_Founded VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the record companies of orchest... |
SELECT AVG(Attendance) FROM SHOW | CREATE TABLE SHOW (Attendance INTEGER) | What is the average attendance of shows? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(Attendance) FROM SHOW Context: CREATE TABLE SHOW (Attendance INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average attendance of shows? The answer to your question is: SELECT AVG(Attendance) FROM SHOW. [... |
SELECT MAX(SHARE), MIN(SHARE) FROM performance WHERE TYPE <> "Live final" | CREATE TABLE performance (SHARE INTEGER, TYPE VARCHAR) | What are the maximum and minimum share of performances whose type is not "Live final". | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(SHARE), MIN(SHARE) FROM performance WHERE TYPE <> "Live final" Context: CREATE TABLE performance (SHARE INTEGER, TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the maximum and minimum share of performan... |
SELECT COUNT(DISTINCT Nationality) FROM conductor | CREATE TABLE conductor (Nationality VARCHAR) | How many different nationalities do conductors have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT Nationality) FROM conductor Context: CREATE TABLE conductor (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different nationalities do conductors have? The answer to your question is: ... |
SELECT Name FROM conductor ORDER BY Year_of_Work DESC | CREATE TABLE conductor (Name VARCHAR, Year_of_Work VARCHAR) | List names of conductors in descending order of years of work. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM conductor ORDER BY Year_of_Work DESC Context: CREATE TABLE conductor (Name VARCHAR, Year_of_Work VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List names of conductors in descending order of years of work. The... |
SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 | CREATE TABLE conductor (Name VARCHAR, Year_of_Work VARCHAR) | List the name of the conductor with the most years of work. | <s>[INST] Given the following SQL query and context: Query: SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 Context: CREATE TABLE conductor (Name VARCHAR, Year_of_Work VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of the conductor with the most years of work... |
SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID | CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR); CREATE TABLE orchestra (Orchestra VARCHAR, Conductor_ID VARCHAR) | Show the names of conductors and the orchestras they have conducted. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID Context: CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR); CREATE TABLE orchestra (Orchestra VARCHAR, Conductor_ID VARCHAR) [/INST] Based on ... |
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 | CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR) | Show the names of conductors that have conducted more than one orchestras. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 Context: CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR) [/INS... |
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR) | Show the name of the conductor that has conducted the most number of orchestras. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VAR... |
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 | CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR) | Please show the name of the conductor that has conducted orchestras founded after 2008. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 Context: CREATE TABLE orchestra (Conductor_ID VARCHAR); CREATE TABLE conductor (Name VARCHAR, Conductor_ID VARCHAR) [/INST] Based on the ... |
SELECT Record_Company, COUNT(*) FROM orchestra GROUP BY Record_Company | CREATE TABLE orchestra (Record_Company VARCHAR) | Please show the different record companies and the corresponding number of orchestras. | <s>[INST] Given the following SQL query and context: Query: SELECT Record_Company, COUNT(*) FROM orchestra GROUP BY Record_Company Context: CREATE TABLE orchestra (Record_Company VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the different record companies and the correspond... |
SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) | CREATE TABLE orchestra (Major_Record_Format VARCHAR) | Please show the record formats of orchestras in ascending order of count. | <s>[INST] Given the following SQL query and context: Query: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) Context: CREATE TABLE orchestra (Major_Record_Format VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the record formats of orch... |
SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE orchestra (Record_Company VARCHAR) | List the record company shared by the most number of orchestras. | <s>[INST] Given the following SQL query and context: Query: SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE orchestra (Record_Company VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the record company shared by the mo... |
SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance) | CREATE TABLE orchestra (Orchestra VARCHAR, Orchestra_ID VARCHAR); CREATE TABLE performance (Orchestra VARCHAR, Orchestra_ID VARCHAR) | List the names of orchestras that have no performance. | <s>[INST] Given the following SQL query and context: Query: SELECT Orchestra FROM orchestra WHERE NOT Orchestra_ID IN (SELECT Orchestra_ID FROM performance) Context: CREATE TABLE orchestra (Orchestra VARCHAR, Orchestra_ID VARCHAR); CREATE TABLE performance (Orchestra VARCHAR, Orchestra_ID VARCHAR) [/INST] Based on the ... |
SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 | CREATE TABLE orchestra (Record_Company VARCHAR, Year_of_Founded INTEGER) | Show the record companies shared by orchestras founded before 2003 and after 2003. | <s>[INST] Given the following SQL query and context: Query: SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 Context: CREATE TABLE orchestra (Record_Company VARCHAR, Year_of_Founded INTEGER) [/INST] Based on the provided SQL qu... |
SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" | CREATE TABLE orchestra (Major_Record_Format VARCHAR) | Find the number of orchestras whose record format is "CD" or "DVD". | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" Context: CREATE TABLE orchestra (Major_Record_Format VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of orchestras wh... |
SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 | CREATE TABLE performance (Orchestra_ID VARCHAR); CREATE TABLE orchestra (Orchestra_ID VARCHAR) | Show the years in which orchestras that have given more than one performance are founded. | <s>[INST] Given the following SQL query and context: Query: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 Context: CREATE TABLE performance (Orchestra_ID VARCHAR); CREATE TABLE orchestra (Orchestra_ID VARCHAR) [/INST]... |
SELECT COUNT(*) FROM Highschooler | CREATE TABLE Highschooler (Id VARCHAR) | How many high schoolers are there? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Highschooler Context: CREATE TABLE Highschooler (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many high schoolers are there? The answer to your question is: SELECT COUNT(*) FROM Highschooler. [/s> |
SELECT name, grade FROM Highschooler | CREATE TABLE Highschooler (name VARCHAR, grade VARCHAR) | Show the names and grades of each high schooler. | <s>[INST] Given the following SQL query and context: Query: SELECT name, grade FROM Highschooler Context: CREATE TABLE Highschooler (name VARCHAR, grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names and grades of each high schooler. The answer to your question is: SELECT... |
SELECT grade FROM Highschooler | CREATE TABLE Highschooler (grade VARCHAR) | Show all the grades of the high schoolers. | <s>[INST] Given the following SQL query and context: Query: SELECT grade FROM Highschooler Context: CREATE TABLE Highschooler (grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the grades of the high schoolers. The answer to your question is: SELECT grade FROM Highschooler. ... |
SELECT grade FROM Highschooler WHERE name = "Kyle" | CREATE TABLE Highschooler (grade VARCHAR, name VARCHAR) | What grade is Kyle in? | <s>[INST] Given the following SQL query and context: Query: SELECT grade FROM Highschooler WHERE name = "Kyle" Context: CREATE TABLE Highschooler (grade VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What grade is Kyle in? The answer to your question is: SELECT grade FROM ... |
SELECT name FROM Highschooler WHERE grade = 10 | CREATE TABLE Highschooler (name VARCHAR, grade VARCHAR) | Show the names of all high schoolers in grade 10. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM Highschooler WHERE grade = 10 Context: CREATE TABLE Highschooler (name VARCHAR, grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of all high schoolers in grade 10. The answer to your question... |
SELECT ID FROM Highschooler WHERE name = "Kyle" | CREATE TABLE Highschooler (ID VARCHAR, name VARCHAR) | Show the ID of the high schooler named Kyle. | <s>[INST] Given the following SQL query and context: Query: SELECT ID FROM Highschooler WHERE name = "Kyle" Context: CREATE TABLE Highschooler (ID VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ID of the high schooler named Kyle. The answer to your question is: SE... |
SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10 | CREATE TABLE Highschooler (grade VARCHAR) | How many high schoolers are there in grade 9 or 10? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Highschooler WHERE grade = 9 OR grade = 10 Context: CREATE TABLE Highschooler (grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many high schoolers are there in grade 9 or 10? The answer to your que... |
SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade | CREATE TABLE Highschooler (grade VARCHAR) | Show the number of high schoolers for each grade. | <s>[INST] Given the following SQL query and context: Query: SELECT grade, COUNT(*) FROM Highschooler GROUP BY grade Context: CREATE TABLE Highschooler (grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of high schoolers for each grade. The answer to your question is: ... |
SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Highschooler (grade VARCHAR) | Which grade has the most high schoolers? | <s>[INST] Given the following SQL query and context: Query: SELECT grade FROM Highschooler GROUP BY grade ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Highschooler (grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which grade has the most high schoolers? The answer to your q... |
SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4 | CREATE TABLE Highschooler (grade VARCHAR) | Show me all grades that have at least 4 students. | <s>[INST] Given the following SQL query and context: Query: SELECT grade FROM Highschooler GROUP BY grade HAVING COUNT(*) >= 4 Context: CREATE TABLE Highschooler (grade VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show me all grades that have at least 4 students. The answer to your qu... |
SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id | CREATE TABLE Friend (student_id VARCHAR) | Show the student IDs and numbers of friends corresponding to each. | <s>[INST] Given the following SQL query and context: Query: SELECT student_id, COUNT(*) FROM Friend GROUP BY student_id Context: CREATE TABLE Friend (student_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the student IDs and numbers of friends corresponding to each. The answer t... |
SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) | Show the names of high school students and their corresponding number of friends. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name, COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) [/INST] Based on the provided SQL query a... |
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) | What is the name of the high schooler who has the greatest number of friends? | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) [/INST] Based on the... |
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 3 | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) | Show the names of high schoolers who have at least 3 friends. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 3 Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR) [/INST] Based on the provided ... |
SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, friend_id VARCHAR); CREATE TABLE Highschooler (id VARCHAR, name VARCHAR) | Show the names of all of the high schooler Kyle's friends. | <s>[INST] Given the following SQL query and context: Query: SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, fri... |
SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (id VARCHAR, name VARCHAR) | How many friends does the high school student Kyle have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" Context: CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and contex... |
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend | CREATE TABLE Highschooler (id VARCHAR, student_id VARCHAR); CREATE TABLE Friend (id VARCHAR, student_id VARCHAR) | Show ids of all students who do not have any friends. | <s>[INST] Given the following SQL query and context: Query: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend Context: CREATE TABLE Highschooler (id VARCHAR, student_id VARCHAR); CREATE TABLE Friend (id VARCHAR, student_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Sh... |
SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Highschooler (name VARCHAR); CREATE TABLE Friend (student_id VARCHAR) | Show names of all high school students who do not have any friends. | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Highschooler (name VARCHAR); CREATE TABLE Friend (student_id VARC... |
SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes | CREATE TABLE Likes (student_id VARCHAR, liked_id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, liked_id VARCHAR) | Show the ids of high schoolers who have friends and are also liked by someone else. | <s>[INST] Given the following SQL query and context: Query: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes Context: CREATE TABLE Likes (student_id VARCHAR, liked_id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, liked_id VARCHAR) [/INST] Based on the provided SQL query and context, your question... |
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id | CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Likes (student_id VARCHAR, liked_id VARCHAR); CREATE TABLE Friend (student_id VARCHAR, liked_id VARCHAR) | Show name of all students who have some friends and also are liked by someone else. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id INTERSECT SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.liked_id = T2.id Context: CREATE TABLE Highschooler (name VARCHAR, id VARCHAR); CREATE TABLE Likes (studen... |
SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id | CREATE TABLE Likes (student_id VARCHAR) | Count the number of likes for each student id. | <s>[INST] Given the following SQL query and context: Query: SELECT student_id, COUNT(*) FROM Likes GROUP BY student_id Context: CREATE TABLE Likes (student_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Count the number of likes for each student id. The answer to your question is: SE... |
SELECT T2.name, COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) | Show the names of high schoolers who have likes, and numbers of likes for each. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name, COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id Context: CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and... |
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) | What is the name of the high schooler who has the greatest number of likes? | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) [/INST] Based on the p... |
SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 2 | CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) | Show the names of students who have at least 2 likes. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR) [/INST] Based on the provided SQ... |
SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING COUNT(*) >= 2 | CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR, grade INTEGER) | Show the names of students who have a grade higher than 5 and have at least 2 friends. | <s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.grade > 5 GROUP BY T1.student_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (name VARCHAR, id VARCHAR, grade INTEG... |
SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (id VARCHAR, name VARCHAR) | How many likes does Kyle have? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" Context: CREATE TABLE Likes (student_id VARCHAR); CREATE TABLE Highschooler (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context,... |
SELECT AVG(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | CREATE TABLE Highschooler (id VARCHAR); CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (grade INTEGER, id VARCHAR) | Find the average grade of all students who have some friends. | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) Context: CREATE TABLE Highschooler (id VARCHAR); CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (grad... |
SELECT MIN(grade) FROM Highschooler WHERE NOT id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) | CREATE TABLE Highschooler (id VARCHAR); CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (grade INTEGER, id VARCHAR) | Find the minimum grade of students who have no friends. | <s>[INST] Given the following SQL query and context: Query: SELECT MIN(grade) FROM Highschooler WHERE NOT id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id) Context: CREATE TABLE Highschooler (id VARCHAR); CREATE TABLE Friend (student_id VARCHAR); CREATE TABLE Highschooler (... |
SELECT state FROM Owners INTERSECT SELECT state FROM Professionals | CREATE TABLE Owners (state VARCHAR); CREATE TABLE Professionals (state VARCHAR) | Which states have both owners and professionals living there? | <s>[INST] Given the following SQL query and context: Query: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals Context: CREATE TABLE Owners (state VARCHAR); CREATE TABLE Professionals (state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which states have both owners and... |
SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments) | CREATE TABLE Dogs (age INTEGER, dog_id VARCHAR); CREATE TABLE Treatments (age INTEGER, dog_id VARCHAR) | What is the average age of the dogs who have gone through any treatments? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(age) FROM Dogs WHERE dog_id IN (SELECT dog_id FROM Treatments) Context: CREATE TABLE Dogs (age INTEGER, dog_id VARCHAR); CREATE TABLE Treatments (age INTEGER, dog_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Wha... |
SELECT professional_id, last_name, cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id, T1.last_name, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) > 2 | CREATE TABLE Treatments (professional_id VARCHAR); CREATE TABLE Professionals (professional_id VARCHAR, last_name VARCHAR, cell_number VARCHAR); CREATE TABLE Professionals (professional_id VARCHAR, last_name VARCHAR, cell_number VARCHAR, state VARCHAR) | Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone. | <s>[INST] Given the following SQL query and context: Query: SELECT professional_id, last_name, cell_number FROM Professionals WHERE state = 'Indiana' UNION SELECT T1.professional_id, T1.last_name, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.profes... |
SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000) | CREATE TABLE dogs (name VARCHAR, dog_id VARCHAR, cost_of_treatment INTEGER); CREATE TABLE treatments (name VARCHAR, dog_id VARCHAR, cost_of_treatment INTEGER) | Which dogs have not cost their owner more than 1000 for treatment ? List the dog names . | <s>[INST] Given the following SQL query and context: Query: SELECT name FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments GROUP BY dog_id HAVING SUM(cost_of_treatment) > 1000) Context: CREATE TABLE dogs (name VARCHAR, dog_id VARCHAR, cost_of_treatment INTEGER); CREATE TABLE treatments (name VARCHAR, dog_id V... |
SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs | CREATE TABLE Owners (first_name VARCHAR, name VARCHAR); CREATE TABLE Dogs (first_name VARCHAR, name VARCHAR); CREATE TABLE Professionals (first_name VARCHAR, name VARCHAR) | Which first names are used for professionals or owners but are not used as dog names? | <s>[INST] Given the following SQL query and context: Query: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs Context: CREATE TABLE Owners (first_name VARCHAR, name VARCHAR); CREATE TABLE Dogs (first_name VARCHAR, name VARCHAR); CREATE TABLE Professionals (first_name ... |
SELECT professional_id, role_code, email_address FROM Professionals EXCEPT SELECT T1.professional_id, T1.role_code, T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id | CREATE TABLE Professionals (professional_id VARCHAR, role_code VARCHAR, email_address VARCHAR); CREATE TABLE Treatments (professional_id VARCHAR) | Which professional did not operate any treatment on dogs? List the professional's id, role and email. | <s>[INST] Given the following SQL query and context: Query: SELECT professional_id, role_code, email_address FROM Professionals EXCEPT SELECT T1.professional_id, T1.role_code, T1.email_address FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id Context: CREATE TABLE Professionals (... |
SELECT T1.owner_id, T2.first_name, T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, owner_id VARCHAR); CREATE TABLE Dogs (owner_id VARCHAR) | Which owner owns the most dogs? List the owner id, first name and last name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.owner_id, T2.first_name, T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id = T2.owner_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, owner_id VARCHAR); CREATE TA... |
SELECT T1.professional_id, T1.role_code, T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 | CREATE TABLE Professionals (professional_id VARCHAR, role_code VARCHAR, first_name VARCHAR); CREATE TABLE Treatments (professional_id VARCHAR) | Which professionals have done at least two treatments? List the professional's id, role, and first name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.professional_id, T1.role_code, T1.first_name FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Professionals (professional_id VARCHAR, role... |
SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Dogs (breed_code VARCHAR); CREATE TABLE Breeds (breed_name VARCHAR, breed_code VARCHAR) | What is the name of the breed with the most dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code = T2.breed_code GROUP BY T1.breed_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Dogs (breed_code VARCHAR); CREATE TABLE Breeds (breed_name VARCHAR, breed_code VARCHAR) [/INST] ... |
SELECT T1.owner_id, T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Owners (owner_id VARCHAR, last_name VARCHAR); CREATE TABLE Dogs (owner_id VARCHAR, dog_id VARCHAR); CREATE TABLE Treatments (dog_id VARCHAR) | Which owner has paid for the most treatments on his or her dogs? List the owner id and last name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.owner_id, T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Owners (owner_id VARCHAR, last_name VARCHAR... |
SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY SUM(cost_of_treatment) LIMIT 1 | CREATE TABLE Treatments (treatment_type_code VARCHAR); CREATE TABLE Treatment_types (treatment_type_description VARCHAR, treatment_type_code VARCHAR) | What is the description of the treatment type that costs the least money in total? | <s>[INST] Given the following SQL query and context: Query: SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY SUM(cost_of_treatment) LIMIT 1 Context: CREATE TABLE Treatments (treatment_type_co... |
SELECT T1.owner_id, T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY SUM(T3.cost_of_treatment) DESC LIMIT 1 | CREATE TABLE Treatments (dog_id VARCHAR, cost_of_treatment INTEGER); CREATE TABLE Owners (owner_id VARCHAR, zip_code VARCHAR); CREATE TABLE Dogs (owner_id VARCHAR, dog_id VARCHAR) | Which owner has paid the largest amount of money in total for their dogs? Show the owner id and zip code. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.owner_id, T1.zip_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id JOIN Treatments AS T3 ON T2.dog_id = T3.dog_id GROUP BY T1.owner_id ORDER BY SUM(T3.cost_of_treatment) DESC LIMIT 1 Context: CREATE TABLE Treatments (dog_id VARCHAR,... |
SELECT T1.professional_id, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 | CREATE TABLE Professionals (professional_id VARCHAR, cell_number VARCHAR); CREATE TABLE Treatments (professional_id VARCHAR) | Which professionals have done at least two types of treatments? List the professional id and cell phone. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.professional_id, T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id = T2.professional_id GROUP BY T1.professional_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Professionals (professional_id VARCHAR, cell_number VARCH... |
SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < (SELECT AVG(cost_of_treatment) FROM Treatments) | CREATE TABLE Treatments (cost_of_treatment INTEGER); CREATE TABLE Professionals (first_name VARCHAR, last_name VARCHAR); CREATE TABLE Treatments (Id VARCHAR) | What are the first name and last name of the professionals who have done treatment with cost below average? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.first_name, T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment < (SELECT AVG(cost_of_treatment) FROM Treatments) Context: CREATE TABLE Treatments (cost_of_treatment INTEGER); CREATE TABLE Professionals (first... |
SELECT T1.date_of_treatment, T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id | CREATE TABLE Treatments (date_of_treatment VARCHAR, professional_id VARCHAR); CREATE TABLE Professionals (first_name VARCHAR, professional_id VARCHAR) | List the date of each treatment, together with the first name of the professional who operated it. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.date_of_treatment, T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id = T2.professional_id Context: CREATE TABLE Treatments (date_of_treatment VARCHAR, professional_id VARCHAR); CREATE TABLE Professionals (first_name V... |
SELECT T1.cost_of_treatment, T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code | CREATE TABLE Treatments (cost_of_treatment VARCHAR, treatment_type_code VARCHAR); CREATE TABLE treatment_types (treatment_type_description VARCHAR, treatment_type_code VARCHAR) | List the cost of each treatment and the corresponding treatment type description. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.cost_of_treatment, T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code = T2.treatment_type_code Context: CREATE TABLE Treatments (cost_of_treatment VARCHAR, treatment_type_code VARCHAR); CREATE TAB... |
SELECT T1.first_name, T1.last_name, T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, owner_id VARCHAR); CREATE TABLE Dogs (size_code VARCHAR, owner_id VARCHAR) | List each owner's first name, last name, and the size of his for her dog. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id Context: CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, owner_id VARCHAR); CREATE TABLE Dogs (size_code VARCHAR, owner_id VARCHAR) [/IN... |
SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id | CREATE TABLE Dogs (name VARCHAR, owner_id VARCHAR); CREATE TABLE Owners (first_name VARCHAR, owner_id VARCHAR) | List pairs of the owner's first name and the dogs's name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id Context: CREATE TABLE Dogs (name VARCHAR, owner_id VARCHAR); CREATE TABLE Owners (first_name VARCHAR, owner_id VARCHAR) [/INST] Based on the provided SQL query and con... |
SELECT T1.name, T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = (SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY COUNT(*) LIMIT 1) | CREATE TABLE Dogs (name VARCHAR, dog_id VARCHAR, breed_code VARCHAR); CREATE TABLE Treatments (date_of_treatment VARCHAR, dog_id VARCHAR); CREATE TABLE Dogs (breed_code VARCHAR) | List the names of the dogs of the rarest breed and the treatment dates of them. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T2.date_of_treatment FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id WHERE T1.breed_code = (SELECT breed_code FROM Dogs GROUP BY breed_code ORDER BY COUNT(*) LIMIT 1) Context: CREATE TABLE Dogs (name VARCHAR, dog_id VARCHAR, bree... |
SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' | CREATE TABLE Dogs (name VARCHAR, owner_id VARCHAR); CREATE TABLE Owners (first_name VARCHAR, owner_id VARCHAR, state VARCHAR) | Which dogs are owned by someone who lives in Virginia? List the owner's first name and the dog's name. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T1.state = 'Virginia' Context: CREATE TABLE Dogs (name VARCHAR, owner_id VARCHAR); CREATE TABLE Owners (first_name VARCHAR, owner_id VARCHAR, state VARCHAR) [/IN... |
SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id | CREATE TABLE Dogs (date_arrived VARCHAR, date_departed VARCHAR, dog_id VARCHAR); CREATE TABLE Treatments (dog_id VARCHAR) | What are the arriving date and the departing date of the dogs who have gone through a treatment? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.date_arrived, T1.date_departed FROM Dogs AS T1 JOIN Treatments AS T2 ON T1.dog_id = T2.dog_id Context: CREATE TABLE Dogs (date_arrived VARCHAR, date_departed VARCHAR, dog_id VARCHAR); CREATE TABLE Treatments (dog_id VARCHAR) [/INST] Based on... |
SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = (SELECT MAX(age) FROM Dogs) | CREATE TABLE Owners (last_name VARCHAR, owner_id VARCHAR); CREATE TABLE Dogs (owner_id VARCHAR, age INTEGER); CREATE TABLE Dogs (age INTEGER) | List the last name of the owner owning the youngest dog. | <s>[INST] Given the following SQL query and context: Query: SELECT T1.last_name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id = T2.owner_id WHERE T2.age = (SELECT MAX(age) FROM Dogs) Context: CREATE TABLE Owners (last_name VARCHAR, owner_id VARCHAR); CREATE TABLE Dogs (owner_id VARCHAR, age INTEGER); CREATE TABLE Do... |
SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' | CREATE TABLE Professionals (email_address VARCHAR, state VARCHAR) | List the emails of the professionals who live in the state of Hawaii or the state of Wisconsin. | <s>[INST] Given the following SQL query and context: Query: SELECT email_address FROM Professionals WHERE state = 'Hawaii' OR state = 'Wisconsin' Context: CREATE TABLE Professionals (email_address VARCHAR, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the emails of the profe... |
SELECT date_arrived, date_departed FROM Dogs | CREATE TABLE Dogs (date_arrived VARCHAR, date_departed VARCHAR) | What are the arriving date and the departing date of all the dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT date_arrived, date_departed FROM Dogs Context: CREATE TABLE Dogs (date_arrived VARCHAR, date_departed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the arriving date and the departing date of all the dogs? The ... |
SELECT COUNT(DISTINCT dog_id) FROM Treatments | CREATE TABLE Treatments (dog_id VARCHAR) | How many dogs went through any treatments? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT dog_id) FROM Treatments Context: CREATE TABLE Treatments (dog_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many dogs went through any treatments? The answer to your question is: SELECT COUNT(DISTI... |
SELECT COUNT(DISTINCT professional_id) FROM Treatments | CREATE TABLE Treatments (professional_id VARCHAR) | How many professionals have performed any treatment to dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT professional_id) FROM Treatments Context: CREATE TABLE Treatments (professional_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many professionals have performed any treatment to dogs? The answer to ... |
SELECT role_code, street, city, state FROM professionals WHERE city LIKE '%West%' | CREATE TABLE professionals (role_code VARCHAR, street VARCHAR, city VARCHAR, state VARCHAR) | Which professionals live in a city containing the substring 'West'? List his or her role, street, city and state. | <s>[INST] Given the following SQL query and context: Query: SELECT role_code, street, city, state FROM professionals WHERE city LIKE '%West%' Context: CREATE TABLE professionals (role_code VARCHAR, street VARCHAR, city VARCHAR, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which ... |
SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%' | CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, email_address VARCHAR, state VARCHAR) | Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email. | <s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, email_address FROM Owners WHERE state LIKE '%North%' Context: CREATE TABLE Owners (first_name VARCHAR, last_name VARCHAR, email_address VARCHAR, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is:... |
SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs) | CREATE TABLE Dogs (age INTEGER) | How many dogs have an age below the average? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Dogs WHERE age < (SELECT AVG(age) FROM Dogs) Context: CREATE TABLE Dogs (age INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many dogs have an age below the average? The answer to your question is: SELEC... |
SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 | CREATE TABLE Treatments (cost_of_treatment VARCHAR, date_of_treatment VARCHAR) | How much does the most recent treatment cost? | <s>[INST] Given the following SQL query and context: Query: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1 Context: CREATE TABLE Treatments (cost_of_treatment VARCHAR, date_of_treatment VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How much does the mo... |
SELECT COUNT(*) FROM Dogs WHERE NOT dog_id IN (SELECT dog_id FROM Treatments) | CREATE TABLE Dogs (dog_id VARCHAR); CREATE TABLE Treatments (dog_id VARCHAR) | How many dogs have not gone through any treatment? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Dogs WHERE NOT dog_id IN (SELECT dog_id FROM Treatments) Context: CREATE TABLE Dogs (dog_id VARCHAR); CREATE TABLE Treatments (dog_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many dogs have not go... |
SELECT COUNT(*) FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments) | CREATE TABLE treatments (dog_id VARCHAR); CREATE TABLE dogs (dog_id VARCHAR) | Tell me the number of dogs that have not received any treatment . | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM dogs WHERE NOT dog_id IN (SELECT dog_id FROM treatments) Context: CREATE TABLE treatments (dog_id VARCHAR); CREATE TABLE dogs (dog_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Tell me the number of dog... |
SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs) | CREATE TABLE Dogs (owner_id VARCHAR); CREATE TABLE Owners (owner_id VARCHAR) | How many owners temporarily do not have any dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Owners WHERE NOT owner_id IN (SELECT owner_id FROM Dogs) Context: CREATE TABLE Dogs (owner_id VARCHAR); CREATE TABLE Owners (owner_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many owners temporari... |
SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments) | CREATE TABLE Professionals (professional_id VARCHAR); CREATE TABLE Treatments (professional_id VARCHAR) | How many professionals did not operate any treatment on dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Professionals WHERE NOT professional_id IN (SELECT professional_id FROM Treatments) Context: CREATE TABLE Professionals (professional_id VARCHAR); CREATE TABLE Treatments (professional_id VARCHAR) [/INST] Based on the provided SQL query an... |
SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1 | CREATE TABLE Dogs (name VARCHAR, age VARCHAR, weight VARCHAR, abandoned_yn VARCHAR) | List the dog name, age and weight of the dogs who have been abandoned? 1 stands for yes, and 0 stands for no. | <s>[INST] Given the following SQL query and context: Query: SELECT name, age, weight FROM Dogs WHERE abandoned_yn = 1 Context: CREATE TABLE Dogs (name VARCHAR, age VARCHAR, weight VARCHAR, abandoned_yn VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the dog name, age and weight of t... |
SELECT AVG(age) FROM Dogs | CREATE TABLE Dogs (age INTEGER) | What is the average age of all the dogs? | <s>[INST] Given the following SQL query and context: Query: SELECT AVG(age) FROM Dogs Context: CREATE TABLE Dogs (age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average age of all the dogs? The answer to your question is: SELECT AVG(age) FROM Dogs. [/s> |
SELECT MAX(age) FROM Dogs | CREATE TABLE Dogs (age INTEGER) | What is the age of the oldest dog? | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(age) FROM Dogs Context: CREATE TABLE Dogs (age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the age of the oldest dog? The answer to your question is: SELECT MAX(age) FROM Dogs. [/s> |
SELECT charge_type, charge_amount FROM Charges | CREATE TABLE Charges (charge_type VARCHAR, charge_amount VARCHAR) | How much does each charge type costs? List both charge type and amount. | <s>[INST] Given the following SQL query and context: Query: SELECT charge_type, charge_amount FROM Charges Context: CREATE TABLE Charges (charge_type VARCHAR, charge_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How much does each charge type costs? List both charge type and amo... |
SELECT MAX(charge_amount) FROM Charges | CREATE TABLE Charges (charge_amount INTEGER) | How much does the most expensive charge type costs? | <s>[INST] Given the following SQL query and context: Query: SELECT MAX(charge_amount) FROM Charges Context: CREATE TABLE Charges (charge_amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: How much does the most expensive charge type costs? The answer to your question is: SELECT MAX(c... |
SELECT email_address, cell_number, home_phone FROM professionals | CREATE TABLE professionals (email_address VARCHAR, cell_number VARCHAR, home_phone VARCHAR) | List the email, cell phone and home phone of all the professionals. | <s>[INST] Given the following SQL query and context: Query: SELECT email_address, cell_number, home_phone FROM professionals Context: CREATE TABLE professionals (email_address VARCHAR, cell_number VARCHAR, home_phone VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the email, cell ph... |
SELECT DISTINCT breed_code, size_code FROM dogs | CREATE TABLE dogs (breed_code VARCHAR, size_code VARCHAR) | What are all the possible breed type and size type combinations? | <s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT breed_code, size_code FROM dogs Context: CREATE TABLE dogs (breed_code VARCHAR, size_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the possible breed type and size type combinations? The answe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.