sentence
stringlengths
3
347
sql
stringlengths
18
804
Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed".
SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed"
Which Away team has a Home team of south melbourne?
SELECT away_team FROM table_name_63 WHERE home_team = "south melbourne"
Which year did the school with the mascot of the Vikings join?
SELECT year_joined FROM table_name_83 WHERE mascot = "vikings"
What is the sum of District, when Took Office is greater than 1981, and when Senator is Cyndi Taylor Krier?
SELECT SUM(district) FROM table_name_67 WHERE took_office > 1981 AND senator = "cyndi taylor krier"
Which of the role codes has the most employees?
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count ( * ) DESC LIMIT 1
What is the average points with a year higher than 1989, and a rank of 7th?
SELECT AVG(points) FROM table_name_60 WHERE year > 1989 AND rank = "7th"
what are the characteristic names of "Cumin"?
SELECT t3.characteristic_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 WHERE t1.product_name = "cumin"
List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.
SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700
List by their ID number the 3 longest complaints.
SELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3
Who directed the film 'The Chapel'?
SELECT director_s_ FROM table_name_22 WHERE film = "the chapel"
Find the number of times ROY SWEAZY has reserved a room.
SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY";
What are the districts that belong to the country with the lowest surface area?
SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T2.SurfaceArea ASC LIMIT 1
What is the name of the entrepreneur with the greatest weight?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
What is the total of crowd at Venue of mcg?
SELECT SUM(crowd) FROM table_name_7 WHERE venue = "mcg"
What genre has a station of Class 95FM?
SELECT genre FROM table_name_53 WHERE station = "class 95fm"
Tell me the score for Venue of tanteen recreation ground, st. george's
SELECT score FROM table_name_43 WHERE venue = "tanteen recreation ground, st. george's"
What is the phone number for customer id 118?
SELECT phone_number FROM customers where customer_id = 118
how many different types of apartments are there?
SELECT count ( DISTINCT apt_type_code ) FROM Apartments
Who was the Class D winner in round 6?
SELECT class_d_winner FROM table_24852622_1 WHERE round = "6"
From what town was Steve Zakuani?
SELECT home_town FROM table_name_7 WHERE player = "steve zakuani"
What is the Onehunga school with a decile 3 and smaller than 310 rolls?
SELECT name FROM table_name_17 WHERE decile = "3" AND roll < 310 AND area = "onehunga"
Which region had a catalog number of 570 734-2?
SELECT region FROM table_name_19 WHERE catalog = "570 734-2"
How many years has 1 run?
SELECT COUNT(year) FROM table_name_53 WHERE score = "1 run"
How many times has the Cornwall HC team, that has scored more than 18 goals, lost ?
SELECT COUNT(losses) FROM table_name_12 WHERE team = "cornwall hc" AND goals_for > 18
What about the account details with the value having the character '5' in it, please?
SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
How many 'has' predicate classes does image ID 107 have?
SELECT COUNT(T2.PRED_CLASS) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 107 AND T2.PRED_CLASS = 'has'
When were episodes first broadcast with jessica ennis as andrew and jacks guest?
SELECT first_broadcast FROM table_29141354_5 WHERE andrew_and_jacks_guest = "Jessica Ennis"
How many different types of rooms are there?
SELECT COUNT(DISTINCT roomtype) FROM room
and can you tell me what the interaction type is for ALA synthase?
SELECT distinct ( T1.interaction_type ) FROM medicine_enzyme_interaction AS T1 JOIN enzyme AS T2 ON T1.enzyme_id = T2.id WHERE T2.name = 'ALA synthase'
what is the elevation for port elizabeth?
SELECT elevation FROM table_27708484_3 WHERE city = "Port Elizabeth"
What is the film title and inventory id of the item in the inventory which was rented most frequently?
SELECT T1.title , T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY count(*) DESC LIMIT 1
What are the names of teams from universities that have a below average enrollment?
SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT avg(enrollment) FROM university)
What is the result of the fight when record is 12-2?
SELECT res FROM table_name_79 WHERE record = "12-2"
What are the unique names of all race held between 2014 and 2017?
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
How many tests have result "Fail"?
SELECT count(*) FROM Student_Tests_Taken WHERE test_result = "Fail"
Who are the coaches for team with winning rate of 80% and above?
SELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80
How many years had fewer than 2089.2 pigs?
SELECT COUNT(year) FROM table_name_81 WHERE pigs < 2089.2
when co2 is 192g/km, what is the power?
SELECT power FROM table_24729_2 WHERE co2 = "192g/km"
Name the word with pronunciation b of *sɨks
SELECT word FROM table_name_55 WHERE pronunciation_b = "*sɨks"
At what event did he fight takaharu murahama?
SELECT event FROM table_name_5 WHERE opponent = "takaharu murahama"
What are the order ids and customer ids for orders that have been Cancelled, sorted by their order dates?
SELECT order_id , customer_id FROM customer_orders WHERE order_status_code = "Cancelled" ORDER BY order_date
How many stadiums are not in country "Russia"?
SELECT count(*) FROM stadium WHERE country != 'Russia'
What is the per capital income for Washington county?
SELECT per_capita_income FROM table_name_12 WHERE county = "washington"
Which industries have both companies with headquarter in "USA" and companies with headquarter in "China"?
SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China"
How many female students (sex is F) whose age is below 25?
SELECT count(*) FROM student WHERE sex = 'F' AND age < 25
Please show the names of the buildings whose status is "on-hold", in ascending order of stories.
SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC
List down names of teams that have played as second team against Pune Warriors.
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_2 WHERE T1.Team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Pune Warriors' ) GROUP BY T2.Team_Name
In which country was the xiamen international marathon?
SELECT country FROM table_26166836_1 WHERE road_race = "Xiamen International Marathon"
How many tweets in French were posted from Australia?
SELECT COUNT(DISTINCT T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Lang = 'fr' AND T2.Country = 'Australia'
How many sections does each course has?
SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code
From which party is the incumbent who was first elected to office in 1990?
SELECT party FROM table_name_8 WHERE first_elected = 1990
What is the college hall of fame of the player who plays fullback?
SELECT college_hall_of_fame FROM table_name_83 WHERE position = "fullback"
How many students are there in each major?
SELECT count(*) , major FROM student GROUP BY major
Which position at UCLA has a lower than 92 pick number?
SELECT position FROM table_name_27 WHERE pick < 92 AND school_club_team = "ucla"
What is the name of the city in English and Hanzi that hosted in 2011?
SELECT t1.city ,t1.Hanzi FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city where t2.year = 2011
In 1976, who was the reporter for the Belmont Stakes?
SELECT reporters FROM table_22583466_5 WHERE year = 1976
What is the full name of each student who is not allergic to any type of food.
SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")
Yes, can you show me all the attorney generals from democratic party?
SELECT Attorney_General FROM party where Party = 'Democratic'
Show the id of the employee named Ebba.
SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
Who was the champion for the 1998-99 season?
SELECT champion FROM table_19651669_1 WHERE season = "1998-99"
What competition has 41 goals?
SELECT competition FROM table_name_63 WHERE goal = 41
What is the average age of the athletes from the United States of America who competed in the 2016 Summer Olympics?
SELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id INNER JOIN noc_region AS T4 ON T3.region_id = T4.id WHERE T1.games_name = '2016 Summer' AND T4.region_name = 'USA'
A score of 71-71=142 earned what place?
SELECT place FROM table_name_11 WHERE score = 71 - 71 = 142
Where does the staff Jon Stephens live?
SELECT T1.address, T1.address2 FROM address AS T1 INNER JOIN staff AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'Jon' AND T2.last_name = 'Stephens'
How many total orders do we have?
SELECT count ( * ) FROM orders
And the names of the people who are not students?
SELECT name FROM Person WHERE job ! = "student"
Can you tell me the Record that has the Date of december 15?
SELECT record FROM table_name_42 WHERE date = "december 15"
What are some parties with theme "Spring"?
SELECT * FROM party WHERE Party_Theme = "Spring"
Which country produced the most fuel-efficient car?
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg DESC LIMIT 1
How many outcomes are listed when the final opponent was Johan Kriek?
SELECT COUNT(outcome) FROM table_22597626_5 WHERE opponent_in_the_final = "Johan Kriek"
What is the average draws for a player larger than 16 with more than 1 tries and a win percentage smaller than 56.15%?
SELECT AVG(drawn) FROM table_name_86 WHERE tries > 1 AND _percentage_won < 56.15 AND played > 16
what country is john nielsen from
SELECT country FROM table_name_10 WHERE driver = "john nielsen"
Among the pairs of genes that are not from the class of motorproteins, how many of them are negatively correlated?
SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr < 0 AND T1.Class = 'Motorproteins'
And, do you also have information on the total number of instructors in each department?
SELECT count ( DISTINCT T2.id ) , count ( DISTINCT T3.id ) , T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name GROUP BY T3.dept_name
Please list any three order numbers that have been shipped using Speedy Express.
SELECT T1.OrderID FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express' LIMIT 3
What lifespan has a majors greater than 1, and fuzzy zoeller as the name?
SELECT lifespan FROM table_name_37 WHERE majors > 1 AND name = "fuzzy zoeller"
Give the classes that have more than two captains.
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
Name the champion for israel bowl of iv
SELECT champion FROM table_name_33 WHERE israel_bowl = "iv"
Which accounts with checking accounts have savings account balances higher than the average savings balance?
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN ( SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > ( SELECT avg ( balance ) FROM savings ) )
What was the home score at the Princes Park game?
SELECT home_team AS score FROM table_name_95 WHERE venue = "princes park"
How many entries are shown for date of successors formal installation where successor is john w. walker (dr)?
SELECT COUNT(date_of_successors_formal_installation) FROM table_225099_3 WHERE successor = "John W. Walker (DR)"
What is the total of wins when the evens is less than 3?
SELECT SUM(wins) FROM table_name_66 WHERE events < 3
Which Results have a Category of the best new actor in lead role(female)?
SELECT results FROM table_name_32 WHERE category = "best new actor in lead role(female)"
How many umpires are from South Africa?
SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country
what is the date of first flight?
SELECT Date FROM flight ORDER BY Date LIMIT 1
What is the most common mill type, and how many are there?
SELECT TYPE , count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
How many restricted horror movies were released between 1/1/1990 to 12/31/2015?
SELECT COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'R' AND genre = 'Horror' AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2015
What is the yearly average review done by user ID 3?
SELECT COUNT(review_stars) / (strftime('%Y', 'now') - T1.user_yelping_since_year) FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_id = 3
Who is the oldest in the list?
SELECT name FROM captain order by age desc limit 1
How many counties have a place name of Macedonia?
SELECT COUNT(county_ies__)[a_] FROM table_249512_2 WHERE place_name = "Macedonia"
what are all the addresses including line 1 and line 2?
SELECT line_1 , line_2 FROM addresses
Who is the percussionist for The Coral?
SELECT vocal_percussionist FROM table_28715942_6 WHERE original_artist = "The Coral"
Which game site Kickoff [a] of 1:00, and an Attendance of 63,251?
SELECT game_site FROM table_name_53 WHERE kickoff_[a_] = "1:00" AND attendance = "63,251"
What are the names of people who have a height greater than 200 or less than 190?
SELECT name FROM people WHERE height > 200 OR height < 190
What is the amenity_name of Dorm_amenity? | Did you want all amenity names for dorms? | Yes
SELECT amenity_name from dorm_amenity
Which wines were produced in 2007?
select winery from wine where year = 2007
Show all artist name, age, and country ordered by the year they joined.
SELECT name , age , country FROM artist ORDER BY Year_Join
What are the names of players who participated in season year 2008?
SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008 GROUP BY T1.Player_Name
What is the highest number of games played for teams that lost over 5 games and had an against total of 228?
SELECT MAX(played) FROM table_name_52 WHERE lost > 5 AND against = 228
Among all the production technicians, how many have a below average pay rate for a production technician?
SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' AND T2.Rate < ( SELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' )