sentence
stringlengths
3
347
sql
stringlengths
18
804
What time/retired for a grid less than 19, under 21 laps, and made by aprilia?
SELECT time_retired FROM table_name_38 WHERE grid < 19 AND manufacturer = "aprilia" AND laps < 21
What is the time/retired of the team with a grid of 14?
SELECT time_retired FROM table_name_62 WHERE grid = 14
what is the highest annual interchanges ?
SELECT Annual_interchanges FROM station ORDER BY Annual_interchanges DESC LIMIT 1
What is shown for november 3 when august 21-22 is august 22, 1998?
SELECT november_3 FROM table_25355501_2 WHERE august_21_22 = "August 22, 1998"
How many employees do we have?
SELECT COUNT(*) FROM Employee
What is the south season of the scorpio sign, which has cold & wet qualities?
SELECT season AS :_south FROM table_name_88 WHERE qualities = "cold & wet" AND sign = "scorpio"
List all deceased goalies by last name. List the season where he had the most time played.
SELECT T1.playerID, T2.year, Min FROM Master AS T1 INNER JOIN Goalies AS T2 ON T2.playerID = T1.playerID WHERE T1.deathYear IS NOT NULL ORDER BY T2.Min DESC LIMIT 1
Please list any five cities that have an unidentified county and region.
SELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5
Which Champs is the average one that has a Draw larger than 2, and Games smaller than 60?
SELECT AVG(champs) FROM table_name_16 WHERE draw > 2 AND games < 60
How many mountains are there in the country with the most land area?
SELECT COUNT(Mountain) FROM geo_mountain WHERE Country = ( SELECT Code FROM country ORDER BY Area DESC LIMIT 1 )
What are the years of opening for tracks with seating between 4000 and 5000?
SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
What is the average attendance when the Forest Green Rovers is the away team?
SELECT AVG(attendance) FROM table_name_82 WHERE away_team = "forest green rovers"
What are the gender and occupation of players?
SELECT Gender , Occupation FROM player
What is Points, when Club is Maesteg RFC?
SELECT points FROM table_name_14 WHERE club = "maesteg rfc"
What was the airdate of 21 series number?
SELECT original_air_date FROM table_11630008_3 WHERE series_no = 21
Show name, opening year, and capacity for each cinema.
SELECT name, openning_year, capacity FROM cinema
Can you list their names in this chat box?
SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor"
After 1986, how many Wins did Lucky Strike Yamaha Team with less than 6 Points have?
SELECT MIN(wins) FROM table_name_51 WHERE year > 1986 AND team = "lucky strike yamaha" AND points < 6
What's the report for the race name, XIII Grand Prix de l'Albigeois?
SELECT report FROM table_1140117_5 WHERE race_name = "XIII Grand Prix de l'Albigeois"
What is the average of absence for an employed students?
SELECT AVG(month) FROM longest_absense_from_school WHERE name NOT IN ( SELECT name FROM unemployed )
What kind of industry does royal dutch shell belongs to?
SELECT Industry FROM company where name = "Royal Dutch Shell"
What are the dates that had the top 5 cloud cover rates? Also tell me the cloud cover rate.
SELECT date, cloud_cover FROM weather ORDER BY cloud_cover DESC LIMIT 5
When bas van erp was the athlete what was the quarterfinals?
SELECT quarterfinals FROM table_18602462_21 WHERE athlete = "Bas van Erp"
What is the lowest Total, when Silver is greater than 7, and when Gold is greater than 73?
SELECT MIN(total) FROM table_name_99 WHERE silver > 7 AND gold > 73
Tally the match IDs in which V Kohli is the "Man of the Match".
SELECT T1.Match_Id FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id WHERE T2.Player_Name = 'V Kohli'
How far into the postseason did the Rams go when their record was 29-7?
SELECT postseason FROM table_14609295_4 WHERE overall = "29-7"
Which Term end has a Political Party of balli kombëtar, and a Born-Died of 1905–1972?
SELECT term_end FROM table_name_23 WHERE political_party = "balli kombëtar" AND born_died = "1905–1972"
Which Neon has Atomic property of average valence electron energy (avee)?
SELECT neon FROM table_name_91 WHERE atomic_property = "average valence electron energy (avee)"
Show all locations with only 1 station.
SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1
What season had more than 12 contestants in which greydis gil won?
SELECT season FROM table_name_98 WHERE number_of_contestants > 12 AND winner = "greydis gil"
What is the total number of Wickets with a 26.13 average?
SELECT COUNT(wickets) FROM table_name_8 WHERE average = 26.13
Tell me the pole winner of may 12
SELECT pole_winner FROM table_name_91 WHERE date = "may 12"
Name the leaast points for standing 5th
SELECT MIN(points) FROM table_26882866_1 WHERE standing = "5th"
What is the title of the original airing on e4 May 2, 2010?
SELECT title FROM table_22170495_6 WHERE original_airing_on_e4 = "May 2, 2010"
Which player had a To par of 13?
SELECT player FROM table_name_78 WHERE to_par = 13
What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.
SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details ASC;
Which opponent has a record of 3–1?
SELECT opponent FROM table_name_94 WHERE record = "3–1"
What is the name of the team that won the first ever match?
SELECT T1.Team_Name FROM team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Season_Id = 1 ORDER BY T2.Match_Date LIMIT 1
What is the lowest salary in departments with average salary greater than the overall average.
SELECT min(salary) , dept_name FROM instructor GROUP BY dept_name HAVING avg(salary) > (SELECT avg(salary) FROM instructor)
What is the bronze for Kyrgyzstan nation with a silver record of greater than 0?
SELECT AVG(bronze) FROM table_name_8 WHERE nation = "kyrgyzstan" AND silver > 0
What is the die size(mm 2) for model sgx531?
SELECT die_size__mm_2___[1] FROM table_1439045_5 WHERE model = "SGX531"
What are the names of catalog with number 8
SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"
Count the number of high schoolers in grades 9 or 10.
SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10
Show the number of locations.
SELECT count(*) FROM Ref_locations
Show the id, the date of account opened, the account name, and other account detail for all accounts.
SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts
how many incumbent with first elected being 1924
SELECT COUNT(incumbent) FROM table_1342393_17 WHERE first_elected = 1924
Show the date of the transcript which shows the least number of results, also list the id.
SELECT T2.transcript_date , T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id = T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1
How much do the works data saved in English and Arabic differ from one another?
SELECT SUM(CASE WHEN T1.Name = 'English' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID WHERE T1.Name = 'English' OR T1.Name = 'Arabic'
How many rooms are there?
SELECT sum ( room_number ) FROM classroom
What is the average year that the Belanger Motors had an Offenhauser l4 engine?
SELECT AVG(year) FROM table_name_8 WHERE engine = "offenhauser l4" AND entrant = "belanger motors"
How many different services are provided by all stations?
SELECT count(DISTINCT services) FROM station;
What date was the opponent VFL Sindelfingen?
SELECT date FROM table_name_98 WHERE opponent = "vfl sindelfingen"
How many role-playing games are there?
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing'
What is the Birthplace, when the Jersey # is less than 18, when the Height (cm) is higher than 185, and when the Birthdate is March 3, 1980?
SELECT birthplace FROM table_name_24 WHERE jersey__number < 18 AND height__cm_ > 185 AND birthdate = "march 3, 1980"
Name the total number of ranks when total is less than 1
SELECT COUNT(rank) FROM table_name_76 WHERE total < 1
What is the average unit price of rock tracks?
SELECT AVG(T2.UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Rock"
Find the total student enrollment for different affiliation type schools.
SELECT sum(enrollment) , affiliation FROM university GROUP BY affiliation
Which award was given for the role of Elphaba in 2009?
SELECT award FROM table_name_92 WHERE role = "elphaba" AND year = "2009"
List down the trip IDs when bike no. 10 was used by subscribers and the weather's mean temperature is no less than 62 degress Fahrenheit.
SELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.bike_id = 10 AND T2.mean_temperature_f > 62 AND T1.subscription_type = 'Subscriber'
How many apartments are there?
SELECT count ( * ) FROM Apartments
What is the name of the author who wrote the most papers? | Do you mean the fname or lname? | Both please
SELECT t1.lname,t1.fname 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.authID order by count ( * ) desc limit 1
In which regions are there no African food restaurants?
SELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african'
What is the sum for the year with a location of newport, rhode island?
SELECT SUM(year) FROM table_name_57 WHERE location = "newport, rhode island"
What is the free of Apolline Dreyfuss & Lila Meesseman-Bakir, when the total was larger than 90.333?
SELECT MIN(free) FROM table_name_87 WHERE athlete = "apolline dreyfuss & lila meesseman-bakir" AND total > 90.333
How many companies do ship Northwind's orders?
SELECT COUNT(ShipperID) FROM Shippers
Show the names of all technicians in ascending order of quality rank assigned to the machine with ID 2.
SELECT T3.Name, t1.machine_id, quality_rank FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID and t1.machine_id = 2 order by quality_rank
In which segment did the Walt Disney Company earned a bigger revenue in 1998, Studio Entertainment or Disney Media Networks?
SELECT CASE WHEN 'Studio Entertainment[NI 1]' > 'Disney Media Networks' THEN 'Studio Entertainment[NI 1]' ELSE 'Disney Media Networks' END FROM revenue WHERE `Year` = 1998
Name the least matches for runs being 276
SELECT MIN(matches) FROM table_17900317_5 WHERE runs = 276
Which sport did the United States win?
SELECT sport FROM table_name_29 WHERE nation_represented = "united states"
Group by ships by flag, and return number of ships that have each flag.
SELECT count(*) , flag FROM ship GROUP BY flag
What is the alphabetically ordered list of all distinct medications?
SELECT DISTINCT name FROM medication ORDER BY name
What is Venue, when Status is "Test Match", and when Against is "12"?
SELECT venue FROM table_name_16 WHERE status = "test match" AND against = 12
Show publishers with a book published in 1989 and a book in 1990.
SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990
What are the ids and locations of all circuits in France or Belgium?
SELECT circuitid , LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
What is the position for the player becchio?
SELECT position FROM table WHERE player = Becchio
What is the room type for room 101?
SELECT roomtype from room where roomnumber = 101
How many rounds had a race name of anglia tv trophy?
SELECT COUNT(round) FROM table_name_25 WHERE name = "anglia tv trophy"
WHAT IS THE HIGH ASSISTS ON NOVEMBER 24?
SELECT high_assists FROM table_name_21 WHERE date = "november 24"
Show me their customer addresses
SELECT T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING count ( * ) > 2
Tell me the power when the torque is n·m (lb·ft)/*n·m (lb·ft) @1750
SELECT power_rpm FROM table_name_37 WHERE torque__nm__rpm = "n·m (lb·ft)/*n·m (lb·ft) @1750"
What was the film that vadim ilyenko directed?
SELECT film_name FROM table_10236830_1 WHERE director = "Vadim Ilyenko"
What was the destination of the season won by Anwar Syed?
SELECT destination FROM table_20026849_1 WHERE winner = "Anwar Syed"
What Elimination number is listed againt Eliminated by Sonjay Dutt?
SELECT elimination FROM table_name_2 WHERE eliminated_by = "sonjay dutt"
Show the transaction type code that occurs the most frequently.
SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
What is Outcome, when Score is 1-6, 3-6?
SELECT outcome FROM table_name_5 WHERE score = "1-6, 3-6"
What date did Mike Rockenfeller have the fastest lap?
SELECT date FROM table_24732149_2 WHERE fastest_lap = "Mike Rockenfeller"
Among the bike trips started on the days with a fog in 2013, how many of those trips started from the station "2nd at Townsend"?
SELECT COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' AND T1.start_station_name = '2nd at Townsend' AND T2.zip_code = 94107
Find the texts of assessment notes for teachers with last name "Schuster".
SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schuster"
What is the Sub-Parish (Sokn) that was built in 1957 in the location of Stavang?
SELECT sub_parish__sokn_ FROM table_name_30 WHERE year_built = "1957" AND location_of_the_church = "stavang"
Nam the total number for bruce coulter award for 9th game
SELECT COUNT(bruce_coulter_award) FROM table_228149_1 WHERE game = "9th"
The name of the smallest mountain from all countries | Do you mean the name of the lowest mountain? | YES
SELECT name FROM mountain order by height limit 1
What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre.
SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid = 1684910 ) FROM actors WHERE actorid IN ( SELECT actorid FROM movies2actors WHERE movieid = 1684910 )
Where was the fight located that lasted a time of 2:33?
SELECT location FROM table_name_7 WHERE time = "2:33"
In which country does the most populated university in 2014 located ?
SELECT T2.country_id FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2014 ORDER BY T1.num_students DESC LIMIT 1
What is the list of school locations sorted in ascending order of school enrollment?
SELECT LOCATION FROM school ORDER BY Enrollment ASC
What is Pegasus' right ascension with a 7318a NGC?
SELECT right_ascension___j2000__ FROM table_name_67 WHERE constellation = "pegasus" AND ngc_number = "7318a"
Which Pick has a Round larger than 8, a Name of kenny fells, and an Overall larger than 297?
SELECT SUM(pick) FROM table_name_64 WHERE round > 8 AND name = "kenny fells" AND overall > 297
What is the route that has the longest duration? Indicate the city of where the stations are located.
SELECT T1.start_station_name, T1.end_station_name, T2.city FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name )
List out the first name of legislators who are senior Senator.
SELECT T1.first_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state_rank = 'senior' GROUP BY T1.first_name
Give me a list of all the last names of authors sorted in alphabetical order
SELECT lname FROM authors ORDER BY lname