sentence
stringlengths
3
347
sql
stringlengths
18
804
Show all cities and corresponding number of students.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
What name is popular for actors? | did you mean the most popular? | yes
SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count ( * ) DESC LIMIT 1
Show the school id for the project 'Virtual Aquarium Needs Help!'.
SELECT T2.schoolid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Virtual Aquarium Needs Help!'
What is the venue of the race where Lineth Chepkurui placed 4th?
SELECT venue FROM table_name_12 WHERE position = "4th"
What are the statement ids, statement details, and account details, for all accounts?
SELECT T1.statement_id , T2.statement_details , T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
What is the Country of the Player with a Score of 69-71-66=206?
SELECT country FROM table_name_99 WHERE score = 69 - 71 - 66 = 206
What is the infant mortality rate for Ethiopia?
SELECT T2.Infant_Mortality FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Ethiopia'
What is the highest top-10 a tournament with 16 cuts and less than 13 top-25 has?
SELECT MAX(top_10) FROM table_name_81 WHERE cuts_made = 16 AND top_25 < 13
What bombing happened in Brighton, UK?
SELECT event FROM table_name_98 WHERE location = "brighton, uk"
What is the Competition on July 7?
SELECT competition FROM table_name_68 WHERE date = "july 7"
What is the total number of top-25 in the Masters Tournament, which has 0 top-10 and more than 0 top-5?
SELECT COUNT(top_25) FROM table_name_16 WHERE top_10 = 0 AND tournament = "masters tournament" AND top_5 > 0
What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
SELECT T2.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus'
What are the schools that were either founded before 1850 or are public?
SELECT school FROM university WHERE founded > 1850 OR affiliation = 'Public'
What is the total amount of money spent by Lucas Mancini?
SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini";
Find the first names of all customers that live in Brazil and have an invoice.
SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil"
WHAT IS THE POINTS WITH 55 TRIES?
SELECT points FROM table_name_89 WHERE tries_for = "55"
What is the venue with more than 3 against, and South Africa is the opposing team?
SELECT venue FROM table_name_55 WHERE against > 3 AND opposing_teams = "south africa"
How many shipments does each driver deliver per month on average?
SELECT CAST(COUNT(*) AS REAL) / (12 * COUNT(T2.driver_id)) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id
Show the names of phones and the districts of markets they are on.
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID
What are the distinct ids of customers who made an order after any order that was Cancelled?
SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date > (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code = "Cancelled")
What is the Revenues during Tenure 1854-1855?
SELECT revenues FROM table_name_43 WHERE tenure = "1854-1855"
What are the names and opening years of the three churches that opened most recently?
SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3
Name the incumbent for lost renomination republican hold
SELECT incumbent FROM table_19753079_4 WHERE result = "Lost renomination Republican hold"
What is the title rank of the actor who played the character of arthur hastings during series 1-8, 13?
SELECT title_rank FROM table_name_24 WHERE series = "1-8, 13" AND character = "arthur hastings"
Name the least season # for the first time
SELECT MIN(season__number) FROM table_25363904_2 WHERE title_english = "The first time"
Which coach has the most 'won' than 'lost' in year '1988'?
SELECT coachID FROM coaches WHERE year = 1988 ORDER BY won - lost DESC LIMIT 1
List the names of all players from Avangard Omsk that have played for playoffs in season 2000-2001.
SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.TEAM = 'Avangard Omsk' AND T1.GAMETYPE = 'Playoffs'
What is the production code for episode 26 in the series?
SELECT production_code FROM table_1876825_3 WHERE no_in_series = 26
What was the score of the game with the Broadview Hawks as the home team?
SELECT score FROM table_name_97 WHERE home = "broadview hawks"
What is the lowest price that a publisher earns?
SELECT Price FROM publication order by Price limit 1
Find all the papers published by the institution "Google".
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
What is the percentage of male Twitter users from Florida?
SELECT SUM(CASE WHEN T3.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS percentage FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.State = 'Florida'
What assists has points of 10?
SELECT assists FROM table_name_11 WHERE points = "10"
What is the Undecided on 2009-05-24?
SELECT undecided FROM table_name_66 WHERE date = "2009-05-24"
What is Against, when Opposing Teams is "Australia", and when Date is "27/07/1991"?
SELECT against FROM table_name_12 WHERE opposing_teams = "australia" AND date = "27/07/1991"
List at least 5 active business ID that are good for groups and dancing.
SELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T2.attribute_value LIKE 'TRUE' AND T1.attribute_name LIKE 'Good for Dancing' AND T1.attribute_name LIKE 'Good for Groups' LIMIT 5
What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?
SELECT T1.Runtime 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 T3.Name = 'Jackie Chan' AND T1.Rating > 7
What date was the opponents the Oakland Raiders?
SELECT date FROM table_name_88 WHERE opponent = "oakland raiders"
Show all cities along with the number of drama workshop groups in each city.
SELECT T1.City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town
Find the average number of staff working for the museums that were open before 2009.
SELECT AVG(num_of_staff) FROM museum WHERE open_year < 2009
What are the first names and last names of students with address in Wisconsin state?
SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin"
What is the average grid for Marco Andretti with a finishing position higher than 19?
SELECT AVG(grid) FROM table_name_85 WHERE driver = "marco andretti" AND fin_pos > 19
What is the Story Title that has Albers as the Letterer?
SELECT story_title FROM table_name_60 WHERE letterer_s = "albers"
Which Segment C that has an Episode lower than 230, and a Segment A consisting of wax figures?
SELECT segment_c FROM table_name_79 WHERE episode < 230 AND segment_a = "wax figures"
What is the name of the customer that made the order with the largest quantity?
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 WHERE t3.order_quantity = ( SELECT max(order_quantity) FROM order_items)
What is the name of the university with the most international students in 2011?
SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.pct_international_students DESC LIMIT 1
What is the maximum founded year of the Worcester Tornadoes?
SELECT MAX(founded) FROM table_24334261_1 WHERE team = "Worcester Tornadoes"
Name the competition for score of 3-0
SELECT competition FROM table_name_42 WHERE score = "3-0"
Show the average salary of all departments. | Would you like to the know the average salary grouped over each department name? | Yes show average salary grouped over each department name.
SELECT dept_name, avg ( salary ) FROM instructor GROUP BY dept_name
In what Year were there 48 of 120 Seats and a % votes larger than 34.18?
SELECT SUM(year) FROM table_name_94 WHERE seats = "48 of 120" AND _percentage_votes > 34.18
How many times did Richard Durbin become a legislator in district 20?
SELECT SUM(CASE WHEN T2.district = 20 THEN 1 ELSE 0 END) AS count FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Richard' AND T1.last_name = 'Durbin'
What are the average ages of losers and winners across matches?
SELECT avg(loser_age) , avg(winner_age) FROM matches
who won in the race in the section georgia 5
SELECT incumbent FROM table_1342393_10 WHERE district = "Georgia 5"
Which long range AM station has the lowest frequency and includes a webcast of listen live, was licensed in the city of Monterrey, and uses the Callsign of xet?
SELECT MIN(frequency) FROM table_name_2 WHERE webcast = "listen live" AND city_of_license = "monterrey" AND callsign = "xet"
Please list the names of all the ranking criteria of Harvard University in 2011.
SELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Harvard University' AND T2.year = 2011
what is the airline for source airport?
select distinct airline from routes where src_apid = ( SELECT T1.apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count ( * ) DESC LIMIT 1 )
What was the original title of 3.19?
SELECT original_title FROM table_20124413_3 WHERE production_code = "3.19"
How young is he?
SELECT age FROM captain ORDER BY age LIMIT 1
Who was the opposing team in the game with a score of 21-17?
SELECT opp_team FROM table_name_49 WHERE score = "21-17"
Which race was at Hockenheim circuit?
SELECT race_name FROM table_name_74 WHERE circuit = "hockenheim"
How many districts does riley joseph wilson?
SELECT COUNT(district) FROM table_1342315_17 WHERE incumbent = "Riley Joseph Wilson"
Name the production for alpina model being b10 4,6
SELECT production FROM table_2477085_1 WHERE alpina_model = "B10 4,6"
How many values for decile occur in Mount Roskill with Monte Cecilia school with a roll greater than 170?
SELECT COUNT(decile) FROM table_name_33 WHERE area = "mount roskill" AND name = "monte cecilia school" AND roll > 170
What is the class of the locomotive with a wheel arrangement of 4-6-0 and a quantity made of 14?
SELECT class FROM table_name_47 WHERE wheel_arrangement = "4-6-0" AND quantity_made = "14"
What is the last transcript release date?
SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
What nationality is the #63 pick?
SELECT nationality FROM table_name_72 WHERE pick__number = "63"
What team has a vehicle with an Offenhauser engine and a McLaren chassis?
SELECT team FROM table_1405704_1 WHERE chassis = "McLaren" AND engine = "Offenhauser"
Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63?
SELECT MIN(height__m_) FROM table_name_97 WHERE name = "plessur alps" AND ave__no > 63
What is the average day in December with a Record of 16-3-4 and a Game smaller than 23?
SELECT AVG(december) FROM table_name_84 WHERE record = "16-3-4" AND game < 23
What team was the opponent with a record of 5–0?
SELECT opponent FROM table_name_94 WHERE record = "5–0"
Calculate the percentage of male users among all device users.
SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age
What was the time of the car having a constructor of Renault, which went 40 laps?
SELECT time_retired FROM table_name_96 WHERE constructor = "renault" AND laps = "40"
How many classes exist for each school?
SELECT count(*) , T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T2.dept_code = T3.dept_code GROUP BY T3.school_code
Who is the losing pitcher when the winning pitcher is roy oswalt?
SELECT losing_pitcher FROM table_12125069_2 WHERE winning_pitcher = "Roy Oswalt"
List the problem id and log id which are assigned to the staff named Rylan Homenick.
SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
What are all the players who played in match season, sorted by college in ascending alphabetical order?
SELECT player FROM match_season ORDER BY College ASC
What is the upstream for the internet 100 plans?
SELECT upstream FROM table_name_42 WHERE internet_plan = "internet 100"
Return the average earnings across all poker players.
SELECT avg(Earnings) FROM poker_player
On what date did a save of ||54,918||50–36 occur?
SELECT date FROM table_name_73 WHERE save = "||54,918||50–36"
How many times was the result was re-elected and the party was anti-masonic in the district Pennsylvania 24?
SELECT COUNT(first_elected) FROM table_2668199_2 WHERE result = "Re-elected" AND party = "Anti-Masonic" AND district = "Pennsylvania 24"
Which runs had james bryant graeme welch as Batsmen?
SELECT runs FROM table_name_28 WHERE batsmen = "james bryant graeme welch"
Name the lowest Draw which has a Performer of kaliopi and a Televotes larger than 3834?
SELECT MIN(draw) FROM table_name_18 WHERE performer = "kaliopi" AND televotes > 3834
List the name of ships in ascending order of tonnage.
SELECT Name FROM ship ORDER BY Tonnage ASC
Which Role has a Theatre of globe, and a Music of jerome kern?
SELECT role FROM table_name_61 WHERE theatre = "globe" AND music = "jerome kern"
What is the Genre for Malina (ger.-aus.-fr.), an Original Title?
SELECT genre FROM table_name_12 WHERE original_title = "malina (ger.-aus.-fr.)"
How many Wins in the Year with more than 16 Races?
SELECT wins FROM table_name_7 WHERE races > 16
what is the game for 23 april when batting 2nd is england 5/113 (19)?
SELECT MIN(game) FROM table_name_62 WHERE date = "23 april" AND batting_2nd = "england 5/113 (19)"
Who did they lose to 3-17?
SELECT opponent FROM table_name_67 WHERE score = "3-17"
What is Andrea Suarez Lazaro's height?
SELECT height FROM table_name_25 WHERE contestant = "andrea suarez lazaro"
Hi can you show me all the headquarters of a company in backing industry? | Do you mean banking, not backing? | Sorry, yes banking!
SELECT headquarters FROM company WHERE main_industry = 'Banking'
What Ecclesiastical Province has a type diocese and a latin name alexiensis?
SELECT ecclesiastical_province FROM table_name_21 WHERE type = "diocese" AND latin_name = "alexiensis"
What is the air date the had atlasphere for event 1 before episode 11?
SELECT air_date FROM table_name_89 WHERE episode_number < 11 AND event_1 = "atlasphere"
How many games have 61-16 as the record?
SELECT COUNT(game) FROM table_name_14 WHERE record = "61-16"
Which player has a position of FW?
SELECT player FROM table_name_25 WHERE pos = "fw"
Which Year has a Game of resident evil 4?
SELECT AVG(year) FROM table_name_35 WHERE game = "resident evil 4"
Give me the names of members whose address is in Harford or Waterbury.
SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'
What company focuses on Engine Overhaul for their principal activity?
SELECT company FROM table_name_7 WHERE principal_activities = "engine overhaul"
What country did Chris Witty represent?
SELECT nation FROM table_name_50 WHERE name = "chris witty"
Find the patient order by the date they underwent treatment. Recent first.
SELECT patient FROM undergoes ORDER BY dateundergoes DESC
How many business ids have opening hours from 8AM to 6PM?
SELECT DISTINCT business_id FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'