context
stringlengths
0
489
instruction
stringlengths
16
244
response
stringlengths
38
557
CREATE TABLE storm (name VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
Show all storm names except for those with at least two affected regions.
SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2
CREATE TABLE storm (Name VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE region (region_id VARCHAR, Region_name VARCHAR)
Find the name of the storm that affected both Afghanistan and Albania regions.
SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'
CREATE TABLE table_name_68 (label VARCHAR, region VARCHAR, format VARCHAR)
What Label has a Region of united states, and a Format of cassette?
SELECT label FROM table_name_68 WHERE region = "united states" AND format = "cassette"
CREATE TABLE table_name_88 (label VARCHAR, format VARCHAR, catalog VARCHAR)
What Label has a Format of cd, and a Catalog of crgd 86136?
SELECT label FROM table_name_88 WHERE format = "cd" AND catalog = "crgd 86136"
CREATE TABLE table_20898602_1 (player VARCHAR, status VARCHAR, position VARCHAR)
how many players played running back where status is made 53-man roster at start of 2009 season
SELECT COUNT(player) FROM table_20898602_1 WHERE status = "Made 53-man roster at start of 2009 season" AND position = "Running back"
CREATE TABLE table_20898602_1 (position VARCHAR, player VARCHAR)
howe many positions did wallace, mike mike wallace play for
SELECT COUNT(position) FROM table_20898602_1 WHERE player = "Wallace, Mike Mike Wallace"
CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
Show the delegates and the names of county they belong to.
SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER)
How many distinct delegates are from counties with population larger than 50000?
SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000
CREATE TABLE election (District VARCHAR, Committee VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
What are the names of the county that the delegates on "Appropriations" committee belong to?
SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations"
CREATE TABLE table_20906175_3 (attempts VARCHAR, name VARCHAR)
How many attempts did Charley Johnson have?
SELECT COUNT(attempts) FROM table_20906175_3 WHERE name = "Charley Johnson"
CREATE TABLE party (Comptroller VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR)
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2
CREATE TABLE table_name_92 (place VARCHAR, to_par VARCHAR)
What Place has a To par of –4?
SELECT place FROM table_name_92 WHERE to_par = "–4"
CREATE TABLE table_name_52 (to_par VARCHAR, country VARCHAR, score VARCHAR)
What To par has a Country of united states, and a Score of 67-66-78-77=288?
SELECT to_par FROM table_name_52 WHERE country = "united states" AND score = 67 - 66 - 78 - 77 = 288
CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
Show the name of each party and the corresponding number of delegates from that party.
SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
Return the names of all counties sorted by population in ascending order.
SELECT County_name FROM county ORDER BY Population
CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
Show the name of the party that has the most delegates.
SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE election (Party VARCHAR, Committee VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
What are the names of parties that have both delegates on "Appropriations" committee and
SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters"
CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR)
Which committees have delegates from both democratic party and liberal party?
SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal"
CREATE TABLE journalist (Nationality VARCHAR, Years_working INTEGER)
Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.
SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3
CREATE TABLE table_20967430_2 (ep INTEGER, original_air_date VARCHAR)
Name the least episode for november 29, 1985
SELECT MIN(ep) FROM table_20967430_2 WHERE original_air_date = "November 29, 1985"
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Name VARCHAR, Event_ID VARCHAR, Event_Attendance VARCHAR)
Show the names of journalists and the names of the events they reported in ascending order
SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR)
Show the names of journalists that have reported more than one event.
SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Name VARCHAR, journalist_ID VARCHAR)
List the names of journalists who have not reported any event.
SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report)
CREATE TABLE news_report (work_type VARCHAR, journalist_id VARCHAR); CREATE TABLE journalist (age INTEGER, journalist_id VARCHAR)
Find the average age and experience working length of journalists working on different role type.
SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type
CREATE TABLE table_2101431_1 (broadcast_date VARCHAR, archive VARCHAR, run_time VARCHAR)
What is the broadcast date of the episode on 16mm t/r that ran 23:25?
SELECT broadcast_date FROM table_2101431_1 WHERE archive = "16mm t/r" AND run_time = "23:25"
CREATE TABLE table_name_71 (place VARCHAR, country VARCHAR, money___$__ VARCHAR, score VARCHAR)
Where did the player place who is from the United States, who made more than $216, and whose score was 74-70-71-69=284?
SELECT place FROM table_name_71 WHERE country = "united states" AND money___$__ > 216 AND score = 74 - 70 - 71 - 69 = 284
CREATE TABLE table_21021796_1 (power VARCHAR, torque VARCHAR, applications VARCHAR)
If torque is n·m (lb·ft) @1600–2400 rpm and applications is 2000 w90x sprinter, what is the power?
SELECT power FROM table_21021796_1 WHERE torque = "N·m (lb·ft) @1600–2400 rpm" AND applications = "2000 W90x Sprinter"
CREATE TABLE Student (Advisor VARCHAR)
Which Advisor has most of students? List advisor and the number of students.
SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1
CREATE TABLE Student (Major VARCHAR)
Which major has least number of students? List the major and the number of students.
SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1
CREATE TABLE table_name_29 (date VARCHAR, competition VARCHAR, opponent VARCHAR)
What date was the UEFA Cup against Panathinaikos?
SELECT date FROM table_name_29 WHERE competition = "uefa cup" AND opponent = "panathinaikos"
CREATE TABLE Type_Of_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR); CREATE TABLE Restaurant_Type (Id VARCHAR)
How many restaurant is the Sandwich type restaurant?
SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
CREATE TABLE Visits_Restaurant (Spent INTEGER); CREATE TABLE Student (Spent INTEGER)
How long does student Linda Smith spend on the restaurant in total?
SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith"
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR)
How many times has the student Linda Smith visited Subway?
SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
CREATE TABLE Restaurant (TIME VARCHAR); CREATE TABLE Visits_Restaurant (TIME VARCHAR); CREATE TABLE Student (TIME VARCHAR)
When did Linda Smith visit Subway?
SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR)
At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.
SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR)
Which student visited restaurant most often? List student's first name and last name.
SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_2102714_1 (archive VARCHAR, run_time VARCHAR)
What was the archive for the episode with a run time of 25:24?
SELECT archive FROM table_2102714_1 WHERE run_time = "25:24"
CREATE TABLE products (product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE regular_order_products (product_id VARCHAR)
Find the name and price of the product that has been ordered the greatest number of times.
SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_name_84 (league_goals INTEGER, total_apps VARCHAR, position VARCHAR, fa_cup_goals VARCHAR, fa_cup_apps VARCHAR)
Who has the lowest league total goals with 0 FA cup goals and no FA cup appearances, plays the DF position and has appeared in total of 3 times?
SELECT MIN(league_goals) FROM table_name_84 WHERE fa_cup_goals = "0" AND fa_cup_apps = "0" AND position = "df" AND total_apps = "3"
CREATE TABLE table_21034801_1 (opponent VARCHAR, record VARCHAR)
How many opponents led to an exactly 7-0 record?
SELECT COUNT(opponent) FROM table_21034801_1 WHERE record = "7-0"
CREATE TABLE table_2102714_1 (archive VARCHAR, run_time VARCHAR)
What is he archive for the episode with a run time of 24:05?
SELECT archive FROM table_2102714_1 WHERE run_time = "24:05"
CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)
Find the names of customers who are not living in the state of California.
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
CREATE TABLE table_name_37 (score VARCHAR, home_team VARCHAR)
What was the score when Sheffield United was the home team?
SELECT score FROM table_name_37 WHERE home_team = "sheffield united"
CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)
Find the names and phone numbers of customers living in California state.
SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
CREATE TABLE table_name_95 (league_goals INTEGER, flt_goals VARCHAR, total_apps VARCHAR, position VARCHAR, league_cup_apps VARCHAR)
What is the sum of League Goals, when Position is "DF", when League Cup Apps is "0", when Total Apps is "7", and when FLT Goals is less than 0?
SELECT SUM(league_goals) FROM table_name_95 WHERE position = "df" AND league_cup_apps = "0" AND total_apps = "7" AND flt_goals < 0
CREATE TABLE Employees (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR)
Find the states which do not have any employee in their record.
SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees)
CREATE TABLE table_name_10 (fa_cup_goals INTEGER, league_cup_goals VARCHAR, fa_cup_apps VARCHAR, total_goals VARCHAR, league_goals VARCHAR)
What is the lowest FA Cup Goals, when Total Goals is greater than 0, when League Goals is "4", when FA Cup Apps is "1", and when League Cup Goals is greater than 0?
SELECT MIN(fa_cup_goals) FROM table_name_10 WHERE total_goals > 0 AND league_goals = 4 AND fa_cup_apps = "1" AND league_cup_goals > 0
CREATE TABLE Delivery_Routes (route_name VARCHAR)
List the names of all routes in alphabetic order.
SELECT route_name FROM Delivery_Routes ORDER BY route_name
CREATE TABLE Delivery_Routes (route_name VARCHAR, route_id VARCHAR); CREATE TABLE Delivery_Route_Locations (route_id VARCHAR)
Find the name of route that has the highest number of deliveries.
SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customer_addresses (address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR)
List the state names and the number of customers living in each state.
SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county
CREATE TABLE table_2104176_1 (air_force_cross VARCHAR, homeland_security_distinguished_service_medal VARCHAR)
What is the air force cross when you recieve the Aerial achievement medal?
SELECT air_force_cross FROM table_2104176_1 WHERE homeland_security_distinguished_service_medal = "Aerial Achievement Medal"
CREATE TABLE table_21058823_1 (result VARCHAR, record VARCHAR)
What did they do in the game when their record was 3-2-1?
SELECT result FROM table_21058823_1 WHERE record = "3-2-1"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
What are the titles of papers published by "Jeremy Gibbons"?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Find all the papers published by "Aaron Turon".
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR)
How many papers have "Atsushi Ohori" published?
SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
What is the name of the institution that "Matthias Blume" belongs to?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
Which institution does "Katsuhiro Ueno" belong to?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)
Who belong to the institution "University of Oxford"? Show the first names and last names.
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
CREATE TABLE table_name_20 (white VARCHAR, opening VARCHAR, moves VARCHAR, black VARCHAR, result VARCHAR)
What's the white for a black of Anand, a result of ½–½, 39 moves, and an opening of d37 queen's gambit declined?
SELECT white FROM table_name_20 WHERE black = "anand" AND result = "½–½" AND moves = 39 AND opening = "d37 queen's gambit declined"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
What are the last names of the author of the paper titled "Binders Unbound"?
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
CREATE TABLE table_name_56 (black VARCHAR, moves VARCHAR, tournament VARCHAR)
What's the black with 24 moves in the dortmund tournament?
SELECT black FROM table_name_56 WHERE moves = 24 AND tournament = "dortmund"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
What are the papers published under the institution "Indiana University"?
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
Find all the papers published by the institution "Google".
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
CREATE TABLE table_21058836_1 (game VARCHAR, opponent VARCHAR)
What game did the Bruins play Santa Clara?
SELECT game FROM table_21058836_1 WHERE opponent = "Santa Clara"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
How many papers are published by the institution "Tokohu University"?
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR)
Find the first and last name of the author(s) who wrote the paper "Nameless, Painless".
SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Which papers have "Stephanie Weirich" as an author?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
Which paper is published in an institution in "USA" and have "Turon" as its second author?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"?
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
What is the last name of the author that has published the most papers?
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
Retrieve the country that has published the most papers.
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
Find the name of the organization that has published the largest number of papers.
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Find the papers which have "Olin Shivers" as an author.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR)
Find the first names of all the authors who have written a paper with title containing the word "Functional".
SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
Find the last names of all the authors that have written a paper with title containing the word "Monadic".
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%"
CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
Retrieve the title of the paper that has the largest number of authors.
SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship)
CREATE TABLE table_2108684_1 (run_time VARCHAR, viewers__in_millions_ VARCHAR)
What is the run time for the episode with 7.9 million viewers?
SELECT run_time FROM table_2108684_1 WHERE viewers__in_millions_ = "7.9"
CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR)
Which city has the most addresses? List the city name, number of addresses, and city id.
SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_21092444_1 (opponents VARCHAR, record VARCHAR)
Name the opponents for record of 2-1
SELECT opponents FROM table_21092444_1 WHERE record = "2-1"
CREATE TABLE film (title VARCHAR, film_id VARCHAR, rental_rate VARCHAR); CREATE TABLE inventory (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR)
Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.
SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3
CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR)
How many cities are in Australia?
SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'
CREATE TABLE table_21094951_1 (result VARCHAR, opponent VARCHAR)
Name the result for ursinus college
SELECT result FROM table_21094951_1 WHERE opponent = "Ursinus College"
CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, first_name VARCHAR); CREATE TABLE payment (payment_date VARCHAR, amount INTEGER)
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.
SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'
CREATE TABLE table_name_10 (score VARCHAR, date VARCHAR, away_team VARCHAR)
What was the score of the game with away team chelsea on 29 january 1983?
SELECT score FROM table_name_10 WHERE date = "29 january 1983" AND away_team = "chelsea"
CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR, description VARCHAR)
Which film has the most number of actors or actresses? List the film name, film id and description.
SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)
Which film actor (actress) starred the most films? List his or her first name, last name and actor id.
SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)
Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30
CREATE TABLE table_name_76 (date VARCHAR, home_team VARCHAR)
What date was the game that home team torquay united played?
SELECT date FROM table_name_76 WHERE home_team = "torquay united"
CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR)
Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.
SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1
CREATE TABLE table_name_89 (place VARCHAR, to_par VARCHAR, score VARCHAR)
What is the Place of the Player with a To par of –10 and a Score of 67-67-66=200?
SELECT place FROM table_name_89 WHERE to_par = "–10" AND score = 67 - 67 - 66 = 200
CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR)
How many films are there in each category? List the genre name, genre id and the count.
SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id
CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR)
Which film has the most copies in the inventory? List both title and id.
SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (inventory_id VARCHAR, film_id VARCHAR); CREATE TABLE rental (inventory_id VARCHAR)
What is the film title and inventory id of the item in the inventory which was rented most frequently?
SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_21109892_1 (quantity_world_rank VARCHAR, value_world_rank VARCHAR)
where value world rank is 12, what is the quantity world rank?
SELECT quantity_world_rank FROM table_21109892_1 WHERE value_world_rank = "12"
CREATE TABLE table_name_15 (craft VARCHAR, location VARCHAR)
What is the Craft used at Coniston Water?
SELECT craft FROM table_name_15 WHERE location = "coniston water"
CREATE TABLE film (title VARCHAR, special_features VARCHAR)
Which movies have 'Deleted Scenes' as a substring in the special feature?
SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
CREATE TABLE table_name_71 (second_party VARCHAR, first_party VARCHAR, election VARCHAR)
What is the second party that has a conservative first party in the 1834 election?
SELECT second_party FROM table_name_71 WHERE first_party = "conservative" AND election = "1834"
CREATE TABLE table_name_3 (second_member VARCHAR, first_member VARCHAR, second_party VARCHAR)
Who is the second member with first member Sir Rowland Hill, BT, and a conservative second party?
SELECT second_member FROM table_name_3 WHERE first_member = "sir rowland hill, bt" AND second_party = "conservative"
CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (customer_id VARCHAR, rental_date VARCHAR)
What is the first name and the last name of the customer who made the earliest rental?
SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1
CREATE TABLE customer (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE rental (staff_id VARCHAR, customer_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR)
What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?
SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'