sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What is the least amount of Miss Airs any country has had? | SELECT MIN(miss_air) FROM table_30008638_1 |
Which Away team uses Princes Park as it's venue? | SELECT away_team FROM table_name_77 WHERE venue = "princes park" |
How many customers are there in the customer type with the most customers? | SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1 |
How many Drawn have an Against smaller than 5, and a Played smaller than 3? | SELECT COUNT(drawn) FROM table_name_38 WHERE against < 5 AND played < 3 |
Show the first name, last name, and phone number for all female faculty members. | SELECT Fname , Lname , phone FROM Faculty WHERE Sex = 'F' |
Return the full names and salaries for employees with first names that end with the letter m. | SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m' |
How many students have taken tests? | SELECT count ( distinct student_id ) from student_course_enrolment |
What is the total price of Ikura ordered in order no. 10273? | SELECT T2.UnitPrice * T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10273 AND T1.ProductName = 'Ikura' |
What are the first and last names of the performer who was in the back stage position for the song "Badlands"? | SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" |
What products are no longer sold by Northwind? | SELECT ProductName FROM Products WHERE Discontinued = 1 |
Which manufacturer has a Time/Retired of +15.665? | SELECT manufacturer FROM table_name_35 WHERE time_retired = "+15.665" |
Record of 3–1 had what Res? | SELECT res FROM table_name_7 WHERE record = "3–1" |
What is the total number of points when draw is 4? | SELECT COUNT(points) FROM table_name_71 WHERE draw = 4 |
Which AFC cup does Masahiro Fukasawa have? | SELECT afc_cup FROM table_name_17 WHERE name = "masahiro fukasawa" |
How many captains are in each rank? | SELECT COUNT(*), rank FROM captain GROUP BY rank |
What are the first and last names for all customers? | SELECT first_name , last_name FROM Customers; |
What are the last names of faculty in building Barton, sorted by last name? | SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname |
How many students are in that classroom? | select count ( * ) from list group by classroom order by count ( * ) desc limit 1 |
Show the transportation method most people choose to get to tourist attractions. | SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1 |
Give the name of the film for inventory No.3479. | SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.inventory_id = 3479 |
What player has a score less than 66, and a Place of t2, in the United States? | SELECT player FROM table_name_72 WHERE score < 66 AND place = "t2" AND country = "united states" |
Find the name of each user and number of tweets tweeted by each of them. | SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid |
Harry l Stephen rides a Norton machine on what date? | SELECT date FROM table_name_56 WHERE machine = "norton" AND rider = "harry l stephen" |
What's the name of spain rank greater than 2? | SELECT name FROM table_name_59 WHERE rank > 2 AND nationality = "spain" |
What is the name of the product with the almost highest review score? | SELECT T1.Name FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating DESC LIMIT 1 ) |
Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets? | SELECT CAST(SUM(CASE WHEN T3.Win_Type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Win_Type) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE T1.Team_Name = 'Delhi Daredevils' |
For the on going assembly item Component ID No. 494, what's the Unit measure for it? | SELECT T2.Name FROM BillOfMaterials AS T1 INNER JOIN UnitMeasure AS T2 ON T1.UnitMeasureCode = T2.UnitMeasureCode WHERE T1.ComponentID = 494 AND T1.EndDate IS NULL GROUP BY T2.name |
What is the sum of draws for all byes larger than 0? | SELECT SUM(draws) FROM table_name_94 WHERE byes > 0 |
Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language? | SELECT CAST(SUM(IIF(T2.Language = 'English', 1, 0)) AS REAL) * 100 / COUNT(T1.Code) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GNP > 1500 |
What are the full names, departments, cities, and state provinces for each employee? | SELECT T1.first_name , T1.last_name , T2.department_name , T3.city , T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id |
Find the distinct last names of the students who have class president votes. | SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE |
what is the score where the record is 1-1 | SELECT ramtha FROM table_26173058_2 WHERE ahli = "1-1" |
WHAT IS THE Indonesia CAPITAL | SELECT capital from country where country_name = "Indonesia" |
also include the college id in this table | SELECT T1.Name ,t1.Member_ID,T1.College_ID FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC |
What competition was held 1 March 1909? | SELECT competition FROM table_name_31 WHERE date = "1 march 1909" |
How many patients on average receive combined chemotherapy and radiation therapy procedures each year? | SELECT CAST(COUNT(PATIENT) AS REAL) / COUNT(DISTINCT strftime('%Y', DATE)) FROM procedures WHERE DESCRIPTION = 'Combined chemotherapy and radiation therapy (procedure)' |
For each position, what is the maximum number of hours for students who spent more than 1000 hours training? | SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos |
How many tweets are seen by more than 1000 unique users? | SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000 |
If the stage is 3, what is the points classification name? | SELECT points_classification FROM table_22941863_19 WHERE stage = 3 |
What are all of the routes for each source airport? | do you mean the number of all of the routes? | Yes please. | SELECT count ( * ) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name |
What is the Raw bandwidth (Mbit/s) for the SAS 300? | SELECT raw_bandwidth__mbit_s_ FROM table_name_8 WHERE name = "sas 300" |
What is the name of the client who has the largest quantity of rented material without returning it? | SELECT T.first_name FROM ( SELECT T2.first_name, COUNT(T1.rental_date) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name ) AS T ORDER BY T.num DESC LIMIT 1 |
If the scoring average is 72.46, what is the best finish? | SELECT best_finish FROM table_22838521_3 WHERE scoring_average = "72.46" |
What was the last episode featuring Rob Estes? | SELECT final_episode FROM table_name_93 WHERE actor = "rob estes" |
What is the minimum number of starts for the players having a best finish of T18? | SELECT MIN(starts) FROM table_24747844_2 WHERE best_finish = "T18" |
List down the first name of customers who placed order for product id 1. | SELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T2.ProductID = 1 |
What is the minimum elevation? | SELECT min ( elevation ) FROM airports |
What is the total year with a Position of 12th? | SELECT SUM(year) FROM table_name_89 WHERE position = "12th" |
Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. | SELECT Country FROM mountain WHERE Height > 5600 INTERSECT SELECT Country FROM mountain WHERE Height < 5200 |
What is the low grid that has brm and over 54 laps? | SELECT MIN(grid) FROM table_name_20 WHERE constructor = "brm" AND laps > 54 |
Which team was team 1 in the match where team 2 was olympique lyonnais (d2)? | SELECT team_1 FROM table_name_20 WHERE team_2 = "olympique lyonnais (d2)" |
how many characteristics does the product name 'sesame' have? | SELECT count ( * ) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame" |
Among the countries with over 3 organizations, how many of them have an inflation rate of over 5%? | SELECT COUNT(T2.Country) FROM economy AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T2.Country IN ( SELECT Country FROM organization GROUP BY Country HAVING COUNT(Country) > 3 ) AND T1.Inflation > 5 |
What is the head of government for Don Stephen Senanayake? | SELECT head_s__of_government FROM table_name_77 WHERE name = "don stephen senanayake" |
Among the flights departing from John F. Kennedy International, how many of them arrived earlier than scheduled? | SELECT SUM(CASE WHEN T2.ARR_DELAY < 0 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'New York, NY: John F. Kennedy International' |
Is wireless combo keyboard and mouse support part of the hub base class? | SELECT hub_base_class FROM table_1153898_1 WHERE comparisons = "Wireless Combo keyboard and mouse support" |
What is the ICAO for Seewoosagur Ramgoolam airport? | SELECT icao FROM table_name_72 WHERE airport = "seewoosagur ramgoolam airport" |
What is the % Change at London Heathrow airport? | SELECT _percentage_change FROM table_name_68 WHERE airport = "london heathrow airport" |
How many judges were there when the result is safe with a vote percentage of 10.7%? | SELECT MIN(judges) FROM table_26375386_20 WHERE result = "Safe" AND vote_percentage = "10.7%" |
Yes please | SELECT T1.clubname from club as T1 join member_of_club as T2 on T1.clubid = T2.clubid group by T2.clubid order by count ( * ) desc limit 1 |
What nationality has steve kerr as the player? | SELECT nationality FROM table_name_95 WHERE player = "steve kerr" |
Select the project names which are not assigned yet. | SELECT Name FROM Projects WHERE Code NOT IN (SELECT Project FROM AssignedTo) |
What is average life expectancy in the countries where English is not the official language? | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T") |
what is the year where the qualifying score was 15.150? | SELECT year FROM table_13114949_3 WHERE qualifying_score = "15.150" |
Which nation and region does the Customer#000000008 come from? | SELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_name = 'Customer#000000008' |
what is the highest booked amount | SELECT MAX ( booked_amount ) FROM Products_Booked |
what was the amount claimed? | On this day? | yes | SELECT Amount_Claimed FROM Claims where Date_Claim_Settled = "2018-03-09" |
Which classrooms are used by grade 5? | SELECT DISTINCT classroom FROM list WHERE grade = 5 |
What team was he on when he finished in 11th position? | SELECT team FROM table_24491017_1 WHERE position = "11th" |
which type of university is Ave Maria University ? | SELECT Type FROM institution WHERE Institution = 'Ave Maria University' |
What are the lowest laps of Graham Hill? | SELECT MIN(laps) FROM table_name_68 WHERE driver = "graham hill" |
What is the highest value for col(m) at North Island? | SELECT MAX(col__m_) FROM table_18946749_4 WHERE island = "North island" |
What is the average number of employees of the departments whose rank is between 10 and 15? | SELECT avg(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15 |
How many unemployed students filed for bankruptcy? | SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name |
Return the phone numbers of employees with salaries between 8000 and 12000. | SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 |
WHat is the number of Population has a Density of 50.09 and a Rank larger than 30? | SELECT SUM(population) FROM table_name_70 WHERE density = 50.09 AND rank > 30 |
What are the departure dates for all flights from Los Angeles to Honolulu? | SELECT departure_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" |
What is the Director of Gulf Stream Under the Iceberg? | SELECT director FROM table_name_55 WHERE film_title_used_in_nomination = "gulf stream under the iceberg" |
Which week 2 had a week 3 of Cidney Carson? | SELECT week_2 FROM table_name_74 WHERE week_3 = "cidney carson" |
Who's the Writer with an Original Airdate of september 4, 2005 (hbo)? | SELECT writer FROM table_name_91 WHERE original_airdate = "september 4, 2005 (hbo)" |
What is the tie when team 2 is koper? | SELECT MIN(tie_no) FROM table_19294812_2 WHERE team_2 = "Koper" |
which advisors have at least two students? | SELECT advisor FROM Student GROUP BY advisor HAVING count ( * ) > = 2 |
Which territory has the most customers as of 9/12/2014? | SELECT TerritoryID FROM Customer WHERE ModifiedDate < '2014-12-09' GROUP BY TerritoryID ORDER BY COUNT(TerritoryID) DESC LIMIT 1 |
What season was herschelle gibbs andrew symonds venugopal rao batsmen? | SELECT season FROM table_22962745_35 WHERE batsmen = "Herschelle Gibbs Andrew Symonds Venugopal Rao" |
Hi, when was the University of Delaware founded? | SELECT founded FROM university WHERE school = 'University of Delaware' |
What was the winning party when the incumbent was richard s. whaley? | SELECT party FROM table_1346137_4 WHERE incumbent = "Richard S. Whaley" |
Provide the names of competitors who received a gold medal. | SELECT DISTINCT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Gold' |
Which route has 21 stations? | SELECT route FROM table_name_31 WHERE stations = 21 |
What position did the kid from loganville, georgia play | SELECT position FROM table_11677691_8 WHERE hometown = "Loganville, Georgia" |
Count the number of stores. | SELECT count(*) FROM store |
Which Comments has a Model of 18sq? | SELECT comments FROM table_name_30 WHERE model = "18sq" |
What are all the songs in albums under label "Universal Music Group"? | SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = "Universal Music Group" |
List the name, nationality and id of all male architects ordered by their names lexicographically. | SELECT name , nationality , id FROM architect WHERE gender = 'male' ORDER BY name |
How many likes did short comment left by users who joined in 2010 get? | SELECT SUM(T2.likes) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2010 |
Who was the home team when Boston is the road team in game 4? | SELECT home_team FROM table_name_89 WHERE road_team = "boston" AND game = "game 4" |
Yes what is mark rank? | SELECT T2.rank FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id WHERE T1.name = 'Mark' |
Which tournament had a result in 2010 and 2012 of a? | SELECT tournament FROM table_name_49 WHERE 2012 = "a" AND 2010 = "a" |
Amazing, can you display only the entry with a fault log id of 1 as well as the description and record time for that entry with a fault log id of 1? | SELECT count ( * ) , *, T1.fault_description , T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id where t1.fault_log_entry_id = 1 GROUP BY T1.fault_log_entry_id ORDER BY count ( * ) DESC LIMIT 1 |
How many crews were born in the USA? | SELECT COUNT(name) FROM Person WHERE birth_country = 'USA'; |
What is the score of the player from fiji? | SELECT score FROM table_name_6 WHERE country = "fiji" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.