sentence
stringlengths
3
347
sql
stringlengths
18
804
On April 15 who is the Home team?
SELECT home FROM table_name_80 WHERE date = "april 15"
Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award".
SELECT Nominee FROM musical WHERE Award = "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award = "Drama Desk Award"
Which result's venue was in Rotterdam, Netherlands?
SELECT result FROM table_name_14 WHERE venue = "rotterdam, netherlands"
Give me the position of the member in the tennis club
SELECT t2.Position FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
Find the name of the ship that is steered by the youngest captain.
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
What is the most frequent status of bookings?
SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1
What is the land area for the RCM that has a population of 18847?
SELECT land_area FROM table_214920_1 WHERE population_canada_2011_census = 18847
How many countries got 796.7 points?
SELECT COUNT(rank) FROM table_1059743_2 WHERE points = "796.7"
Which player is from Saguaro High School?
SELECT position FROM table_11677691_7 WHERE school = "Saguaro High school"
What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"
What are the names of schools with the top 3 largest size?
SELECT cName FROM college ORDER BY enr DESC LIMIT 3
Find the names of items whose rank is higher than 3 and whose average rating is above 5.
SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING avg(T2.rating) > 5
Can you please filter this list to include only the rows that have 'Annual Meeting' as the Event Name?
SELECT event_id, event_name from party_events where event_name = "Annaual Meeting"
How many schools are there?
SELECT count(*) FROM school
What are the first names of students, ordered by age from greatest to least?
SELECT Fname FROM STUDENT ORDER BY Age DESC
Count the number of invoices.
SELECT count(*) FROM Invoices
What is the campus fee of "San Francisco State University" in year 1996?
SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = "San Francisco State University" AND T2.year = 1996
What home team played an away team of melbourne?
SELECT home_team FROM table_name_28 WHERE away_team = "melbourne"
What nationality is Rob Nicholson?
SELECT nationality FROM table_name_19 WHERE player = "rob nicholson"
Calculate the population density of the city as the destination of shipment no.1369.
SELECT T2.area / T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1369'
How many states have a college with more students than average?
SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)
What position is Philadelphia Fury?
SELECT position FROM table_237757_9 WHERE nasl_club_s_ = "Philadelphia Fury"
How many games were released in the year 2001?
SELECT COUNT(id) FROM game_platform AS T WHERE T.release_year = 2001
List the full name of all current female senators.
SELECT T2.first_name, T2.last_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.type = 'sen' AND T2.gender_bio = 'F' GROUP BY T2.ballotpedia_id
list out the customers first name
SELECT first_name FROM customer
Which student has the highest gpa? Give the full name.
SELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )
How many police officers are in the police force shared by county on both sides?
select count ( * ) from ( SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West" )
What was the dominant religion in 2002 in lokve?
SELECT dominant_religion__2002_ FROM table_2562572_44 WHERE settlement = "Lokve"
How many students have absent from school?
SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 1
For each Orange county campus, report the number of degrees granted after 2000.
SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = "Orange" AND T2.year >= 2000 GROUP BY T1.campus
How many times did he hold 12 poles?
SELECT COUNT(f_laps) FROM table_26400438_1 WHERE poles = 12
now, list the minimum, maximum and average age for all people
SELECT min ( age ) , max ( age ) , avg ( age ) FROM people
Find the name, city, and country of the airport that has the highest latitude.
SELECT name , city , country FROM airports ORDER BY elevation DESC LIMIT 1
How tall is Dylan Postl?
SELECT height FROM table_name_69 WHERE name = "dylan postl"
Which situation has an original u.s. airdate of December 5, 2007?
SELECT situation FROM table_14570857_1 WHERE original_us_airdate = "December 5, 2007"
What was the record during the loss by key (7-11)?
SELECT record FROM table_name_27 WHERE loss = "key (7-11)"
can you tell me how many accelerators are not compatible?
SELECT count ( * ) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser )
How many students have a soy allergy?
SELECT count ( * ) FROM Student WHERE StuID IN ( SELECT StuID FROM Has_allergy WHERE Allergy = "Soy" )
How many actors acted in movies in the Music category?
SELECT COUNT(T1.actor_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 film_category AS T4 ON T3.film_id = T4.film_id INNER JOIN category AS T5 ON T4.category_id = T5.category_id WHERE T5.name = 'Music'
What are the names of all stations with a latitude smaller than 37.5?
SELECT name FROM station WHERE lat < 37.5
What is Team, when Position is "LHP", and when Pick is "23"?
SELECT team FROM table_name_16 WHERE position = "lhp" AND pick = 23
When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'
How many males are there?
SELECT count ( * ) from person where gender = "male"
What are the details of those projects?
SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code = 'researcher' )
which person had order high amount of products | What attributes do you want to know about the customer who ordered the highest amount of products? | I want everything about it.
SELECT * 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 group by T2.customer_id order by sum ( T3.order_quantity ) desc limit 1
What is the maximum humidity in Powell Street BART when bike 496 was borrowed from the station on 8/29/2013?
SELECT T2.max_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_date LIKE '8/29/2013%' AND T1.bike_id = 496 AND T1.start_station_name = 'Powell Street BART'
What is the batting team with the batting partnets of thilina kandamby and rangana herath?
SELECT batting_team FROM table_11303072_5 WHERE batting_partners = "Thilina Kandamby and Rangana Herath"
What is the sub-parish for the church names Høyanger Kyrkje?
SELECT sub_parish__sogn_ FROM table_178389_1 WHERE church_name = "Høyanger kyrkje"
Find the number of distinct room types available.
SELECT count(DISTINCT roomtype) FROM room
How many different majors are there and how many different city codes are there for each student?
SELECT count(DISTINCT major) , count(DISTINCT city_code) FROM student
What are the distinct first names and cities of the students who have allergy either to milk or to cat?
SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
Which January has an Opponent of @ detroit red wings?
SELECT AVG(january) FROM table_name_74 WHERE opponent = "@ detroit red wings"
Who had the high assists when the location attendance was Toyota Center 18,370?
SELECT high_assists FROM table_11964154_11 WHERE location_attendance = "Toyota Center 18,370"
What is the total value purchased for supplier id 3
SELECT sum ( total_value_purchased ) from Product_Suppliers where supplier_id = 3
What Score has a Date of 11 september 2010?
SELECT score FROM table_name_25 WHERE date = "11 september 2010"
List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.
SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F';
What is the score of the game where the Rangers record was 16-8-4?
SELECT score FROM table_name_81 WHERE record = "16-8-4"
How many Yelp_Businesses in Arizona have a Elitestar rating of over 4?
SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars > 4
What is his tourist ID?
SELECT T1.Tourist_ID FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = "Vincent"
Show the name of colleges that have at least two players.
SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2
In what location was the fastest time 1:37.071s?
SELECT location FROM table_14884844_2 WHERE record = "1:37.071s"
What are the birth places that are shared by at least two people?
SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
What was the date when Chris Amon won?
SELECT date FROM table_1140090_6 WHERE winning_driver = "Chris Amon"
When tracy reid is the player what is the highest amount of minutes?
SELECT MAX(minutes) FROM table_25016555_5 WHERE player = "Tracy Reid"
What is the group C region with Illinois as group B?
SELECT group_c FROM table_name_53 WHERE group_b = "illinois"
Which Week has a Date of december 3, 2001?
SELECT week FROM table_name_56 WHERE date = "december 3, 2001"
What date was the game against Royal Antwerp?
SELECT date FROM table_name_87 WHERE opponents = "royal antwerp"
List all the names of schools with an endowment amount smaller than or equal to 10.
SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount) <= 10
How many orders in 1998 had a total price under 950?
SELECT COUNT(o_orderkey) AS countorders FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1998' AND o_totalprice < 950
List the basic of the institution in 2012 with race of all male students.
SELECT DISTINCT T1.basic, T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2012 AND T2.gender = 'M' AND t2.race = 'X'
What is Left Office, when Took Office is "11 June 2001", and when Minister is "Mirko Tremaglia"?
SELECT left_office FROM table_name_47 WHERE took_office = "11 june 2001" AND minister = "mirko tremaglia"
Name the team #2 for river plate
SELECT team__number2 FROM table_23812628_1 WHERE team__number1 = "River Plate"
What is the title of the film with a production number of 1023?
SELECT title FROM table_name_48 WHERE production_number = "1023"
Name the name or route for slope length being 336
SELECT name_or_route FROM table_17814458_1 WHERE slope_length = 336
What is the average age of students?
SELECT avg ( Age ) from Student
Which order deals with the most items? Return the order id.
SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1
How many cups of 1% lowfat milk should be added to no.1436 recipe?
SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = '1% lowfat milk' AND T2.unit = 'cup(s)' AND T2.recipe_id = 1436
Who sponsors Josele Garza in all rounds?
SELECT sponsor_s_ FROM table_name_60 WHERE rounds = "all" AND driver_s_ = "josele garza"
How many businesses are opened the same number of hours every day of the week?
SELECT COUNT(business_id) FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'
What is the name of the youngest competitor?
SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1
What is the Home Team on April 13 with a Road Team of St. Louis?
SELECT home_team FROM table_name_8 WHERE road_team = "st. louis" AND date = "april 13"
What is the accreditation level for the approved (awarded 05.12.12) date?
SELECT accreditation_level FROM table_name_72 WHERE date = "approved (awarded 05.12.12)"
How many professors have a Ph.D. in each department?
SELECT count(*) , dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code
Show the Role_Code of roles with Role_Description.
SELECT Role_Code,Role_Description FROM Roles
What is the class of the qb, Josh Riddell?
SELECT class FROM table_name_45 WHERE position = "qb" AND name = "josh riddell"
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 role did John Wayne play with Verna Hillie as the leading lady?
SELECT role FROM table_name_80 WHERE leading_lady = "verna hillie"
What are the IDs of problems that the staff member Dameon Frami reported?
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami"
Tell me the sum of earnings for rank less than 1
SELECT SUM(earnings__) AS $__ FROM table_name_63 WHERE rank < 1
What is the title of the episode directed by Rich Correll and written by Dennis Rinsler?
SELECT title FROM table_29102100_1 WHERE directed_by = "Rich Correll" AND written_by = "Dennis Rinsler"
What is the To par of the 4 Place Player?
SELECT to_par FROM table_name_9 WHERE place = "4"
What is the ratio male to female athletes in the 2012 Summer Olympic?
SELECT CAST(COUNT(CASE WHEN T3.gender = 'M' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T3.gender = 'F' THEN 1 ELSE NULL END) 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 = '2012 Summer'
Count the number of different affiliation types.
SELECT count(DISTINCT affiliation) FROM university
Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"?
SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = "AFTER" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1
Show the organizer and name for churches that opened between 1830 and 1840.
SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840
WHAT IS THE TYPE OF LAND WITH A 2007 POPULATION SMALLER THAN 4346, 2010 POPULATION LARGER THAN 3385, FROM BARANGAY OF MANALONGON?
SELECT geographic_character FROM table_name_10 WHERE population__2007_ < 4346 AND population__2010_ > 3385 AND barangay = "manalongon"
What home team played the West Coast away team?
SELECT home_team FROM table_16388230_1 WHERE away_team = "West Coast"
How many goals Olimpia recorded for 32 matches?
SELECT COUNT(goals_olimpia) FROM table_13688489_1 WHERE matches = 32
Show the station name with at least two trains.
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING count(*) >= 2
What is the average capacity that has switzerland as the country?
SELECT AVG(capacity) FROM table_name_19 WHERE country = "switzerland"