answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT MAX(YEAR) FROM perpetrator
CREATE TABLE perpetrator (YEAR INTEGER)
In which year did the most recent crime happen?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(YEAR) FROM perpetrator Context: CREATE TABLE perpetrator (YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: In which year did the most recent crime happen? The answer to your question is: SELECT MAX(YEAR) FROM perpetrator. [/s>
SELECT campus FROM campuses WHERE county = "Los Angeles"
CREATE TABLE campuses (campus VARCHAR, county VARCHAR)
Report the name of all campuses in Los Angeles county.
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE county = "Los Angeles" Context: CREATE TABLE campuses (campus VARCHAR, county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Report the name of all campuses in Los Angeles county. The answer to your question is: SELECT campus FROM campuses WHERE county = "Los Angeles". [/s>
SELECT campus FROM campuses WHERE LOCATION = "Chico"
CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR)
What are the names of all campuses located at Chico?
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE LOCATION = "Chico" Context: CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of all campuses located at Chico? The answer to your question is: SELECT campus FROM campuses WHERE LOCATION = "Chico". [/s>
SELECT campus FROM campuses WHERE YEAR = 1958
CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR)
Find all the campuses opened in 1958.
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE YEAR = 1958 Context: CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all the campuses opened in 1958. The answer to your question is: SELECT campus FROM campuses WHERE YEAR = 1958. [/s>
SELECT campus FROM campuses WHERE YEAR < 1800
CREATE TABLE campuses (campus VARCHAR, YEAR INTEGER)
Find the name of the campuses opened before 1800.
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE YEAR < 1800 Context: CREATE TABLE campuses (campus VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of the campuses opened before 1800. The answer to your question is: SELECT campus FROM campuses WHERE YEAR < 1800. [/s>
SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939
CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR)
Which campus was opened between 1935 and 1939?
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939 Context: CREATE TABLE campuses (campus VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which campus was opened between 1935 and 1939? The answer to your question is: SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939. [/s>
SELECT campus FROM campuses WHERE LOCATION = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION = "San Francisco" AND county = "San Francisco"
CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR, county VARCHAR)
Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE LOCATION = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION = "San Francisco" AND county = "San Francisco" Context: CREATE TABLE campuses (campus VARCHAR, LOCATION VARCHAR, county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco. The answer to your question is: SELECT campus FROM campuses WHERE LOCATION = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION = "San Francisco" AND county = "San Francisco". [/s>
SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Jose State University" AND T2.year = 1996
CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR)
What is the campus fee of "San Jose State University" in year 1996?
<s>[INST] Given the following SQL query and context: Query: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Jose State University" AND T2.year = 1996 Context: CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the campus fee of "San Jose State University" in year 1996? The answer to your question is: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Jose State University" AND T2.year = 1996. [/s>
SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND T2.year = 1996
CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR)
What is the campus fee of "San Francisco State University" in year 1996?
<s>[INST] Given the following SQL query and context: Query: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND T2.year = 1996 Context: CREATE TABLE csu_fees (year VARCHAR); CREATE TABLE campuses (id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the campus fee of "San Francisco State University" in year 1996? The answer to your question is: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND T2.year = 1996. [/s>
SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)
CREATE TABLE csu_fees (campusfee INTEGER)
Find the count of universities whose campus fee is greater than the average campus fee.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees) Context: CREATE TABLE csu_fees (campusfee INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the count of universities whose campus fee is greater than the average campus fee. The answer to your question is: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees). [/s>
SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950
CREATE TABLE campuses (campus VARCHAR, county VARCHAR, YEAR VARCHAR)
Which university is in Los Angeles county and opened after 1950?
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950 Context: CREATE TABLE campuses (campus VARCHAR, county VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which university is in Los Angeles county and opened after 1950? The answer to your question is: SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950. [/s>
SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1
CREATE TABLE degrees (YEAR VARCHAR, degrees INTEGER)
Which year has the most degrees conferred?
<s>[INST] Given the following SQL query and context: Query: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1 Context: CREATE TABLE degrees (YEAR VARCHAR, degrees INTEGER) [/INST] Based on the provided SQL query and context, your question is: Which year has the most degrees conferred? The answer to your question is: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1. [/s>
SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1
CREATE TABLE degrees (campus VARCHAR, degrees INTEGER)
Which campus has the most degrees conferred in all times?
<s>[INST] Given the following SQL query and context: Query: SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1 Context: CREATE TABLE degrees (campus VARCHAR, degrees INTEGER) [/INST] Based on the provided SQL query and context, your question is: Which campus has the most degrees conferred in all times? The answer to your question is: SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1. [/s>
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1
CREATE TABLE faculty (campus VARCHAR, year VARCHAR, faculty VARCHAR); CREATE TABLE campuses (campus VARCHAR, id VARCHAR)
Which campus has the most faculties in year 2003?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1 Context: CREATE TABLE faculty (campus VARCHAR, year VARCHAR, faculty VARCHAR); CREATE TABLE campuses (campus VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which campus has the most faculties in year 2003? The answer to your question is: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1. [/s>
SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996
CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR)
Find the average fee on a CSU campus in 1996
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996 Context: CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the average fee on a CSU campus in 1996 The answer to your question is: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996. [/s>
SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005
CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR)
What is the average fee on a CSU campus in 2005?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005 Context: CREATE TABLE csu_fees (campusfee INTEGER, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average fee on a CSU campus in 2005? The answer to your question is: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005. [/s>
SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus
CREATE TABLE campuses (campus VARCHAR, id VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR)
report the total number of degrees granted between 1998 and 2002.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus Context: CREATE TABLE campuses (campus VARCHAR, id VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: report the total number of degrees granted between 1998 and 2002. The answer to your question is: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus. [/s>
SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR)
For each Orange county campus, report the number of degrees granted after 2000.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus Context: CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE degrees (degrees INTEGER, campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each Orange county campus, report the number of degrees granted after 2000. The answer to your question is: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus. [/s>
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)
Find the names of the campus which has more faculties in 2002 than every campus in Orange county.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange") Context: CREATE TABLE campuses (campus VARCHAR, id VARCHAR, county VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of the campus which has more faculties in 2002 than every campus in Orange county. The answer to your question is: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange"). [/s>
SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200
CREATE TABLE enrollments (campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR)
What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200 Context: CREATE TABLE enrollments (campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956? The answer to your question is: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200. [/s>
SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles"
CREATE TABLE campuses (county VARCHAR)
How many campuses are there in Los Angeles county?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles" Context: CREATE TABLE campuses (county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many campuses are there in Los Angeles county? The answer to your question is: SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles". [/s>
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR)
How many degrees were conferred in "San Jose State University" in 2000?
<s>[INST] Given the following SQL query and context: Query: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000 Context: CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many degrees were conferred in "San Jose State University" in 2000? The answer to your question is: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000. [/s>
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001
CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR)
What are the degrees conferred in "San Francisco State University" in 2001.
<s>[INST] Given the following SQL query and context: Query: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001 Context: CREATE TABLE degrees (Id VARCHAR); CREATE TABLE campuses (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the degrees conferred in "San Francisco State University" in 2001. The answer to your question is: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND t2.year = 2001. [/s>
SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002
CREATE TABLE faculty (faculty INTEGER, YEAR VARCHAR)
How many faculty is there in total in the year of 2002?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002 Context: CREATE TABLE faculty (faculty INTEGER, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty is there in total in the year of 2002? The answer to your question is: SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002. [/s>
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University"
CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)
What is the number of faculty lines in campus "Long Beach State University" in 2002?
<s>[INST] Given the following SQL query and context: Query: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University" Context: CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the number of faculty lines in campus "Long Beach State University" in 2002? The answer to your question is: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = "Long Beach State University". [/s>
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR)
How many faculty lines are there in "San Francisco State University" in year 2004?
<s>[INST] Given the following SQL query and context: Query: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University" Context: CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE faculty (campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty lines are there in "San Francisco State University" in year 2004? The answer to your question is: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University". [/s>
SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004
CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (campus VARCHAR, faculty VARCHAR)
List the campus that have between 600 and 1000 faculty lines in year 2004.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004 Context: CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (campus VARCHAR, faculty VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the campus that have between 600 and 1000 faculty lines in year 2004. The answer to your question is: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004. [/s>
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1
CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR)
How many faculty lines are there in the university that conferred the most number of degrees in year 2002?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1 Context: CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty lines are there in the university that conferred the most number of degrees in year 2002? The answer to your question is: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1. [/s>
SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1
CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR)
How many faculty lines are there in the university that conferred the least number of degrees in year 2001?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1 Context: CREATE TABLE campuses (id VARCHAR); CREATE TABLE faculty (faculty VARCHAR); CREATE TABLE degrees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many faculty lines are there in the university that conferred the least number of degrees in year 2001? The answer to your question is: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees LIMIT 1. [/s>
SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University"
CREATE TABLE discipline_enrollments (undergraduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR)
How many undergraduates are there in "San Jose State University" in year 2004?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University" Context: CREATE TABLE discipline_enrollments (undergraduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many undergraduates are there in "San Jose State University" in year 2004? The answer to your question is: SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University". [/s>
SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University"
CREATE TABLE discipline_enrollments (graduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR)
What is the number of graduates in "San Francisco State University" in year 2004?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University" Context: CREATE TABLE discipline_enrollments (graduate INTEGER, campus VARCHAR, year VARCHAR); CREATE TABLE campuses (id VARCHAR, campus VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the number of graduates in "San Francisco State University" in year 2004? The answer to your question is: SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University". [/s>
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000
CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR)
What is the campus fee of "San Francisco State University" in year 2000?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000 Context: CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the campus fee of "San Francisco State University" in year 2000? The answer to your question is: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Francisco State University" AND t1.year = 2000. [/s>
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000
CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR)
Find the campus fee of "San Jose State University" in year 2000.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000 Context: CREATE TABLE campuses (id VARCHAR, campus VARCHAR); CREATE TABLE csu_fees (campusfee VARCHAR, campus VARCHAR, year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the campus fee of "San Jose State University" in year 2000. The answer to your question is: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000. [/s>
SELECT COUNT(*) FROM campuses
CREATE TABLE campuses (Id VARCHAR)
How many CSU campuses are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM campuses Context: CREATE TABLE campuses (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many CSU campuses are there? The answer to your question is: SELECT COUNT(*) FROM campuses. [/s>
SELECT COUNT(*) FROM candidate
CREATE TABLE candidate (Id VARCHAR)
How many candidates are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM candidate Context: CREATE TABLE candidate (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many candidates are there? The answer to your question is: SELECT COUNT(*) FROM candidate. [/s>
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE candidate (poll_source VARCHAR)
Which poll resource provided the most number of candidate information?
<s>[INST] Given the following SQL query and context: Query: SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE candidate (poll_source VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which poll resource provided the most number of candidate information? The answer to your question is: SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
CREATE TABLE candidate (support_rate VARCHAR)
what are the top 3 highest support rates?
<s>[INST] Given the following SQL query and context: Query: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3 Context: CREATE TABLE candidate (support_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what are the top 3 highest support rates? The answer to your question is: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3. [/s>
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
CREATE TABLE candidate (Candidate_ID VARCHAR, oppose_rate VARCHAR)
Find the id of the candidate who got the lowest oppose rate.
<s>[INST] Given the following SQL query and context: Query: SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1 Context: CREATE TABLE candidate (Candidate_ID VARCHAR, oppose_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id of the candidate who got the lowest oppose rate. The answer to your question is: SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1. [/s>
SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate
CREATE TABLE candidate (Support_rate VARCHAR, Consider_rate VARCHAR, Oppose_rate VARCHAR, unsure_rate VARCHAR)
Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.
<s>[INST] Given the following SQL query and context: Query: SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate Context: CREATE TABLE candidate (Support_rate VARCHAR, Consider_rate VARCHAR, Oppose_rate VARCHAR, unsure_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate. The answer to your question is: SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate. [/s>
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
CREATE TABLE candidate (poll_source VARCHAR, oppose_rate VARCHAR)
which poll source does the highest oppose rate come from?
<s>[INST] Given the following SQL query and context: Query: SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1 Context: CREATE TABLE candidate (poll_source VARCHAR, oppose_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which poll source does the highest oppose rate come from? The answer to your question is: SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1. [/s>
SELECT name FROM people ORDER BY date_of_birth
CREATE TABLE people (name VARCHAR, date_of_birth VARCHAR)
List all people names in the order of their date of birth from old to young.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM people ORDER BY date_of_birth Context: CREATE TABLE people (name VARCHAR, date_of_birth VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all people names in the order of their date of birth from old to young. The answer to your question is: SELECT name FROM people ORDER BY date_of_birth. [/s>
SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'
CREATE TABLE people (height INTEGER, weight INTEGER, sex VARCHAR)
Find the average height and weight for all males (sex is M).
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M' Context: CREATE TABLE people (height INTEGER, weight INTEGER, sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the average height and weight for all males (sex is M). The answer to your question is: SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'. [/s>
SELECT name FROM people WHERE height > 200 OR height < 190
CREATE TABLE people (name VARCHAR, height VARCHAR)
find the names of people who are taller than 200 or lower than 190.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM people WHERE height > 200 OR height < 190 Context: CREATE TABLE people (name VARCHAR, height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the names of people who are taller than 200 or lower than 190. The answer to your question is: SELECT name FROM people WHERE height > 200 OR height < 190. [/s>
SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex
CREATE TABLE people (sex VARCHAR, weight INTEGER)
Find the average and minimum weight for each gender.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex Context: CREATE TABLE people (sex VARCHAR, weight INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average and minimum weight for each gender. The answer to your question is: SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex. [/s>
SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
CREATE TABLE candidate (people_id VARCHAR, support_rate VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR)
Find the name and gender of the candidate who got the highest support rate.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1 Context: CREATE TABLE candidate (people_id VARCHAR, support_rate VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and gender of the candidate who got the highest support rate. The answer to your question is: SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1. [/s>
SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex
CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR)
Find the name of the candidates whose oppose percentage is the lowest for each sex.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex Context: CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, sex VARCHAR, people_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the candidates whose oppose percentage is the lowest for each sex. The answer to your question is: SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex. [/s>
SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1
CREATE TABLE candidate (people_id VARCHAR, unsure_rate INTEGER); CREATE TABLE people (sex VARCHAR, people_id VARCHAR)
which gender got the highest average uncertain ratio.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1 Context: CREATE TABLE candidate (people_id VARCHAR, unsure_rate INTEGER); CREATE TABLE people (sex VARCHAR, people_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which gender got the highest average uncertain ratio. The answer to your question is: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1. [/s>
SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate)
CREATE TABLE candidate (name VARCHAR, people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR)
what are the names of people who did not participate in the candidate election.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate) Context: CREATE TABLE candidate (name VARCHAR, people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what are the names of people who did not participate in the candidate election. The answer to your question is: SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate). [/s>
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate
CREATE TABLE candidate (people_id VARCHAR, support_rate INTEGER, oppose_rate VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR)
Find the names of the candidates whose support percentage is lower than their oppose rate.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate Context: CREATE TABLE candidate (people_id VARCHAR, support_rate INTEGER, oppose_rate VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of the candidates whose support percentage is lower than their oppose rate. The answer to your question is: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate. [/s>
SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex
CREATE TABLE people (sex VARCHAR, weight INTEGER)
how many people are there whose weight is higher than 85 for each gender?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex Context: CREATE TABLE people (sex VARCHAR, weight INTEGER) [/INST] Based on the provided SQL query and context, your question is: how many people are there whose weight is higher than 85 for each gender? The answer to your question is: SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex. [/s>
SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate
CREATE TABLE candidate (support_rate INTEGER, consider_rate INTEGER, oppose_rate INTEGER)
find the highest support percentage, lowest consider rate and oppose rate of all candidates.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate Context: CREATE TABLE candidate (support_rate INTEGER, consider_rate INTEGER, oppose_rate INTEGER) [/INST] Based on the provided SQL query and context, your question is: find the highest support percentage, lowest consider rate and oppose rate of all candidates. The answer to your question is: SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate. [/s>
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR, sex VARCHAR)
list all female (sex is F) candidate names in the alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name Context: CREATE TABLE candidate (people_id VARCHAR); CREATE TABLE people (name VARCHAR, people_id VARCHAR, sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: list all female (sex is F) candidate names in the alphabetical order. The answer to your question is: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name. [/s>
SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people)
CREATE TABLE people (name VARCHAR, height INTEGER)
find the name of people whose height is lower than the average.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people) Context: CREATE TABLE people (name VARCHAR, height INTEGER) [/INST] Based on the provided SQL query and context, your question is: find the name of people whose height is lower than the average. The answer to your question is: SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people). [/s>
SELECT * FROM people
CREATE TABLE people (Id VARCHAR)
List all info about all people.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM people Context: CREATE TABLE people (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all info about all people. The answer to your question is: SELECT * FROM people. [/s>
SELECT title FROM Movie WHERE director = 'Steven Spielberg'
CREATE TABLE Movie (title VARCHAR, director VARCHAR)
Find the titles of all movies directed by steven spielberg.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE director = 'Steven Spielberg' Context: CREATE TABLE Movie (title VARCHAR, director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the titles of all movies directed by steven spielberg. The answer to your question is: SELECT title FROM Movie WHERE director = 'Steven Spielberg'. [/s>
SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000
CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR)
What is the name of the movie produced after 2000 and directed by James Cameron?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000 Context: CREATE TABLE Movie (title VARCHAR, director VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the movie produced after 2000 and directed by James Cameron? The answer to your question is: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000. [/s>
SELECT COUNT(*) FROM Movie WHERE YEAR < 2000
CREATE TABLE Movie (YEAR INTEGER)
How many movies were made before 2000?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Movie WHERE YEAR < 2000 Context: CREATE TABLE Movie (YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many movies were made before 2000? The answer to your question is: SELECT COUNT(*) FROM Movie WHERE YEAR < 2000. [/s>
SELECT director FROM Movie WHERE title = 'Avatar'
CREATE TABLE Movie (director VARCHAR, title VARCHAR)
Who is the director of movie Avatar?
<s>[INST] Given the following SQL query and context: Query: SELECT director FROM Movie WHERE title = 'Avatar' Context: CREATE TABLE Movie (director VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the director of movie Avatar? The answer to your question is: SELECT director FROM Movie WHERE title = 'Avatar'. [/s>
SELECT COUNT(*) FROM Reviewer
CREATE TABLE Reviewer (Id VARCHAR)
How many reviewers listed?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Reviewer Context: CREATE TABLE Reviewer (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many reviewers listed? The answer to your question is: SELECT COUNT(*) FROM Reviewer. [/s>
SELECT rID FROM Reviewer WHERE name LIKE "%Mike%"
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR)
What is the id of the reviewer whose name has substring “Mike”?
<s>[INST] Given the following SQL query and context: Query: SELECT rID FROM Reviewer WHERE name LIKE "%Mike%" Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the reviewer whose name has substring “Mike”? The answer to your question is: SELECT rID FROM Reviewer WHERE name LIKE "%Mike%". [/s>
SELECT rID FROM Reviewer WHERE name = "Daniel Lewis"
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR)
What is the reviewer id of Daniel Lewis?
<s>[INST] Given the following SQL query and context: Query: SELECT rID FROM Reviewer WHERE name = "Daniel Lewis" Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the reviewer id of Daniel Lewis? The answer to your question is: SELECT rID FROM Reviewer WHERE name = "Daniel Lewis". [/s>
SELECT COUNT(*) FROM Rating WHERE stars > 3
CREATE TABLE Rating (stars INTEGER)
What is the total number of ratings that has more than 3 stars?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Rating WHERE stars > 3 Context: CREATE TABLE Rating (stars INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the total number of ratings that has more than 3 stars? The answer to your question is: SELECT COUNT(*) FROM Rating WHERE stars > 3. [/s>
SELECT MAX(stars), MIN(stars) FROM Rating
CREATE TABLE Rating (stars INTEGER)
What is the lowest and highest rating star?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(stars), MIN(stars) FROM Rating Context: CREATE TABLE Rating (stars INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the lowest and highest rating star? The answer to your question is: SELECT MAX(stars), MIN(stars) FROM Rating. [/s>
SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year
CREATE TABLE Movie (mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR)
Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year Context: CREATE TABLE Movie (mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. The answer to your question is: SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year. [/s>
SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5
CREATE TABLE Movie (director VARCHAR, title VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR)
What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5 Context: CREATE TABLE Movie (director VARCHAR, title VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of directors who directed movies with 5 star rating? Also return the title of these movies. The answer to your question is: SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5. [/s>
SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name
CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (stars INTEGER, rID VARCHAR)
What is the average rating star for each reviewer?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name Context: CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (stars INTEGER, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average rating star for each reviewer? The answer to your question is: SELECT T2.name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name. [/s>
SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating)
CREATE TABLE Rating (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
Find the titles of all movies that have no ratings.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating) Context: CREATE TABLE Rating (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the titles of all movies that have no ratings. The answer to your question is: SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating). [/s>
SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = "null"
CREATE TABLE Rating (rID VARCHAR); CREATE TABLE Reviewer (rID VARCHAR)
Find the names of all reviewers who have ratings with a NULL value for the date.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = "null" Context: CREATE TABLE Rating (rID VARCHAR); CREATE TABLE Reviewer (rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all reviewers who have ratings with a NULL value for the date. The answer to your question is: SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID = T2.rID WHERE ratingDate = "null". [/s>
SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie)
CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER)
What is the average rating stars and title for the oldest movie?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie) Context: CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average rating stars and title for the oldest movie? The answer to your question is: SELECT AVG(T1.stars), T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MIN(YEAR) FROM Movie). [/s>
SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie)
CREATE TABLE Movie (title VARCHAR, YEAR INTEGER)
What is the name of the most recent movie?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie) Context: CREATE TABLE Movie (title VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the name of the most recent movie? The answer to your question is: SELECT title FROM Movie WHERE YEAR = (SELECT MAX(YEAR) FROM Movie). [/s>
SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie)
CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER); CREATE TABLE Movie (year VARCHAR, mID VARCHAR)
What is the maximum stars and year for the most recent movie?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie) Context: CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (YEAR INTEGER); CREATE TABLE Movie (year VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the maximum stars and year for the most recent movie? The answer to your question is: SELECT MAX(T1.stars), T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.year = (SELECT MAX(YEAR) FROM Movie). [/s>
SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = "Steven Spielberg")
CREATE TABLE Movie (title VARCHAR, YEAR INTEGER, director VARCHAR)
What is the names of movies whose created year is after all movies directed by Steven Spielberg?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = "Steven Spielberg") Context: CREATE TABLE Movie (title VARCHAR, YEAR INTEGER, director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the names of movies whose created year is after all movies directed by Steven Spielberg? The answer to your question is: SELECT title FROM Movie WHERE YEAR > (SELECT MAX(YEAR) FROM Movie WHERE director = "Steven Spielberg"). [/s>
SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = "James Cameron")
CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)
What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = "James Cameron") Context: CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the titles and directors of the movies whose star is greater than the average stars of the movies directed by James Cameron? The answer to your question is: SELECT T2.title, T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars > (SELECT AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.director = "James Cameron"). [/s>
SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name, T2.title, T1.stars
CREATE TABLE Rating (stars VARCHAR, ratingDate VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name, T2.title, T1.stars Context: CREATE TABLE Rating (stars VARCHAR, ratingDate VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars. The answer to your question is: SELECT T3.name, T2.title, T1.stars, T1.ratingDate FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID ORDER BY T3.name, T2.title, T1.stars. [/s>
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3
CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR)
Find the names of all reviewers who have contributed three or more ratings.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3 Context: CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all reviewers who have contributed three or more ratings. The answer to your question is: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3. [/s>
SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'
CREATE TABLE Movie (mID VARCHAR, title VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
Find the names of all reviewers who rated Gone with the Wind.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind' Context: CREATE TABLE Movie (mID VARCHAR, title VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all reviewers who rated Gone with the Wind. The answer to your question is: SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.title = 'Gone with the Wind'. [/s>
SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
Find the names of all directors whose movies are rated by Sarah Martinez.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez' Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all directors whose movies are rated by Sarah Martinez. The answer to your question is: SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Sarah Martinez'. [/s>
SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name
CREATE TABLE Rating (stars VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, director VARCHAR)
For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name Context: CREATE TABLE Rating (stars VARCHAR, mID VARCHAR, rID VARCHAR); CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars. The answer to your question is: SELECT DISTINCT T3.name, T2.title, T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name. [/s>
SELECT name FROM Reviewer UNION SELECT title FROM Movie
CREATE TABLE Reviewer (name VARCHAR, title VARCHAR); CREATE TABLE Movie (name VARCHAR, title VARCHAR)
Return all reviewer names and movie names together in a single list.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Reviewer UNION SELECT title FROM Movie Context: CREATE TABLE Reviewer (name VARCHAR, title VARCHAR); CREATE TABLE Movie (name VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return all reviewer names and movie names together in a single list. The answer to your question is: SELECT name FROM Reviewer UNION SELECT title FROM Movie. [/s>
SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
Find the titles of all movies not reviewed by Chris Jackson.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson' Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR); CREATE TABLE Movie (title VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the titles of all movies not reviewed by Chris Jackson. The answer to your question is: SELECT DISTINCT title FROM Movie EXCEPT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Chris Jackson'. [/s>
SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title
CREATE TABLE Movie (title VARCHAR, director VARCHAR); CREATE TABLE Movie (director VARCHAR, title VARCHAR)
For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title Context: CREATE TABLE Movie (title VARCHAR, director VARCHAR); CREATE TABLE Movie (director VARCHAR, title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title. The answer to your question is: SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title. [/s>
SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title
CREATE TABLE Movie (director VARCHAR, title VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, director VARCHAR)
For directors who had more than one movie, return the titles and produced years of all movies directed by them.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title Context: CREATE TABLE Movie (director VARCHAR, title VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For directors who had more than one movie, return the titles and produced years of all movies directed by them. The answer to your question is: SELECT T1.title, T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title. [/s>
SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1
CREATE TABLE Movie (director VARCHAR)
What are the names of the directors who made exactly one movie?
<s>[INST] Given the following SQL query and context: Query: SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1 Context: CREATE TABLE Movie (director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the directors who made exactly one movie? The answer to your question is: SELECT director FROM Movie GROUP BY director HAVING COUNT(*) = 1. [/s>
SELECT director FROM Movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 1
CREATE TABLE Movie (director VARCHAR)
What are the names of the directors who made exactly one movie excluding director NULL?
<s>[INST] Given the following SQL query and context: Query: SELECT director FROM Movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 1 Context: CREATE TABLE Movie (director VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the directors who made exactly one movie excluding director NULL? The answer to your question is: SELECT director FROM Movie WHERE director <> "null" GROUP BY director HAVING COUNT(*) = 1. [/s>
SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR)
How many movie reviews does each director get?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director Context: CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (director VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many movie reviews does each director get? The answer to your question is: SELECT COUNT(*), T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director. [/s>
SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1
CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
Find the movies with the highest average rating. Return the movie titles and average rating.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1 Context: CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the movies with the highest average rating. Return the movie titles and average rating. The answer to your question is: SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) DESC LIMIT 1. [/s>
SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) LIMIT 1
CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
What are the movie titles and average rating of the movies with the lowest average rating?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) LIMIT 1 Context: CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the movie titles and average rating of the movies with the lowest average rating? The answer to your question is: SELECT T2.title, AVG(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY AVG(T1.stars) LIMIT 1. [/s>
SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3
CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, mID VARCHAR)
What are the names and years of the movies that has the top 3 highest rating star?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3 Context: CREATE TABLE Rating (mID VARCHAR, stars VARCHAR); CREATE TABLE Movie (title VARCHAR, year VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and years of the movies that has the top 3 highest rating star? The answer to your question is: SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3. [/s>
SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director
CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director Context: CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL. The answer to your question is: SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director. [/s>
SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID
CREATE TABLE Rating (rID VARCHAR, stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
Find the title and star rating of the movie that got the least rating star for each reviewer.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID Context: CREATE TABLE Rating (rID VARCHAR, stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the title and star rating of the movie that got the least rating star for each reviewer. The answer to your question is: SELECT T2.title, T1.rID, T1.stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID. [/s>
SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director
CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR)
Find the title and score of the movie with the lowest rating among all movies directed by each director.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director Context: CREATE TABLE Rating (stars INTEGER, mID VARCHAR); CREATE TABLE Movie (title VARCHAR, director VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the title and score of the movie with the lowest rating among all movies directed by each director. The answer to your question is: SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director. [/s>
SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
What is the name of the movie that is rated by most of times?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the movie that is rated by most of times? The answer to your question is: SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5
CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, mID VARCHAR)
What are the titles of all movies that have rating star is between 3 and 5?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 Context: CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Movie (title VARCHAR, mID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the titles of all movies that have rating star is between 3 and 5? The answer to your question is: SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5. [/s>
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3
CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars INTEGER)
Find the names of reviewers who had given higher than 3 star ratings.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3 Context: CREATE TABLE Reviewer (name VARCHAR, rID VARCHAR); CREATE TABLE Rating (rID VARCHAR, stars INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the names of reviewers who had given higher than 3 star ratings. The answer to your question is: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3. [/s>
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
Find the average rating star for each movie that are not reviewed by Brittany Harris.
<s>[INST] Given the following SQL query and context: Query: SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR, stars INTEGER); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the average rating star for each movie that are not reviewed by Brittany Harris. The answer to your question is: SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID. [/s>
SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris"
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
What are the ids of the movies that are not reviewed by Brittany Harris.
<s>[INST] Given the following SQL query and context: Query: SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris" Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Rating (mID VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the ids of the movies that are not reviewed by Brittany Harris. The answer to your question is: SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris". [/s>
SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2
CREATE TABLE Rating (mID VARCHAR, stars INTEGER)
Find the average rating star for each movie that received at least 2 ratings.
<s>[INST] Given the following SQL query and context: Query: SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2 Context: CREATE TABLE Rating (mID VARCHAR, stars INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average rating star for each movie that received at least 2 ratings. The answer to your question is: SELECT mID, AVG(stars) FROM Rating GROUP BY mID HAVING COUNT(*) >= 2. [/s>
SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4
CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)
find the ids of reviewers who did not give 4 star.
<s>[INST] Given the following SQL query and context: Query: SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4 Context: CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the ids of reviewers who did not give 4 star. The answer to your question is: SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4. [/s>
SELECT rID FROM Rating WHERE stars <> 4
CREATE TABLE Rating (rID VARCHAR, stars VARCHAR)
Find the ids of reviewers who didn't only give 4 star.
<s>[INST] Given the following SQL query and context: Query: SELECT rID FROM Rating WHERE stars <> 4 Context: CREATE TABLE Rating (rID VARCHAR, stars VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ids of reviewers who didn't only give 4 star. The answer to your question is: SELECT rID FROM Rating WHERE stars <> 4. [/s>
SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000
CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR)
What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000 Context: CREATE TABLE Reviewer (rID VARCHAR, name VARCHAR); CREATE TABLE Movie (title VARCHAR, mID VARCHAR, year VARCHAR); CREATE TABLE Rating (mID VARCHAR, rID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are names of the movies that are either made after 2000 or reviewed by Brittany Harris? The answer to your question is: SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000. [/s>