sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What is the attendance in the bye week after week 5? | SELECT attendance FROM table_name_40 WHERE week > 5 AND opponent = "bye" |
Which party has 24 governments? | SELECT party FROM table_name_46 WHERE governments = "24" |
What is the average rating of Apps falling under the racing genre and what is the percentage ratio of positive sentiment reviews? | SELECT AVG(T1.Rating), CAST(COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Racing' |
How many games have a Score of 1–0, and Points smaller than 66? | SELECT COUNT(game) FROM table_name_9 WHERE score = "1–0" AND points < 66 |
how many archive were when run time is 24:34 | SELECT archive FROM table_2112766_1 WHERE run_time = "24:34" |
With which kind of payment method were the least number of payments processed? | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) ASC LIMIT 1 |
In which region where a game had the lowest number of sales? | SELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id ORDER BY T2.num_sales LIMIT 1 |
In which years cars were produced weighing no less than 3000 and no more than 4000 ? | SELECT DISTINCT year FROM cars_data WHERE weight BETWEEN 3000 AND 4000 |
What of total number of faculty? | SELECT count ( * ) FROM Faculty WHERE building = "NEB" |
Find the name of all students who were in the tryout sorted in alphabetic order. | SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName |
Who has friends that are younger than the average age? | SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person) |
What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID? | SELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label |
How many losses for the team with 3 wins and more than 1919 against? | SELECT MIN(losses) FROM table_name_28 WHERE wins = 3 AND against > 1919 |
What is the highest place for song that was draw number 6? | SELECT MAX(place) FROM table_name_83 WHERE draw = 6 |
The Catalog number is 80809 what is the title? | SELECT title FROM table_11222744_2 WHERE catalog_number = "80809" |
List all the distinct president votes and the vice president votes. | SELECT DISTINCT President_Vote , VICE_President_Vote FROM VOTING_RECORD |
How many orders are priced higher than 1000? | SELECT count ( * ) FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_price > 1000 |
How many percent of customers were inactive? | SELECT CAST(SUM(IIF(active = 0, 1, 0)) AS REAL) * 100 / COUNT(customer_id) FROM customer |
What is the Fri 3 June time for the rider with a Weds 1 June time of 18' 22.66 123.182mph? | SELECT fri_3_june FROM table_29218221_2 WHERE wed_1_june = "18' 22.66 123.182mph" |
What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? | SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman' |
List names of all pilot aged 30 or younger in descending alphabetical order. | SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC |
What is the Skip when the Third was john morris? | SELECT skip FROM table_name_61 WHERE third = "john morris" |
Return the different document ids along with the number of paragraphs corresponding to each, ordered by id. | SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id |
How many customers have two orders or less | SELECT COUNT ( * ) FROM ( SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count ( * ) < = 2 ) |
Which country does customer with first name as Carole and last name as Bernhard lived in? | SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" |
Hi can you tell me the name of the regions not affected by storms? | SELECT region_name FROM region WHERE region_id NOT IN ( SELECT region_id FROM affected_region ) |
What are all companies names? | Select name from manufacturers |
What are the ids for employees who do not work in departments with managers that have ids between 100 and 200? | SELECT * FROM employees WHERE department_id NOT IN (SELECT department_id FROM departments WHERE manager_id BETWEEN 100 AND 200) |
What's that person's name? | select first_name,last_name from actor where actor_id = '9' |
In the match played against Telford United, who was the home team? | SELECT home_team FROM table_name_9 WHERE away_team = "telford united" |
Show all product names and the total quantity ordered for each product name. | SELECT T2.product_name , sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name |
Which Incumbent has a District of massachusetts 8? | SELECT incumbent FROM table_name_47 WHERE district = "massachusetts 8" |
Count the number of people of each sex who have a weight higher than 85. | SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex |
What is the order id and order details for the order more than two invoices. | SELECT T2.order_id, T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id = T2.order_id GROUP BY T2.order_id HAVING COUNT(*) > 2 |
Show the short names of the buildings managed by "Emma". | SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma" |
What is the name of the player who has been chosen the most times for 'Man of the Series'? | SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1 |
How many values for attendance on the date of September 5? | SELECT COUNT(attendance) FROM table_23916462_3 WHERE date = "September 5" |
Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20. | SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20 |
Average of the last receipt cost of the products whose average lead time is 60 days. | SELECT SUM(LastReceiptCost) / COUNT(ProductID) FROM ProductVendor WHERE AverageLeadTime = 60 |
Which year has the least number of movies that was released and what is the title of the movie in that year that has the highest number of rating score of 1? | SELECT DISTINCT T1.movie_release_year, T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = ( SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1 ) AND T2.rating_score = 1 |
Which of these has the largest number of employees? | select Name from Department order by Head desc limit 1 |
What are the names and ids of stations that had more than 14 bikes available on average or were installed in December? | SELECT T1.name , T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(T2.bikes_available) > 14 UNION SELECT name , id FROM station WHERE installation_date LIKE "12/%" |
What is the homepage URL for the journal that published the most papers? | SELECT T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id GROUP BY T1.JournalId ORDER BY COUNT(T1.JournalId) DESC LIMIT 1 |
Find the student ID and middle name for all the students with at most two enrollments. | SELECT T1.student_id, T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) <= 2 |
Find the total payment of the orders by customers from San Francisco. | SELECT SUM(T3.UnitPrice * T3.Quantity * (1 - T3.Discount)) AS TOTALPAYMENT FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.City = 'San Francisco' |
How many streets with restaurants are there in the Northern California region? | SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california' |
Can you add the paper IDs of those to the table please? | SELECT t3.title,t3.paperID 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 = "Ralf" AND t1.lname = "Hinze" |
What was the to par score for Tim Herron, who had a score of 69-72=141? | SELECT to_par FROM table_name_92 WHERE score = 69 - 72 = 141 AND player = "tim herron" |
show the date of the tallest perpetrator. | SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 |
What is the minimum salary in each department? | SELECT MIN(salary) , department_id FROM employees GROUP BY department_id |
Which Points classification has a Trofeo Fast Team of metauro mobili-pinarello, and a Stage of 6? | SELECT points_classification FROM table_name_85 WHERE trofeo_fast_team = "metauro mobili-pinarello" AND stage = "6" |
What is the enrollment for the school with the mascot of the Fighting '59ers? | SELECT enrollment FROM table_name_9 WHERE mascot = "fighting '59ers" |
Name the driver for Laps less than 9 and a grid of 13 | SELECT driver FROM table_name_60 WHERE laps < 9 AND grid = 13 |
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"; |
Who built the car that retired due to suspension before 65 laps? | SELECT constructor FROM table_name_7 WHERE laps < 65 AND time_retired = "suspension" |
What Award was received bby the Motion Picture What's Love Got To Do With It? | SELECT award FROM table_name_97 WHERE motion_picture = "what's love got to do with it" |
How many inspections done in 2010 had serious food safety issue? | SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.risk_level = 3 |
What is the TV Channel of TV series with Episode "A Love of a Lifetime"? List the TV Channel's series name. | SELECT T1.series_name FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T2.Episode = "A Love of a Lifetime" |
Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance. | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT avg(balance) FROM savings) |
What is the sum of Round, when Player is Tim Hunter (RW), and when Pick is less than 54? | SELECT SUM(round) FROM table_name_32 WHERE player = "tim hunter (rw)" AND pick < 54 |
For the publisher which published the most books, show its name. | SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1 |
What are the names of the tourist attractions Vincent and Marcelle visit? | SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Marcelle" |
Show the names and locations of institutions that are founded after 1990 and have the type "Private". | SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private' |
What is Event, when Position is 4th? | SELECT event FROM table_name_94 WHERE position = "4th" |
what is the lowest total when the rank is less than 2 and bronze is more than 0? | SELECT MIN(total) FROM table_name_30 WHERE rank < 2 AND bronze > 0 |
What are the names of all of the students? | select lastname,firstname from list |
Provide the list of the longest movies. Arrange these titles in alphabetical order. | SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film ) |
What is the average number of cars on trains that run in the east direction? | SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' |
Which college does the player John Theus associate with? | SELECT college FROM table_11677691_5 WHERE player = "John Theus" |
Who is the player that plays position f from Fort Wayne Pistons? | SELECT player FROM table_name_89 WHERE team = "fort wayne pistons" AND position = "f" |
What is the average weight of cars each year? | SELECT AVG(Weight), YEAR FROM CARS_DATA GROUP BY YEAR |
Among the businesses which have attribute of beer_and_wine, how many business located in Peoria? | SELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Peoria' AND T1.attribute_value = 'beer_and_wine' |
Home of kings had what score? | SELECT score FROM table_name_64 WHERE home = "kings" |
What is the long name of the country with the description "Estimates are derived from data on foreign-born population." on the series code SM.POP.TOTL? | SELECT T1.LongName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Estimates are derived FROM data on foreign-born population.' AND T2.Seriescode = 'SM.POP.TOTL' |
what's the points with played being 22 and points against being 319 | SELECT points FROM table_13940275_5 WHERE played = "22" AND points_against = "319" |
If the headquarters is Bharatpur, what is the maximum area? | SELECT MAX(area__km²_) FROM table_2168295_1 WHERE headquarters = "Bharatpur" |
Can you list the songs' names? | SELECT song_name from song |
How many employees does each role have? List role description, id and number of employees. | SELECT T1.role_description , T2.role_code , count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code; |
Show the name of cities in the county that has the largest number of police officers. | SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1) |
Which is the ship of Captain Henry Dumaresq? | SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.Name like '%Henry Dumaresq%' |
Find names of all colleges whose enrollment is greater than that of all colleges in the FL state. | SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL') |
What is the Notes of the Country with a Rank of 4? | SELECT notes FROM table_name_31 WHERE rank = 4 |
How much To par has a Place of t1, and a Score of 70-70-71-71=282? | SELECT COUNT(to_par) FROM table_name_47 WHERE place = "t1" AND score = 70 - 70 - 71 - 71 = 282 |
Show all company names and headquarters in the descending order of market value. | SELECT company , headquarters FROM company ORDER BY market_value DESC |
Tell me the venue for 8 june 1931 for st kilda away team | SELECT venue FROM table_name_6 WHERE date = "8 june 1931" AND away_team = "st kilda" |
Name the position for the player born 2 november 1987 | SELECT position FROM table_name_80 WHERE date_of_birth__age_ = "2 november 1987" |
Which locations have 2 or more cinemas with capacity over 300? | SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 2 |
what is the least total when the nation is canada (can) and bronze is less than 0? | SELECT MIN(total) FROM table_name_78 WHERE nation = "canada (can)" AND bronze < 0 |
Who are the top 5 actors with the highest number of films? List their full names and calculate the average number of films for each of the actors. | SELECT T.first_name, T.last_name, num FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 5 |
What seat does Gubernia Warszawska hold? | SELECT seat FROM table_11614581_3 WHERE name_in_polish = "Gubernia warszawska" |
How many 2003 Harley-Davidson Eagle Drag Bikes were ordered? | SELECT SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productName = '2003 Harley-Davidson Eagle Drag Bike' |
How many sacks have 2006 as the year, and a solo less than 62? | SELECT SUM(sacks) FROM table_name_59 WHERE year = "2006" AND solo < 62 |
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"; |
Find the number of students taught by TARRING LEIA. | SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA" |
What is 1996 during the US Open? | SELECT 1996 FROM table_name_72 WHERE tournament = "us open" |
Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way. | SELECT How_to_Get_There , COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There |
What is the locale of the language of the page titled "Abril"? | SELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Abril' |
How many albums are there other than those? | select count ( * ) from ( SELECT * FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count ( T1.id ) > = 10 ) |
In what Round was Pick #12 drafted? | SELECT round FROM table_name_53 WHERE pick__number = 12 |
For the team led by head coach Felix Magath, who is the team captain? | SELECT team AS Captain FROM table_name_91 WHERE head_coach = "felix magath" |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.