sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Which mountain is the highest in an independent country? | SELECT T4.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN geo_mountain AS T3 ON T3.Country = T2.Country INNER JOIN mountain AS T4 ON T4.Name = T3.Mountain WHERE T2.Independence IS NOT NULL ORDER BY T4.Height DESC LIMIT 1 |
Please list the top three product names with the highest unit price. | SELECT t1.productName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode ORDER BY t2.priceEach DESC LIMIT 3 |
Great - I forgot to ask, can you please show which countries each of the listed perpetrators are associated with? | SELECT T1.Name, T2.Country FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country ! = "China" |
What of those not operated by American Airlines? | SELECT * FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name ! = 'American Airlines' |
Tell me the total number of pick for university of virginia | SELECT COUNT(pick__number) FROM table_name_78 WHERE affiliation = "university of virginia" |
What are the birth years and citizenships of the singers? | SELECT Birth_Year , Citizenship FROM singer |
what is the total number of rounds when method is tko (punches) and time is 0:40? | SELECT COUNT(round) FROM table_name_22 WHERE method = "tko (punches)" AND time = "0:40" |
What is the sales revenue for item number 740? | SELECT ListPrice - StandardCost FROM Product WHERE ProductID = 740 |
Which brand is most common among people in their twenties? | SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1 |
What are the first and last name of the faculty who has the most students? | SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1 |
What is the Record at School of Tom O'Brien's team? | SELECT record_at_school FROM table_28744929_2 WHERE head_coach = "Tom O'Brien" |
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. | SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32; |
What was the score of having a tie of 1? | SELECT score FROM table_name_27 WHERE tie_no = "1" |
List the name of tracks belongs to genre Rock and whose media type is 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" AND T3.name = "MPEG audio file"; |
Please list the positions of the players who were born in Canada and have won the All-Rookie award. | SELECT DISTINCT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'Canada' AND T2.award = 'All-Rookie' |
What driver had under 22 laps and a Time/Retired of ignition? | SELECT driver FROM table_name_93 WHERE laps < 22 AND time_retired = "ignition" |
What were the points on February 10? | SELECT points FROM table_name_15 WHERE date = "february 10" |
What are the grapes, wineries and years for wines with price higher than 100, sorted by year? | SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR |
List the distinct director of all films. | SELECT DISTINCT Director FROM film |
Which game type has most number of games ? | SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count ( * ) DESC LIMIT 1 |
What is the team sites entry that has a public entry of No and a developer entry of Yes? | SELECT team_sites FROM table_name_53 WHERE public = "no" AND developer = "yes" |
When was the 1991 world group I with the opponent of Li Fang? | SELECT date FROM table_name_2 WHERE edition = "1991 world group i" AND opponent = "li fang" |
Which Nominee has a Category of outstanding musical? | SELECT nominee FROM table_name_88 WHERE category = "outstanding musical" |
What is the average age of competitors who participated in 1988 Winter? | SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1988 Winter' |
What is the highest Total when Georgia is the nation with less than 11 rank? | SELECT MAX(total) FROM table_name_46 WHERE nation = "georgia" AND rank < 11 |
What is the height when the player is from Los Angeles? | SELECT height FROM table_24055352_1 WHERE hometown = "Los Angeles" |
What is the total when the score for set 2 is 20–25? | SELECT total FROM table_name_21 WHERE set_2 = "20–25" |
Tell me the high assists for orlando | SELECT high_assists FROM table_name_46 WHERE team = "orlando" |
What are the names of patients who are not taking the medication of Procrastin-X. | SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient = T1.SSN JOIN Medication AS T3 ON T2.Medication = T3.Code WHERE T3.name = 'Procrastin-X' |
What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72? | SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72 |
Film of um sol alaranjado director is what nationality? | SELECT nationality_of_director FROM table_name_65 WHERE film = "um sol alaranjado" |
What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2? | SELECT MIN(lane) FROM table_name_97 WHERE heat > 2 AND time = "1:10.57" |
What is the games average with less than 3.8 in rating and less than 9 yards? | SELECT AVG(games) FROM table_name_70 WHERE rating < 3.8 AND yards < 9 |
What team in France had 15 UCi points? | SELECT team FROM table_name_81 WHERE country = "france" AND uci_points = "15" |
What are all role codes? | SELECT role_code FROM ROLES; |
Name the score on august 1 | SELECT score FROM table_name_26 WHERE date = "august 1" |
Who are the sponsors of the menu whose image full height is more than 10000 mm? | SELECT T2.sponsor FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T1.full_height = 10000 |
What are the names of all the dorms that can accomdate more than 300 students? | SELECT dorm_name FROM dorm WHERE student_capacity > 300 |
What is the reserved for (ST/ST/None) when it was Uklana? | SELECT reserved_for___sc___st__none_ FROM table_name_40 WHERE name = "uklana" |
How many different ranks in this table? | select count ( distinct rank ) from captain |
What is the name of hosts of Carnival M is back? | SELECT hosts FROM farm_competition WHERE Theme like "%Carnival M is back%" |
What are the languages that are used most often in songs? | SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1 |
What Name has a Time of 01:56:52? | SELECT name FROM table_name_46 WHERE time = "01:56:52" |
What position is the player Jordan Fransoo in? | SELECT position FROM table_11803648_20 WHERE player = "Jordan Fransoo" |
If winner is alejandro Valverde and the points Classification is by Erik Zabel, who is the mountain classification? | SELECT mountains_classification FROM table_15059783_1 WHERE winner = "Alejandro Valverde" AND points_classification = "Erik Zabel" |
What are the ids for transactions that have an amount greater than the average amount of a transaction? | SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions) |
What country has an IEF 2011 of 45.3? | SELECT country FROM table_name_46 WHERE ief_2011 = "45.3" |
Name the number of first elected for kentucky 3 | SELECT COUNT(first_elected) FROM table_2668378_5 WHERE district = "Kentucky 3" |
What is Margin, when Match Date is Oct 17, 2007? | SELECT margin FROM table_name_86 WHERE match_date = "oct 17, 2007" |
How many more territories are there in than Eastern Region than in the Southern Region? | SELECT ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern' ) - ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern' ) AS Calu |
What was the population density in km2 for 2011 in the division where area in km2 was 684.37 in 2011? | SELECT population_density___km²_2011_ FROM table_24027047_1 WHERE area__km²__2011 * * = "684.37" |
WHAT IS THE RANK WITH A GROSS OF $96,773,200? | SELECT COUNT(rank) FROM table_name_59 WHERE gross = "$96,773,200" |
What was the total number of wins that had an against greater than 1136 but losses less than 15 with Ultima with less than 2 byes? | SELECT SUM(wins) FROM table_name_62 WHERE against > 1136 AND losses < 15 AND golden_rivers = "ultima" AND byes < 2 |
What are the id and names of the countries which have more than 3 car makers or produce the 'fiat' model? | SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country GROUP BY T1.countryId HAVING count(*) > 3 UNION SELECT T1.countryId , T1.CountryName FROM Countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId = T2.Country JOIN MODEL_LIST AS T3 ON T2.Id = T3.Maker WHERE T3.Model = 'fiat'; |
which females had a wedding in 2016? | SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' |
Could you filter this list to show just the movie studio which has the largest number of movies? | SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT ( * ) DESC LIMIT 1 |
How many sports do we have? | SELECT count(DISTINCT sportname) FROM Sportsinfo |
What are the names of the products that have the characteristic name "fast"? | SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t3.characteristic_name = "fast" |
Which authors belong to the institution "Google"? Show the first names and last names. | SELECT DISTINCT t1.fname , t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" |
What is Teleplay, when Season is greater than 1.1, and when First Broadcast is "February 20, 1981"? | SELECT teleplay FROM table_name_37 WHERE season > 1.1 AND first_broadcast = "february 20, 1981" |
What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania placed fourth? | SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania" |
Give the reorder level for the products from the supplier "Nord-Ost-Fisch Handelsgesellschaft mbH". | SELECT T1.ReorderLevel FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Nord-Ost-Fisch Handelsgesellschaft mbH' |
what is the fault status of Engineer with the first name Etha? | SELECT T2.fault_status FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 on T1.engineer_id = T2.engineer_id where T1.first_name = "Etha" |
Which Current Club has a Player of bassem balaa? | SELECT current_club FROM table_name_97 WHERE player = "bassem balaa" |
What is the Score that has a Result of 2–1 on 5 july 2007? | SELECT score FROM table_name_47 WHERE result = "2–1" AND date = "5 july 2007" |
Tell me the home team score for richmond home team | SELECT home_team AS score FROM table_name_87 WHERE home_team = "richmond" |
Which part has the least chargeable amount ? List the part id and amount. | SELECT part_id , chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1 |
How many games had fewer than 118 opponents and more than 109 net points with an opponent of Washington? | SELECT COUNT(game) FROM table_name_37 WHERE opponents < 118 AND nets_points > 109 AND opponent = "washington" |
what are all the marketing regions? | SELECT marketing_region_name from marketing_regions |
What was the score for the June 22 game with attendance 0? | SELECT score FROM table_name_44 WHERE date = "june 22" AND attendance = 0 |
How much profit can the company gained from selling two high class black Road Bikes with a size of 58? | SELECT 2 * (T1.ListPrice - T1.StandardCost) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID WHERE T1.Class = 'H' AND T1.Color = 'Black' AND T1.Size = 58 AND T2.Name = 'Road Bikes' |
Calculate the average rating of the true crime category. | SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime' |
What is the highest level of job to get to for the employee who got hired the earliest? | SELECT T2.max_lvl FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.hire_date LIMIT 1 |
How many times is the formula tl 2 ba 2 cuo 6? | SELECT no_of_cu_o_planes_in_unit_cell FROM table_101336_1 WHERE formula = "Tl 2 Ba 2 CuO 6" |
Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on Sep 21, 2010. | SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL"; |
What is the county for senator C. Anthony Muse? | SELECT county_s__represented FROM table_11948857_1 WHERE member_senator = "C. Anthony Muse" |
What is the average horsepower of the cars before 1980? | SELECT avg(horsepower) FROM CARS_DATA WHERE YEAR < 1980; |
List out stations number and items sold by store 17. | SELECT T1.station_nbr, T2.item_nbr FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.store_nbr = 17 GROUP BY T1.station_nbr, T2.item_nbr |
What are their names? | SELECT name FROM Employee EXCEPT SELECT eid FROM Certificate |
List total loses forh the tauras tauragė team. | SELECT COUNT(loses) FROM table_18018214_2 WHERE club = "Tauras Tauragė" |
How many races did the Formula Three Euroseries signature team have? | SELECT SUM(races) FROM table_name_2 WHERE series = "formula three euroseries" AND team = "signature" |
List the names of all authors affiliated with Birkbeck University of London. | SELECT Name FROM Author WHERE Affiliation = 'Birkbeck University of London' |
What is the first name and job id for all employees in the Finance department? | SELECT T1.first_name , T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance' |
What was the total salary of those players? | SELECT SUM ( salary ) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000 |
How many games had the team played after they were 40-20? | SELECT game FROM table_13762472_7 WHERE record = "40-20" |
Which railway number has 3 quantity? | SELECT railway_number_s_ FROM table_name_19 WHERE quantity = 3 |
Which is the majority of the ethnic group in country with great than 10,000,000 population | SELECT T2.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Population > 10000000 GROUP BY T2.Name, T2.Percentage ORDER BY T2.Percentage DESC LIMIT 2 |
What are the number of rooms for each bed type? | SELECT bedType , count(*) FROM Rooms GROUP BY bedType; |
List the nominees that have been nominated more than two musicals. | SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2 |
what are the highest crime rate in the county public safety table | SELECT Crime_rate FROM county_public_safety ORDER BY Crime_rate DESC LIMIT 1 |
What is the average chart number for 11/1965? | SELECT AVG(chart_no) FROM table_name_97 WHERE date = "11/1965" |
What are the names of all the subjects. | SELECT subject_name FROM SUBJECTS |
Who's the shooter with 13 score points and 10 rank points? | SELECT shooter FROM table_name_32 WHERE score_points = "13" AND rank_points = "10" |
What's the least amount of draft copies that a document has? | SELECT count ( copy_number ) FROM Draft_Copies GROUP BY document_id ORDER BY count ( copy_number ) LIMIT 1 |
What is the average fleet size for the Shunter type introduced in 1959? | SELECT AVG(fleet_size) FROM table_name_3 WHERE type = "shunter" AND introduced = "1959" |
What tour was cancelled? | SELECT name FROM table_name_14 WHERE date = "cancelled" |
How many members does it have? | SELECT count ( * ) FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count ( * ) ASC LIMIT 1 |
Which Pavilion depth has a Brilliance Grade of 100% and a Pavilion angle of n/a? | SELECT pavilion_depth FROM table_name_36 WHERE brilliance_grade = "100%" AND pavilion_angle = "n/a" |
What is the percentage of reviews added each year of the total reviews added? | SELECT CAST((SUM(CASE WHEN run_at LIKE '2022-%' THEN reviews_added ELSE 0 END) - SUM(CASE WHEN run_at LIKE '2021-%' THEN reviews_added ELSE 0 END)) AS REAL) * 100 / SUM(reviews_added) OR '%' "percentage" FROM runs |
When the wallington new foresters are in division four what is the season? | SELECT season FROM table_24575253_4 WHERE division_four = "Wallington New Foresters" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.