db_id stringclasses 40
values | query stringlengths 22 608 | question stringlengths 22 185 |
|---|---|---|
boat_1 | SELECT bid , count(*) FROM Reserves WHERE sid > 1 GROUP BY bid | How many reservations for each boat did the sailors with an id greater than 1 make? |
boat_1 | SELECT T1.rating , avg(T1.age) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.color = 'red' GROUP BY T1.rating | What is the rating and average age for sailors who have reserved red boat grouped by rating? |
boat_1 | SELECT T1.rating , avg(T1.age) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.color = 'red' GROUP BY T1.rating | What are the rating and average age for sailors who reserved red boats for each rating? |
boat_1 | SELECT name , rating , age FROM Sailors ORDER BY rating , age | Find the name, rating and age of all sailors ordered by rating and age. |
boat_1 | SELECT name , rating , age FROM Sailors ORDER BY rating , age | What is the name, rating, and age for every sailor? And order them by rating and age. |
boat_1 | SELECT count(*) FROM Boats | Find the total number of boats. |
boat_1 | SELECT count(*) FROM Boats | How many boats are there? |
boat_1 | SELECT count(*) FROM Boats WHERE color = 'red' | How many boats are red? |
boat_1 | SELECT count(*) FROM Boats WHERE color = 'red' | How many red boats exist? |
boat_1 | SELECT T3.name FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T1.age BETWEEN 20 AND 30 | Find the names of boats booked by sailors whose age is between 20 and 30. |
boat_1 | SELECT T3.name FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T1.age BETWEEN 20 AND 30 | What are the names of the boats booked by people between age 20 and 30? |
boat_1 | SELECT name FROM Sailors WHERE rating > (SELECT max(T1.rating) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.color = 'red') | Find the names of sailors whose rating is larger than the rating of all sailors who booked a red boat. |
boat_1 | SELECT name FROM Sailors WHERE rating > (SELECT max(T1.rating) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.color = 'red') | What are the names of the sailors whose rating is larger than the rating of all sailors who booked a red boat? |
boat_1 | SELECT max(rating) FROM Sailors | What is highest rating between sailors? |
boat_1 | SELECT max(rating) FROM Sailors | What is the maximum rating for sailors? |
boat_1 | SELECT T1.name FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.name = 'Melon' | Find the names of sailors who reserved boat with the name Melon. |
boat_1 | SELECT T1.name FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.name = 'Melon' | What are the names of sailors who reserved a boat with the name Melon? |
boat_1 | SELECT name , age FROM Sailors ORDER BY rating DESC | List the names and ages of all sailors sorted by rating in descending order. |
boat_1 | SELECT name , age FROM Sailors ORDER BY rating DESC | What are the names and ages of all sailors sorted by decreasing rating? |
headphone_store | SELECT model FROM headphone ORDER BY price DESC LIMIT 1 | Find the model of the most expensive headphone. |
headphone_store | SELECT model FROM headphone ORDER BY price DESC LIMIT 1 | Which headphone model has the highest price? |
headphone_store | SELECT DISTINCT model FROM headphone ORDER BY model | List all different headphone models in the alphabetical order. |
headphone_store | SELECT DISTINCT model FROM headphone ORDER BY model | Return the list of distinct headphone models ordered alphabetically. |
headphone_store | SELECT CLASS FROM headphone GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1 | Which headphone class is the most common one? |
headphone_store | SELECT CLASS FROM headphone GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1 | Which headphone class contains the most headphones? |
headphone_store | SELECT CLASS FROM headphone GROUP BY CLASS HAVING count(*) > 2 | Which headphone class does have more than two headphones? |
headphone_store | SELECT CLASS FROM headphone GROUP BY CLASS HAVING count(*) > 2 | Find the headphone class that does not contain more than two headphones. |
headphone_store | SELECT count(*) , CLASS FROM headphone WHERE price > 200 GROUP BY CLASS | Find the number of headphones with a price higher than 200 for each class. |
headphone_store | SELECT count(*) , CLASS FROM headphone WHERE price > 200 GROUP BY CLASS | How many headphones cost more than 200 for each headphone class? |
headphone_store | SELECT count(DISTINCT earpads) FROM headphone | how many different earpads are there? |
headphone_store | SELECT count(DISTINCT earpads) FROM headphone | Count the number of different earpads. |
headphone_store | SELECT earpads FROM headphone GROUP BY earpads ORDER BY count(*) DESC LIMIT 2 | Find the top 2 earpads that are mostly used. |
headphone_store | SELECT earpads FROM headphone GROUP BY earpads ORDER BY count(*) DESC LIMIT 2 | What are the top 2 earpads in terms of the number of headphones using them? |
headphone_store | SELECT model , CLASS , construction FROM headphone ORDER BY price LIMIT 1 | What are the model, class, and construction of the cheapest headphone? |
headphone_store | SELECT model , CLASS , construction FROM headphone ORDER BY price LIMIT 1 | Find the model, class, and construction of the headphone with the lowest price. |
headphone_store | SELECT construction , avg(price) FROM headphone GROUP BY construction | Find the average price for each headphone construction. |
headphone_store | SELECT construction , avg(price) FROM headphone GROUP BY construction | How much does headphones cost on average for each headphone construction? |
headphone_store | SELECT CLASS FROM headphone WHERE earpads = 'Bowls' INTERSECT SELECT CLASS FROM headphone WHERE earpads = 'Comfort Pads' | Which headphone classes have both headphones with "Bowls" and headphones with "Comfort Pads" earpads? |
headphone_store | SELECT CLASS FROM headphone WHERE earpads = 'Bowls' INTERSECT SELECT CLASS FROM headphone WHERE earpads = 'Comfort Pads' | Find the headphone classes that contain both headphones using "Bowls" earpads and headphones using "Comfort Pads" earpads. |
headphone_store | SELECT earpads FROM headphone EXCEPT SELECT earpads FROM headphone WHERE construction = 'Plastic' | Which earpads never use plastic construction? |
headphone_store | SELECT earpads FROM headphone EXCEPT SELECT earpads FROM headphone WHERE construction = 'Plastic' | Find all earpads that do not use plastic construction. |
headphone_store | SELECT model FROM headphone WHERE price < (SELECT avg(price) FROM headphone) | Find the headphone models whose price is below the average price. |
headphone_store | SELECT model FROM headphone WHERE price < (SELECT avg(price) FROM headphone) | What are the headphone models that cost less than the average price? |
headphone_store | SELECT name FROM store ORDER BY date_opened | Sort all store names by store open date. |
headphone_store | SELECT name FROM store ORDER BY date_opened | Give me a list of store names, sorted by store open date. |
headphone_store | SELECT name , parking FROM store WHERE neighborhood = 'Tarzana' | List name and parking info for the stores in the Tarzana neighborhood. |
headphone_store | SELECT name , parking FROM store WHERE neighborhood = 'Tarzana' | Which stores are located in the "Tarzana" neighborhood? Return their names and parking information. |
headphone_store | SELECT count(DISTINCT neighborhood) FROM store | How many different neighborhoods are there for all stores? |
headphone_store | SELECT count(DISTINCT neighborhood) FROM store | Count the number of distinct neighborhoods stores are located. |
headphone_store | SELECT count(*) , neighborhood FROM store GROUP BY neighborhood | find the number of stores in each neighborhood. |
headphone_store | SELECT count(*) , neighborhood FROM store GROUP BY neighborhood | How many stores are there in each neighborhood? |
headphone_store | SELECT t1.name , sum(t2.quantity) FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id GROUP BY t2.store_id ORDER BY sum(t2.quantity) DESC LIMIT 1 | Find the name of the store which has the most headphones in stock. List the number of headphones as well. |
headphone_store | SELECT t1.name , sum(t2.quantity) FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id GROUP BY t2.store_id ORDER BY sum(t2.quantity) DESC LIMIT 1 | Which store has the headphones in stock? Give me the store name and the total quantity. |
headphone_store | SELECT name FROM store WHERE store_id NOT IN (SELECT store_id FROM stock) | Find the name of stores which have no headphone in stock. |
headphone_store | SELECT name FROM store WHERE store_id NOT IN (SELECT store_id FROM stock) | Which stores do not have any headphones in stock? Give me the store names. |
headphone_store | SELECT model FROM headphone WHERE headphone_id NOT IN (SELECT headphone_id FROM stock) | Which headphone models do not have any stock in any store? |
headphone_store | SELECT model FROM headphone WHERE headphone_id NOT IN (SELECT headphone_id FROM stock) | Find the headphone models that are not in stock in any store. |
headphone_store | SELECT t1.model FROM headphone AS t1 JOIN stock AS t2 ON t1.headphone_id = t2.headphone_id GROUP BY t1.model ORDER BY sum(t2.quantity) DESC LIMIT 1 | Which headphone model has the largest quantity of stock across all the stores? |
headphone_store | SELECT t1.model FROM headphone AS t1 JOIN stock AS t2 ON t1.headphone_id = t2.headphone_id GROUP BY t1.model ORDER BY sum(t2.quantity) DESC LIMIT 1 | Find the headphone model whose total quantity in stock is the largest. |
headphone_store | SELECT sum(t2.quantity) FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id WHERE t1.name = 'Woodman' | How many headphones are stored in the Woodman store? |
headphone_store | SELECT sum(t2.quantity) FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id WHERE t1.name = 'Woodman' | Find the total quantity of headphones stored in the Woodman store. |
headphone_store | SELECT Neighborhood FROM store EXCEPT SELECT t1.Neighborhood FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id | Which neighborhood does not have any headphone in stock? |
headphone_store | SELECT Neighborhood FROM store EXCEPT SELECT t1.Neighborhood FROM store AS t1 JOIN stock AS t2 ON t1.store_id = t2.store_id | Find the neighborhood where no headphones are in stock. |
aan_1 | SELECT count(*) FROM Author | How many authors do we have? |
aan_1 | SELECT count(*) FROM Author | Count the number of authors. |
aan_1 | SELECT count(*) FROM Paper | How many papers do we have? |
aan_1 | SELECT count(*) FROM Paper | Count the number of papers. |
aan_1 | SELECT count(*) FROM Affiliation | How many affiliations do we have? |
aan_1 | SELECT count(*) FROM Affiliation | Count the number of affiliations. |
aan_1 | SELECT count(*) FROM Paper WHERE venue = "NAACL" AND YEAR = 2000 | How many papers do we have in NAACL 2000? |
aan_1 | SELECT count(*) FROM Paper WHERE venue = "NAACL" AND YEAR = 2000 | Count the number of papers in NAACL 2000. |
aan_1 | SELECT count(DISTINCT T1.paper_id) FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name LIKE "Columbia University" AND T1.year = 2009 | How many papers are published in year 2009 by Columbia University? |
aan_1 | SELECT count(DISTINCT T1.paper_id) FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name LIKE "Columbia University" AND T1.year = 2009 | Count the number of papers published by Columbia University in 2009. |
aan_1 | SELECT DISTINCT name , address FROM Affiliation | List names and addresses for all affiliations. |
aan_1 | SELECT DISTINCT name , address FROM Affiliation | What are the names and addresses for all affiliations? |
aan_1 | SELECT DISTINCT venue , YEAR FROM paper ORDER BY YEAR | List all venues and years for papers ordered by year. |
aan_1 | SELECT DISTINCT venue , YEAR FROM paper ORDER BY YEAR | What are the distinct venues for papers, ordered by year? |
aan_1 | SELECT DISTINCT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name = "Harvard University" | Find the titles and paper IDs for papers written by Harvard University. |
aan_1 | SELECT DISTINCT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name = "Harvard University" | What are the titles and paper ids for papers written in affiliation with Harvard University? |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T3.author_id = T2.author_id WHERE T3.name LIKE "%Mckeown%" | Find all papers with titles and paper IDs written by Mckeown. |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T3.author_id = T2.author_id WHERE T3.name LIKE "%Mckeown%" | What are the titles and paper ids for papers written by Mckeown? |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name LIKE "Stanford University" INTERSECT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id... | Find all papers with titles and paper IDs collaborated by Stanford University and Columbia University. |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T3.name LIKE "Stanford University" INTERSECT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id... | What are the titles and paper ids for papers which were affiliated with both Stanford and Columbia University? |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown , Kathleen%" INTERSECT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author ... | Find all papers with titles and paper IDs co-authored by Mckeown, Kathleen and Rambow, Owen. |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown , Kathleen%" INTERSECT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author ... | What are the titles and paper ids co-authored by Mckeown, Kathleen and Rambow, Owen? |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown%" EXCEPT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.aut... | Find the titles and paper IDs for papers which have Mckeown but not Rambow in author list. |
aan_1 | SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown%" EXCEPT SELECT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.aut... | What are the titles and paper ids which have Mckeown as an author, but not Rambow? |
aan_1 | SELECT DISTINCT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown , Kathleen%" OR T3.name LIKE "%Rambow , Owen%" | Find the titles and paper IDs for papers which have Mckeown, Kathleen or Rambow, Owen in author list. |
aan_1 | SELECT DISTINCT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown , Kathleen%" OR T3.name LIKE "%Rambow , Owen%" | What are the titles and paper ids for papers that have Mckeown, Kathleen or Rambow, Owen in their author list? |
aan_1 | SELECT T1.name , count(*) FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id ORDER BY count(*) DESC | List the names of all authors and their number of papers in descending order by number of papers. |
aan_1 | SELECT T1.name , count(*) FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id ORDER BY count(*) DESC | How many papers did each author publish, ordered by number of papers? |
aan_1 | SELECT T1.name FROM Affiliation AS T1 JOIN Author_list AS T2 ON T1.affiliation_id = T2.affiliation_id GROUP BY T1.affiliation_id ORDER BY count(*) DESC | List all affiliations with ascending ordered number of papers. |
aan_1 | SELECT T1.name FROM Affiliation AS T1 JOIN Author_list AS T2 ON T1.affiliation_id = T2.affiliation_id GROUP BY T1.affiliation_id ORDER BY count(*) DESC | What are the names of all affiliations, ordered by number of papers? |
aan_1 | SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id HAVING count(*) > 50 | List names of all authors who have more than 50 papers. |
aan_1 | SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id HAVING count(*) > 50 | What are the names of all authors who have more than 50 papers? |
aan_1 | SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id HAVING count(*) = 1 | List names of all authors who have only 1 paper. |
aan_1 | SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id HAVING count(*) = 1 | What are the names of authors who have exactly 1 paper? |
aan_1 | SELECT venue , YEAR FROM paper GROUP BY venue , YEAR ORDER BY count(*) DESC LIMIT 1 | What is the venue and year with the most number of publications? |
aan_1 | SELECT venue , YEAR FROM paper GROUP BY venue , YEAR ORDER BY count(*) DESC LIMIT 1 | What was the venue and year with the most publications? |
aan_1 | SELECT venue FROM paper GROUP BY venue ORDER BY count(*) LIMIT 1 | What is the venue with the least number of publications? |
Subsets and Splits
World Countries Non-English Languages
The query filters specific database entries based on a particular query pattern, providing limited insight as it simply retrieves rows that match a specific condition.