sentence
stringlengths
3
347
sql
stringlengths
18
804
Tell me the event for 2012 london games
SELECT event FROM table_name_70 WHERE games = "2012 london"
What is the account balance of the supplier with the most parts?
SELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1
How about the total number of songs?
SELECT count ( * ) from song
How many totals have 1 for the gold, 12 for the rank, and a sliver greater than 0?
SELECT COUNT(total) FROM table_name_60 WHERE gold = 1 AND rank = "12" AND silver > 0
List down all the roles of Matt Groening on the episode titled 'In the Name of the Grandfather' along with the episode number and series number.
SELECT T2.role, T1.episode, T1.number_in_series FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Matt Groening' AND T1.title = 'In the Name of the Grandfather';
What is the population density in Buffalo Lake?
SELECT population_density__per_km_2__ FROM table_2500440_1 WHERE name = "Buffalo Lake"
Please list the last names and first names of all-star players whose team were ranked 1 for consecutive 3 years from 1937 to 1940.
SELECT T5.lastName, T5.firstName FROM players_teams AS T4 INNER JOIN players AS T5 ON T4.playerID = T5.playerID WHERE T4.year BETWEEN 1937 AND 1940 AND T4.tmID IN ( SELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN teams AS T2 INNER JOIN teams AS T3 ON T1.tmID = T2.tmID AND T2.tmID = T3.tmID AND T3.year - T2.year = 1 AND T2.year - T1.year = 1 WHERE T1.rank = 1 AND T1.year BETWEEN 1937 AND 1940 )
What points have 1 for drawn, and 16 as a try bonus?
SELECT points_for FROM table_name_22 WHERE drawn = "1" AND try_bonus = "16"
What is the minimum year born for strasbourg?
SELECT MIN(year_born) FROM table_12962773_13 WHERE current_club = "Strasbourg"
What is the average Year when there was a cosworth straight-4 engine, and the Entrant was ron harris / team lotus?
SELECT AVG(year) FROM table_name_17 WHERE engine = "cosworth straight-4" AND entrant = "ron harris / team lotus"
What hometown is Kyle love from?
SELECT hometown FROM table_name_47 WHERE name = "kyle love"
How many subjects have the pinyin shixun?
SELECT COUNT(subject) FROM table_1216675_1 WHERE pinyin = "Shixun"
What is the average edispl of the cars of model volvo?
SELECT AVG(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId = T2.Id WHERE T1.Model = 'volvo'
What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?
SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200
What is the average number of million viewers that watched an episode before episode 11 with a share of 4?
SELECT AVG(viewers__millions_) FROM table_name_28 WHERE episode__number < 11 AND share = "4"
How many games were won with 2nd oha was standing and there were 62 games?
SELECT won FROM table_1143966_1 WHERE standing = "2nd OHA" AND games = 62
For each customer who has at least two orders, find the customer name and number of orders made.
SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2
What is the away score with a record of 7-4, win% of 0.637, and 2010 season?
SELECT away FROM table_name_22 WHERE record = "7-4" AND win__percentage = 0.637 AND season = "2010"
What is the lowest rank of a swimmer named Elizabeth Van Welie with a lane larger than 5?
SELECT MIN(rank) FROM table_name_85 WHERE lane > 5 AND name = "elizabeth van welie"
List down the rating of episodes that were produced by Jason Bikowski.
SELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Jason Bikowski';
What was the result of the Georgia 8 district?
SELECT result FROM table_19753079_13 WHERE district = "Georgia 8"
What was his minimum number wins in a single year?
SELECT MIN(wins) FROM table_25557880_1
Among the universities in Australia, how many of them have more than 15000 students in 2011?
SELECT COUNT(*) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Australia' AND T2.year = 2011 AND T2.num_students > 15000
How many problems does the product with the most problems have? List the number of the problems and product name.
SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1
what is zach's job?
SELECT job from Person where name = 'Zach'
How many people attended games with st kilda as the home side?
SELECT SUM(crowd) FROM table_name_57 WHERE home_team = "st kilda"
show the least three salaries in the table
SELECT salary FROM Employee ORDER BY salary ASC LIMIT 3
How many authors does the paper "Equation Solving in Geometrical Theories" have?
SELECT COUNT(T1.AuthorId) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Equation Solving in Geometrical Theories'
What is the length of the fastest roller coaster in Austria?
SELECT T2.length FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID where T1.Name = "Austria" order by T2.speed desc limit 1
What is Opponent In The Final, when Year is "1942"?
SELECT opponent_in_the_final FROM table_name_33 WHERE year = 1942
How many word that has number of different words equal to 3?
SELECT COUNT(T2.wid) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.words = 3
Which students didn't attend courses?
SELECT * FROM student_course_registrations WHERE student_id NOT IN ( SELECT student_id FROM student_course_attendance )
which winner has a jockery containing jerry bailey and the owner of overbrook farm?
SELECT winner FROM table_name_28 WHERE jockey = "jerry bailey" AND owner = "overbrook farm"
What is the lowest number of games with a rank less than 1?
SELECT MIN(games) FROM table_name_48 WHERE rank < 1
Which department has the highest amount of students?
SELECT dept_name FROM student GROUP BY dept_name ORDER BY count ( * ) DESC LIMIT 1
What are the full names of all left handed players, in order of birth date?
SELECT first_name , last_name FROM players WHERE hand = 'L' ORDER BY birth_date
what was the score in 1990
SELECT score FROM table_name_85 WHERE year = 1990
How many branches where have more than average number of memberships are there?
SELECT count(*) FROM branch WHERE membership_amount > (SELECT avg(membership_amount) FROM branch)
What are the different positions of players from UCLA or Duke colleges?
SELECT DISTINCT POSITION FROM match_season WHERE College = "UCLA" OR College = "Duke"
Name the total number of played when points of is 31-7, position is 16 and goals for is less than 35
SELECT COUNT(played) FROM table_name_67 WHERE points = "31-7" AND position = 16 AND goals_for < 35
Which Date has a Score of 106–112?
SELECT date FROM table_name_58 WHERE score = "106–112"
Find the number of distinct courses that have enrolled students.
SELECT count(course_id) FROM Student_Course_Enrolment
When did the ATV that launched on 9 March 2008, deorbit?
SELECT deorbit_date FROM table_name_9 WHERE launch_date = "9 march 2008"
Which Opponent has Yards smaller than 197, and an Average smaller than 32, and a Year of 1966?
SELECT opponent FROM table_name_95 WHERE yards < 197 AND average < 32 AND year = 1966
In which regions are the stores that have shipped products through the WARE-UHY1004 warehouse?
SELECT T FROM ( SELECT DISTINCT CASE WHEN T3.WarehouseCode = 'WARE-UHY1004' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode INNER JOIN `Sales Orders` T3 ON T3._StoreID = T2.StoreID ) WHERE T IS NOT NULL
Wonderful! Of these product type codes, can you tell me which code is the most common one?
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT ( * ) DESC LIMIT 1
In the Venus and Adonis, what is the description of the last scene listed?
SELECT T2.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1
how many policy types are there?
SELECT count ( DISTINCT Policy_Type_Code ) FROM Customer_Policies
Among the students who got a B in the course Machine Learning Theory, how many of them have a gpa of over 3?
SELECT COUNT(student_id) FROM registration WHERE grade = 'B' AND student_id IN ( SELECT student_id FROM student WHERE gpa > 3 AND course_id IN ( SELECT course_id FROM course WHERE name = 'Machine Learning Theory' ) )
How much February has a Score of 5–2, and Points of 70?
SELECT COUNT(february) FROM table_name_44 WHERE score = "5–2" AND points = 70
Name the region before 2008 when name of best 1200
SELECT region FROM table_name_58 WHERE year < 2008 AND name = "best 1200"
List down the actor ID of actors with Dee as their last name.
SELECT actor_id FROM actor WHERE last_name = 'Dee'
Find the female friends of Alice.
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'
Find the name of students who took some course offered by Statistics department.
SELECT T3.name FROM course AS T1 JOIN takes AS T2 ON T1.course_id = T2.course_id JOIN student AS T3 ON T2.id = T3.id WHERE T1.dept_name = 'Statistics'
Can you please show me the minimum damage for all storms with maximum speed higher than 1000?
SELECT min ( damage_millions_USD ) FROM storm WHERE max_speed > 1000
What is the lowest number played with more than 30 points?
SELECT MIN(played) FROM table_name_21 WHERE points > 30
What is the average height in centimeters of all the players in the position of defense?
SELECT CAST(SUM(T2.height_in_cm) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.position_info = 'D'
What is the most common birth place of people?
SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1
Among the 'Handgun' weapon used by subject, how many percent were 'Shoot and Miss'?
SELECT CAST(SUM(subject_statuses = 'Shoot and Miss') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Handgun'
Can you tell me the Result that has the Date of september 13, 1998?
SELECT result FROM table_name_28 WHERE date = "september 13, 1998"
Which State (class) has a Successor of harry f. byrd, jr. (d)? Question
SELECT state__class_ FROM table_name_54 WHERE successor = "harry f. byrd, jr. (d)"
Find the names of Japanese constructors that have once earned more than 5 points?
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
What is the to par of player johnny miller, who has a t8 place?
SELECT to_par FROM table_name_18 WHERE place = "t8" AND player = "johnny miller"
What is the last name of the customer who placed an order for sales id 178?
SELECT T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesID = 178
What is the place of the player witha 69-69=138 score?
SELECT place FROM table_name_45 WHERE score = 69 - 69 = 138
What 2011 has 12.7% as the 2010?
SELECT 2011 FROM table_name_33 WHERE 2010 = "12.7%"
How many of the male patients are allergic to house dust mites?
SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'House dust mite allergy' AND T1.gender = 'M'
What is the rank of Manuel Cortina Martínez?
SELECT rank FROM table_name_46 WHERE athletes = "manuel cortina martínez"
What is Target Version, when License is LGPL or MPL?
SELECT target_version FROM table_name_68 WHERE license = "lgpl or mpl"
What was the attendance on October 17?
SELECT attendance FROM table_name_76 WHERE date = "october 17"
What is the sum of all laps starting at 10 and finishing at 20?
SELECT SUM(laps) FROM table_name_32 WHERE start = "10" AND finish = "20"
Yes | Sorry. I mean which game OR the sum of attendance of a team in its home game | The sum of attendance of a team in its home game
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br group by T1.team_id ORDER BY sum ( T1.attendance ) asc limit 1
Give me the full details of Zach
SELECT * FROM Person WHERE name = 'Zach'
What is the remelting temperature for the alloy that has a Sn/Sb ratio of 9.5/15?
SELECT remelting_at__°c_ FROM table_name_51 WHERE sn_sb___percentage_ = "9.5/15"
When did Richmond play an away game against Collingwood?
SELECT date FROM table_name_36 WHERE away_team = "richmond"
How many times has the points total for the afc cup competion been 289?
SELECT COUNT(afc_cup) FROM table_14460937_1 WHERE points__total_500_ = 289
Return the different descriptions for templates that have been used in a document.
SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID = T3.template_ID
In rounds 7-13 what engine was featured?
SELECT engine FROM table_name_58 WHERE rounds = "7-13"
What was the Termination of Mission date for the ambassador who was appointed by Barack Obama?
SELECT termination_of_mission FROM table_name_40 WHERE appointed_by = "barack obama"
Who directed Episode 5?
SELECT director FROM table_12919003_2 WHERE episode = "episode 5"
What is the rank of Etihad Tower 5, with less than 62 floors?
SELECT MIN(rank) FROM table_name_90 WHERE floors < 62 AND name = "etihad tower 5"
The person with a rank of 8 moving to Shakhtar Donetsk was moving from what Ukrainian Football Club as a transfer?
SELECT moving_from FROM table_name_2 WHERE moving_to = "shakhtar donetsk" AND rank = 8
in what industry is BP
SELECT industry FROM company WHERE name = "BP"
Who is the person that has no friend?
SELECT name FROM person EXCEPT SELECT name FROM PersonFriend
Find the number of bands.
SELECT count(*) FROM Band
Name the high points for 21-45 record
SELECT COUNT(high_points) FROM table_22871239_9 WHERE record = "21-45"
Return the names and ids of each account, as well as the number of transactions.
SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id
What is the Chinese Type Chinese Name of the holiday with a Tamil Name of சந்திர புத்தாண்டு (தினம் 3)?
SELECT chinese_name FROM table_name_25 WHERE type = "chinese" AND tamil_name = "சந்திர புத்தாண்டு (தினம் 3)"
What Competition had a Result of lost 1-2?
SELECT competition FROM table_name_34 WHERE result = "lost 1-2"
What is Record, when High Points is "Ray Allen (20)"?
SELECT record FROM table_name_98 WHERE high_points = "ray allen (20)"
Calculate the average monthly order and percentage of warehouse "WARE-NMK1003" in 2019. Among them, mention number of orders for floor lamps.
SELECT CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) / 12 , CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OrderNumber), COUNT(CASE WHEN T1.`Product Name` = 'Floor Lamps' AND T2.WarehouseCode = 'WARE-NMK1003' THEN T2.`Order Quantity` ELSE NULL END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T2.OrderDate LIKE '%/%/19'
Which New/Returning/Same Network has a Retitled as/Same of same, and a Last Aired larger than 1984?
SELECT new_returning_same_network FROM table_name_8 WHERE retitled_as_same = "same" AND last_aired > 1984
What is Result, when Opponent is Cincinnati Bengals?
SELECT result FROM table_name_32 WHERE opponent = "cincinnati bengals"
How many places have an area of 409.41 (km2)?
SELECT COUNT(population__2010_) FROM table_261222_1 WHERE area__km_2__ = "409.41"
What was the largest crowd size at arden street oval?
SELECT MAX(crowd) FROM table_name_58 WHERE venue = "arden street oval"
which train number departs pune at 13:00
SELECT train_number FROM table_29301050_1 WHERE departure_pune = "13:00"
what is the competition id of the country | Can you clarify? The competition id is not unique to a country. | list all the competition id for russia
SELECT Competition_ID FROM competition WHERE country = "Russia"
Which city has the least number of customers whose type code is "Good Credit Rating"?
SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY count(*) LIMIT 1
What is the max aperture for the Olympus M.Zuiko Digital ED 45mm f/1.8?
SELECT max_aperture FROM camera_lens WHERE name = "Olympus M.Zuiko Digital ED 45mm f/1.8"
Name the formed that has type of 4-cor
SELECT formed_from FROM table_name_58 WHERE type = "4-cor"