sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Who is the Home Team for Match No. 23? | SELECT home_team FROM table_name_42 WHERE match_no = "23" |
what's the party for the first elected in 1980 | SELECT party FROM table_1341472_15 WHERE first_elected = "1980" |
Name products and their quantity ordered by the company 'GROSELLA-Restaurante' in the sales order that was processed by Nancy Davolio. | SELECT T4.ProductName, T3.Quantity FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID INNER JOIN Customers AS T5 ON T2.CustomerID = T5.CustomerID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio' AND T5.CompanyName = 'GROSELLA-Restaurante' |
Tell me the Location and Country of the Round 1 ? | SELECT location , country FROM match WHERE round = "1.0" |
Find the titles and studios of the films that are produced by some film studios that contained the word "Universal". | SELECT title , Studio FROM film WHERE Studio LIKE "%Universal%" |
Which driver won the Indianapolis 500 the year the Chaparral team also won it? | SELECT winning_driver FROM table_name_67 WHERE winning_team = "chaparral" AND name = "indianapolis 500" |
What was the smallest total number of medals? | SELECT MIN(total_medals) FROM table_1305623_20 |
What country have its data estimated based on regression? | SELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Estimates are based on regression.' |
How many students are enrolled in French? | select count ( * ) from Student_Course_Enrolment AS T1 JOIN Courses AS T2 ON T2.course_id = T1.course_id WHERE course_name = 'French' |
what's the earliest year that the wimbledon opponent was zheng jie? | SELECT MIN(year) FROM table_name_50 WHERE event = "wimbledon" AND opponent = "zheng jie" |
How many times was product id 13 ordered? | SELECT count ( * ) FROM order_items GROUP BY product_id having product_id = "13" |
How many states have a college with more students than average? | SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college) |
What is the maximum number of draws when the diff is smaller than 186, points are fewer than 12 and games played fewer than 6? | SELECT MAX(drawn) FROM table_name_86 WHERE diff < 186 AND points < 12 AND played < 6 |
Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge. | SELECT T1.fname , T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid NOT IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') |
How many different actors have played a role in the highest rating movie? | SELECT COUNT(DISTINCT T2.actorid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 |
Which product ID do not have any work order ID? | SELECT ProductID FROM Product WHERE ProductID NOT IN ( SELECT T1.ProductID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID ) |
What is the nationality of lane 4? | SELECT nationality FROM table_name_78 WHERE lane = 4 |
Who was the vacator for the district of Nebraska at-large? | SELECT vacator FROM table_2417390_4 WHERE district = "Nebraska At-large" |
If puma is 12, what is camper? | SELECT MIN(camper) FROM table_26894949_2 WHERE puma = "12" |
Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 |
How many employees do we have? | SELECT count(*) FROM Employees; |
How many Minipumps have been sold? | SELECT COUNT(OrderQty) FROM SalesOrderDetail WHERE ProductID IN ( SELECT ProductID FROM Product WHERE Name = 'Minipump' ) |
During which years was the Model 318td (diesel) with the Engine code of m47d20 manufactured? | SELECT years FROM table_name_64 WHERE engine_code = "m47d20" AND model = "318td (diesel)" |
what is the name of swimmer with id 5? | SELECT name FROM swimmer where id = 5 |
Can you find the bridge name Xian Ren Qiao? | SELECT * from bridge where name = "Xian Ren Qiao ( Fairy Bridge ) " |
List the final tables made and the best finishes of poker players. | SELECT Final_Table_Made, Best_Finish FROM poker_player |
What is the total of Golds with more bronzes than 1 and totaled larger than 4? | SELECT COUNT(gold) FROM table_name_64 WHERE bronze > 1 AND total > 4 |
Who is the opposing team when the game was played on the Shea Stadium? | SELECT opponent FROM table_17386066_2 WHERE stadium = "Shea stadium" |
Who is the driver for the Forsythe Racing team that has the best time of 1:00.099? | SELECT name FROM table_name_42 WHERE team = "forsythe racing" AND best = "1:00.099" |
When someone was first elected in 1898 what was the result? | SELECT result FROM table_name_53 WHERE first_elected = "1898" |
How many percent more of the watchers for the repository of solution No.83855 than No.1502? | SELECT CAST(SUM(CASE WHEN T2.Id = 83855 THEN T1.Watchers ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Watchers ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Watchers ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId |
which musical ids showed up at least three times in the actor table? | SELECT T2.musical_id FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT ( * ) > = 3 |
How many appelations are in Napa Country? | SELECT count(*) FROM APPELLATIONS WHERE County = "Napa" |
What are the years that have un posto al sole as the soap opera, with riccardo polizzy carbonelli as the actor? | SELECT years FROM table_name_45 WHERE soap_opera = "un posto al sole" AND actor = "riccardo polizzy carbonelli" |
What is the sum of carries associated with 80 points and fewer than 16 touchdowns? | SELECT SUM(carries) FROM table_name_98 WHERE points = 80 AND touchdowns < 16 |
What's the average wins of those games with 3 podiums? | SELECT AVG(wins) FROM table_name_42 WHERE podiums = 3 |
Which employee has created the least order and please indicates the employee's title? | SELECT T1.Title FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.Title ORDER BY COUNT(T2.OrderID) LIMIT 1 |
What was the most popular position at tryouts? | SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1 |
When are end dates (last night) for the season of 1918? | SELECT end_date__last_night_ FROM table_159359_2 WHERE season = "1918" |
what's the result with district being washington 7 | SELECT result FROM table_1341472_49 WHERE district = "Washington 7" |
What is the title of the episode directed by Charles Beeson? | SELECT title FROM table_24649082_1 WHERE directed_by = "Charles Beeson" |
Did license number 1222441 pass the inspection and what is the zip code number of it? | SELECT DISTINCT T2.results, T1.zip FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.license_no = 1222441 |
What is the model of the enginge d5252 t? | SELECT model_name FROM table_1147701_5 WHERE engine_code = "D5252 T" |
Please list staff names of staff assigned to at least 1 problem | First or last name? | both | SELECT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1 |
What is the Cavaliers Record in the game with a Score of 98-99? | SELECT record FROM table_name_59 WHERE score = "98-99" |
What was its description? | SELECT T1.fault_log_entry_id , T1.fault_description FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count ( * ) asc LIMIT 1 |
exactly | I mean which one do you want to know, first name or last name or both? | i want first name | SELECT FName FROM Student ORDER BY Advisor DESC LIMIT 1 |
Which product have they complained about? | Who do you mean by "they"? | Customer, 113. | SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id JOIN customers AS t3 GROUP BY t3.customer_id having t3.customer_id = "113" |
Please list the IDs of the users who answered "Yes" to the question "Do you think that discussing a physical health issue with your employer would have negative consequences?" in 2014's survey. | SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'Do you think that discussing a physical health issue with your employer would have negative consequences?' AND T2.AnswerText LIKE 'Yes' AND T2.SurveyID = 2014 |
What was the date of the inauguration in the row with an entry of lifespan in the lifespan column? | SELECT date_of_inauguration FROM table_name_71 WHERE "lifespan" = "lifespan" |
Which venue had a lost 5-4 result? | SELECT venue FROM table_name_15 WHERE result = "lost 5-4" |
When was the result l 14–24? | SELECT date FROM table_name_71 WHERE result = "l 14–24" |
Please provide the attribute values of the bussinesses with fashion in Scottsdale. | SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T4.category_name LIKE 'Fashion' AND T1.city LIKE 'Scottsdale' |
What was the score when the total was 75–53? | SELECT score FROM table_name_89 WHERE total = "75–53" |
What was the maximum 09-10 i/o best? | SELECT MAX(09 AS _10_i_o_best) FROM table_24990183_4 |
How many domestic violence cases were reported in May 2018? | SELECT COUNT(*) FROM Crime WHERE date LIKE '5/%/2018%' AND domestic = 'TRUE' |
What was the average crowd attendance for the Junction Oval venue? | SELECT AVG(crowd) FROM table_name_36 WHERE venue = "junction oval" |
Which country produced the car with the lowest price? | SELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1 |
What year was Jamboree made? | SELECT year FROM table_name_26 WHERE movie_title = "jamboree" |
What are the average points White made with 0 extra points? | SELECT AVG(points) FROM table_name_14 WHERE extra_points = 0 AND player = "white" |
What is the document type name and the document type description and creation date for all the documents? | SELECT T1.document_type_name , T1.document_type_description , T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code |
How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? | SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin"; |
List all the organisations that where its name contains 'United Nation'. State its full name and its headquarter city. | SELECT Name, City FROM organization WHERE Name LIKE '%United Nation%' |
List the ship ID of shipments shipped to the most populated city. | SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.population DESC LIMIT 1 |
Which visitor has detroit as the home, and february 24 as the date? | SELECT visitor FROM table_name_76 WHERE home = "detroit" AND date = "february 24" |
What is the genre name of the film HUNGER ROOF? | SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF' |
What team is in the city of Rock Island? | SELECT team_name FROM table_27961684_1 WHERE city = "Rock Island" |
What are the school colors for the college whose main campus is overland park? | SELECT school_colors FROM table_name_66 WHERE main_campus_location = "overland park" |
Which modern house title translates to prison? | SELECT modern_title_of_house FROM table_name_46 WHERE translation = "prison" |
What counties have more police officers than that? | do you want to return their names? | Yes, please. | SELECT Name FROM county_public_safety where Police_officers > ( SELECT Police_officers FROM county_public_safety ORDER BY Population DESC LIMIT 1 ) |
Find courses that ran in Fall 2009 but not in Spring 2010. | SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010 |
How many players have more than 1000 hours of training? | SELECT count(*) FROM Player WHERE HS > 1000 |
How many templates have template type code CV? | SELECT count(*) FROM Templates WHERE template_type_code = "CV" |
Show all account ids and account details. | SELECT account_id , account_details FROM Accounts |
What is the percentage of the actors that showed up in the credit list of movie "Dawn of the Planet of the Apes" that were born after "1970/1/1"? | SELECT CAST(SUM(CASE WHEN T3.`Date of Birth` > '1970-01-01' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.`Date of Birth`) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Dawn of the Planet of the Apes' |
Give me the name of the customer who ordered the most items in total. | SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1 |
Please list the nicknames of the players who have won the All-Rookie award and are born in March. | SELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthMon = 3 |
what is the earliest year when the author is reki kawahara? | SELECT MIN(year) FROM table_name_42 WHERE author = "reki kawahara" |
Which summer Olympic have the highest and lowest number of participants? | SELECT ( SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' GROUP BY T1.games_year ORDER BY COUNT(T2.person_id) DESC LIMIT 1 ) AS HIGHEST , ( SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' GROUP BY T1.games_year ORDER BY COUNT(T2.person_id) LIMIT 1 ) AS LOWEST |
Return the address and email of the customer with the first name Linda. | SELECT T2.address , T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA' |
When did 6.09 million people in the US see the original airing of an episode of the show? | SELECT original_air_date FROM table_23242933_2 WHERE us_viewers__millions_ = "6.09" |
Ok. Can you show all the information for London Heathrow airport? | SELECT * from airport where airport_name = "London Heathrow" |
What place was the viewed horse? | SELECT placing FROM table_name_13 WHERE horse = "viewed" |
Name the entrant for year of 1952 | SELECT entrant FROM table_name_39 WHERE year = 1952 |
What is the most popular industry? | SELECT Industry FROM company GROUP BY Industry ORDER BY COUNT ( * ) DESC LIMIT 1 |
Find the claim that has the largest total settlement amount. Return the effective date of the claim. | SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1 |
Where did Geelong play as the away team? | SELECT venue FROM table_name_75 WHERE away_team = "geelong" |
What is the lowest Attendance, when Date is "February 4", and when Points is less than 57? | SELECT MIN(attendance) FROM table_name_72 WHERE date = "february 4" AND points < 57 |
how many times is the fa cup apps more than 0, the position mf and the league goals 4? | SELECT COUNT(total_goals) FROM table_name_52 WHERE fa_cup_apps > 0 AND position = "mf" AND league_goals = 4 |
Who is the visitor from the game with 7,000 in attendance on January 1? | SELECT visitor FROM table_name_77 WHERE attendance = "7,000" AND date = "january 1" |
What years did the player with the jersey number bigger than 20 play? | SELECT years FROM table_name_5 WHERE jersey_number_s_ > 20 |
Which engineers have never visited to maintain the assets? List the engineer first name and last name. | SELECT first_name , last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits) |
Who is the player with a 77-68=145 score? | SELECT player FROM table_name_56 WHERE score = 77 - 68 = 145 |
Who was David Adams partner on the match played on Clay Surface with a Score in the final of 6–3, 6–7 (5–7) , 7–6 (7–5)? | SELECT partner FROM table_name_53 WHERE surface = "clay" AND score_in_the_final = "6–3, 6–7 (5–7) , 7–6 (7–5)" |
How many silver medals for the nation with fewer than 1 golds and total less than 1? | SELECT COUNT(silver) FROM table_name_57 WHERE gold < 1 AND total < 1 |
What is the description of the airline code 19049? | SELECT Description FROM `Air Carriers` WHERE Code = 19049 |
What is the total number of people who could stay in the modern rooms in this inn? | SELECT SUM(maxOccupancy) FROM Rooms WHERE decor = 'modern' |
How many main stream browsers whose market share is at least 5 exist? | SELECT COUNT(*) FROM browser WHERE market_share >= 5 |
How many entrepreneurs correspond to each investor? | SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor |
What is the name of building with ID 3? | SELECT name FROM buildings where id = "3" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.