sentence
stringlengths
3
347
sql
stringlengths
18
804
In what year, prior to 2009, was the Mercury Prize awarded?
SELECT result FROM table_name_50 WHERE year < 2009 AND award = "mercury prize"
What is the number of points for the vehicle with a mp4-17d chassis earlier than 2003?
SELECT SUM(points) FROM table_name_83 WHERE chassis = "mp4-17d" AND year < 2003
How many classes between senior and junior year for world history
SELECT COUNT(senior__4th_year_) FROM table_13967239_2 WHERE junior__3rd_year_ = "World History"
What was the highest rank by average of a couple who had an average of 25.3 and had more than 10 dances?
SELECT MAX(rank_by_average) FROM table_name_27 WHERE average = 25.3 AND number_of_dances > 10
Who was the opponent in the championship in Johannesburg, South Africa?
SELECT opponent_in_the_final FROM table_name_63 WHERE championship = "johannesburg, south africa"
How many total companies are there?
SELECT count ( * ) FROM operate_company
What is the date the episode directed by rob bailey aired?
SELECT original_air_date FROM table_26914076_3 WHERE directed_by = "Rob Bailey"
Result of w 16-10* o.t. had what attendance?
SELECT attendance FROM table_name_27 WHERE result = "w 16-10* o.t."
What surface was played on when Piet Norval was a partner?
SELECT surface FROM table_name_24 WHERE partner = "piet norval"
Which country has the lowest inflation rate?
SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Inflation IS NOT NULL ORDER BY T2.Inflation ASC LIMIT 1
What categories were Cleavant Derrick nominated for?
SELECT Category FROM musical WHERE Nominee = "Cleavant Derricks" AND Result = "Nominated"
Which documents have more than 1 draft copies? List document id and number of draft copies.
SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1
What was the final score of the game played on July 10?
SELECT final_score FROM table_21796261_4 WHERE date = "July 10"
Who set the record in the 500 metres event?
SELECT name FROM table_name_14 WHERE event = "500 metres"
What are names of stations that have average bike availability above 10 and are not located in San Jose city?
SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available) > 10 EXCEPT SELECT name FROM station WHERE city = "San Jose"
Which players won awards in both 1960 and 1961? Return their first names and last names.
SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first , T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961
Which ingredient appeared the least in recipes?
SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) ASC LIMIT 1
What was the location of the bout that lasted 5:00 and led to a 6-2-1 record?
SELECT location FROM table_name_17 WHERE time = "5:00" AND record = "6-2-1"
What are the names of tracks that belong to the genre Rock and are media type MPEG audio file?
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file"
Who was the Player when College/Junior/Club Team (League) was regina pats (whl)?
SELECT player FROM table_name_24 WHERE college_junior_club_team__league_ = "regina pats (whl)"
Among professors with the highest teachability, how many of their students have high salary?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.salary = 'high' ORDER BY T2.teachingability DESC LIMIT 1
What is the average Pct value when state champions is less than 1, MRC Championships is 10, and co-champions are greater than 4?
SELECT AVG(pct) FROM table_name_51 WHERE state_champions < 1 AND mrc_championships = 10 AND co_champions > 4
Name the game site with result of w 20-14
SELECT game_site FROM table_name_88 WHERE result = "w 20-14"
List the section_name in reversed lexicographical order.
SELECT section_name FROM Sections ORDER BY section_name DESC
In which counties are there A&W Root Beer Restaurants?
SELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'a & w root beer'
What are the ids of the students who registered for course 301 most recently?
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1
What activities do Michael Goodrich and Gerald Masson participate in?
SELECT actid FROM Faculty_Participates_in as T1 join Faculty as T2 on T1.Facid = T2.Facid where T2.Lname = "Goodrich" and T2.Fname = "Michael" UNION SELECT actid FROM Faculty_Participates_in as T1 join Faculty as T2 on T1.Facid = T2.Facid where T2.Lname = "Masson" and T2.Fname = "Gerald"
Please list the ID of the movie that has been mostly rated by female users.
SELECT T1.movieid FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T2.u_gender = 'F' GROUP BY T1.movieid ORDER BY COUNT(T2.userid) DESC LIMIT 1
What are the ids of the students who either registered or attended a course?
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
Show the names of all the activities Mark Giuliano participates in.
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
What Public Institution is in Black River Falls?
SELECT institution FROM table_name_80 WHERE affiliation = "public" AND location = "black river falls"
Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?
SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk'
Which Tie # that has an Attendance of 14 november 1998, and an Away team of hayes?
SELECT tie_no FROM table_name_62 WHERE attendance = "14 november 1998" AND away_team = "hayes"
What is the total number of clubs that have less than 10 medals in total?
SELECT count(*) FROM club_rank WHERE Total < 10
What is the average draw number of an entrant with a time of 22:29?
SELECT AVG(draw) FROM table_name_29 WHERE time = "22:29"
How many matches were played in each year?
SELECT count(*) , YEAR FROM matches GROUP BY YEAR
What year was finish Toulouse, and stage was larger than 12?
SELECT SUM(year) FROM table_name_90 WHERE finish = "toulouse" AND stage > 12
What was the Timberwolves' record on April 3?
SELECT record FROM table_17058226_10 WHERE date = "April 3"
What is the iso code of "Kyrgyz Republic"?
SELECT COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Kyrgyz Republic'
how many customers are presented on the table
select count ( * ) from customers
What is the name of episode 165?
SELECT title FROM table_2226817_9 WHERE no_in_series = 165
Name the venue for 19th date
SELECT venue FROM table_17120964_5 WHERE date = "19th"
What were the points in the year when his Wins were 0, his Podiums were 0, and he drove in 4 races?
SELECT points FROM table_name_60 WHERE wins = "0" AND podiums = "0" AND races = "4"
What is the description of the treatment type that costs the least money in total?
SELECT T1.treatment_type_description FROM Treatment_types AS T1 JOIN Treatments AS T2 ON T1.treatment_type_code = T2.treatment_type_code GROUP BY T1.treatment_type_code ORDER BY SUM(cost_of_treatment) LIMIT 1
What is the name of the supplier that provides the part "hot spring dodger dim light" with the lowest supply cost?
SELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light' ORDER BY T1.ps_supplycost LIMIT 1
Give me the name of player with the most points
SELECT name FROM player where Points = ( SELECT MAX ( Points ) FROM player )
Names the Sales Representative with the highest year to date sales.
SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.SalesYTD DESC LIMIT 1
How many episodes were aired between October and November 2008?
SELECT COUNT(episode_id) FROM Episode WHERE air_date LIKE '2008-10%' OR air_date LIKE '2008-11%';
Show the party that has the most people.
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Which name has a Red List larger than 0, and a Species/Authority of balaenoptera acutorostrata lacépède, 1804?
SELECT name FROM table_name_20 WHERE red_list > 0 AND species_authority = "balaenoptera acutorostrata lacépède, 1804"
How many different cities are they from?
SELECT count(DISTINCT city) FROM Person
What place is Fredrik Jacobson from?
SELECT place FROM table_name_87 WHERE player = "fredrik jacobson"
Which reviewer gives the biggest number of the highest rating?
SELECT ReviewerName FROM ProductReview WHERE Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating DESC LIMIT 1 )
Which crytocurrency was traded in the highest value on 2016/1/8?
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2016-01-08' AND T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical WHERE date = '2016-01-08' )
Count the number of different hometowns of these people.
SELECT count(DISTINCT Hometown) FROM people
What are the names of all employees who are not certified to fly Boeing 737-800s?
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
If collingwood was the Home team, what Date did they play?
SELECT date FROM table_name_71 WHERE home_team = "collingwood"
Find the state and country of all cities with post code starting with 4.
SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE "4%"
How many grid numbers were there for the driver Giancarlo Fisichella?
SELECT COUNT(grid) FROM table_name_3 WHERE driver = "giancarlo fisichella"
Among the independent countries, how many of them has a GDP per capita of over 5000?
SELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T2.Country WHERE T2.Independence IS NOT NULL AND T3.GDP > 5000
What is the sum of revenue in Hong Kong with a rank greater than 42, less than $3.46 billion in assets, and greater than $0.17 billion in profits?
SELECT SUM(revenue__bn) AS $_ FROM table_name_98 WHERE assets__bn$_ < 3.46 AND headquarters = "hong kong" AND profit__bn$_ > 0.17 AND rank > 42
Show the different countries and the number of members from each.
SELECT Country, COUNT(*) FROM member GROUP BY Country
How many were penanced when the number with known sentences was 71 (1600–1773)?
SELECT penanced FROM table_name_3 WHERE number_of_autos_da_fé_with_known_sentences = "71 (1600–1773)"
Which country timed at 7:03.91?
SELECT country FROM table_name_55 WHERE time = "7:03.91"
Name the total number of frequency Mhz for when it has ERP W of 1 and call sign of w215bj
SELECT COUNT(frequency_mhz) FROM table_name_22 WHERE erp_w = 1 AND call_sign = "w215bj"
Who was the home team when FK kom were the guests?
SELECT home FROM table_name_84 WHERE guest = "fk kom"
WHAT IS THE ORICON PEAK NUMBER WITH AN ATLANTIC LABEL, SUBHUMAN RACE, LATER THAN 1995?
SELECT COUNT(oricon_peak) FROM table_name_72 WHERE label = "atlantic" AND title = "subhuman race" AND date_of_release > 1995
Please name any three comedic works.
SELECT Title FROM works WHERE GenreType = 'comedy' LIMIT 3
How many master customer ID numbers are there?
SELECT count ( master_customer_id ) FROM Customer_Master_Index
What is the lowest value of Points 2 when the goal average is 1.50?
SELECT MIN(points_2) FROM table_17359181_1 WHERE goal_average_1 = "1.50"
can you show me a list of product description?
SELECT product_description FROM Products_for_Hire
Show the names of people who have been on the negative side of debates at least twice.
SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2
Name results for herb wetanson
SELECT results FROM table_27561503_2 WHERE gt_20_winning_team = "Herb Wetanson"
Name the team for season 2010
SELECT team FROM table_24466191_1 WHERE season = 2010
What are the details of the tourist who had the earliest visit?
SELECT T1.Tourist_Details FROM Visitors AS T1 JOIN Visits AS T2 ON T1.Tourist_ID = T2.Tourist_ID ORDER BY Visit_Date LIMIT 1
What was the record on April 8?
SELECT record FROM table_name_53 WHERE date = "april 8"
Who is the player with a Jersey Number(s) greater than 30?
SELECT player FROM table_name_22 WHERE jersey_number_s_ > 30
WHich province has an IATA of WNZ?
SELECT province FROM table_name_7 WHERE iata = "wnz"
What was the record when TKO (punches and elbows) was the method?
SELECT record FROM table_name_22 WHERE method = "tko (punches and elbows)"
What are the names of cities in ascending alphabetical order?
SELECT Name FROM city ORDER BY Name ASC
What is the average Silver with a Total that is smaller than 1?
SELECT AVG(silver) FROM table_name_97 WHERE total < 1
What is the sum of the number of regular games played by Morgan Clark with the number of road games less than 7?
SELECT SUM(reg_gp) FROM table_name_17 WHERE player = "morgan clark" AND rd__number < 7
Show the name, phone, and payment method code for all customers in descending order of customer number.
SELECT customer_name , customer_phone , payment_method_code FROM customers ORDER BY customer_number DESC
what is the affiliation of the colors maroon and white?
SELECT affiliation FROM table_20887670_1 WHERE colors = "Maroon and White"
What is the total number of fans or followers who received most likes of their comments in the business?
SELECT COUNT(T1.user_fans) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id ORDER BY COUNT(T2.likes) DESC LIMIT 1
What is Score, when Opponent is Atlanta Hawks?
SELECT score FROM table_name_44 WHERE opponent = "atlanta hawks"
What is the id of the shortest trip?
SELECT id FROM trip ORDER BY duration LIMIT 1
Give me the payment Id, the date and the amount for all the payments processed with Visa.
SELECT Payment_ID , Date_Payment_Made , Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa'
What is the average number of people injured by all perpetrators?
SELECT avg(Injured) FROM perpetrator
What is the average room count of the apartments whose booking status code is "Provisional"?
SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
What is the first name of the staff who did not give any lesson?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
Find the names of users who have more than one tweet.
SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1
For a Team 1 of Al-Merrikh, what was the aggregate?
SELECT agg FROM table_name_47 WHERE team_1 = "al-merrikh"
when there were 48 → 32 clubs?
SELECT new_entries_this_round FROM table_name_82 WHERE clubs = "48 → 32"
Which score has an Opponent of @ athletics, and a Record of 76-57?
SELECT score FROM table_name_19 WHERE opponent = "@ athletics" AND record = "76-57"
What is the inventory ID of the films starred by Russell Close with a duration between 110 to 150 minutes?
SELECT T4.inventory_id 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 INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T3.length BETWEEN 110 AND 150 AND T1.first_name = 'Russell' AND T1.last_name = 'Close'
what is the overall number of chosen ideas where the person is scott parker
SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker"
Who was the opponent when the attendance was exactly 16642?
SELECT opponent FROM table_20745685_1 WHERE attendance = 16642
How many points in 87/88 for racing de córdoba?
SELECT 1987 AS _88 FROM table_14460085_3 WHERE team = "Racing de Córdoba"
What is the total season number for episodes later than episode 30?
SELECT SUM(season) FROM table_name_67 WHERE episodes > 30