sentence
stringlengths
3
347
sql
stringlengths
18
804
Which parties did not have any delegates in elections?
SELECT Party FROM party WHERE Party_ID NOT IN (SELECT Party FROM election)
Find the name of rooms booked by some customers whose first name contains ROY.
SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%'
What the rank of the Virgin Islands athlete with react under 0.168?
SELECT rank FROM table_name_44 WHERE react < 0.168 AND nationality = "virgin islands"
List the customer's name from the South region with a standard class ship mode and sales greater than the 88% of the average sales of all orders.
SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T1.`Ship Mode` = 'Standard Class' AND 100 * T1.Sales / ( SELECT AVG(Sales) FROM south_superstore ) > 88
What are the average, minimum, and max ages for each of the different majors?
SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major
Which Points has a Position of 3, and a Drawn smaller than 2?
SELECT MAX(points) FROM table_name_55 WHERE position = 3 AND drawn < 2
How many crimes were committed at 018XX S KOMENSKY AVEin May 2018?
SELECT SUM(CASE WHEN date LIKE '5/%/2018%' THEN 1 ELSE 0 END) FROM Crime WHERE block = '018XX S KOMENSKY AVE'
What date was marcos daniel the opponent?
SELECT date FROM table_name_16 WHERE opponent = "marcos daniel"
What is the representative name of Newport Rd?
SELECT Representative_Name from gas_station where Location = "Newport Rd"
What's the least number of routes that an airline runs?
SELECT count ( * ) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count ( * ) ASC LIMIT 1
Show all the Store_Name of drama workshop groups.
SELECT Store_Name FROM Drama_Workshop_Groups
what is the name of not assigned project with the least hours?
SELECT Name FROM Projects WHERE Code NOT IN ( SELECT Project FROM AssignedTo ) order by Hours limit 1
What is the first and last name of the student participating in the most activities?
SELECT T1.fname, T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1
How many knockout of the night occurred when joe lauzon fought.
SELECT knockouts_of_the_night FROM table_21114902_1 WHERE fighter = "Joe Lauzon"
What is Points, when Draws is less than 7, when Wins is less than 16, and when Goals For is "35"?
SELECT points FROM table_name_17 WHERE draws < 7 AND wins < 16 AND goals_for = 35
What is the average price of the dishes on the menu "Zentral Theater Terrace"?
SELECT SUM(T1.price) / COUNT(T1.price) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T3.name = 'Zentral Theater Terrace'
How many sales does game platform id 3871 make in Europe?
SELECT T2.num_sales * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Europe' AND T2.game_platform_id = 3871
Find the total account balance of each customer from Utah or Texas.
SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
List the names and birth dates of people in ascending alphabetical order of name.
SELECT Name, Birth_Date FROM people ORDER BY Name
How many pages does 'Seaward' have?
SELECT num_pages FROM book WHERE title = 'Seaward'
On September 30, 1979, in a week before week 8, what was the result?
SELECT result FROM table_name_71 WHERE week < 8 AND date = "september 30, 1979"
What is the Record of the game on September 6?
SELECT record FROM table_name_49 WHERE date = "september 6"
How many Yelp_Businesses in Scottsdale have received positive comments in the Elitestar rating?
SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3
List all the work orders that is related to the Down Tube.
SELECT T2.WorkOrderID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Down Tube'
In 2012, how many Asian female graduates were seeking another type of degree or certificate at the 4-year institution at University of Alaska at Anchorage?
SELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'F' AND T2.race = 'A' AND T1.chronname = 'University of Alaska at Anchorage' AND T2.cohort = '4y other'
If the second leg is Instituto, what is the total number of aggregate?
SELECT COUNT(aggregate) FROM table_17968233_2 WHERE home__2nd_leg_ = "Instituto"
What title runs for 3:22?
SELECT title FROM table_name_5 WHERE time = "3:22"
Name all disabled students that are enrolled in SMC.
SELECT T2.name FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc'
What is the average launch date of the vmv-1 vessel in Germany?
SELECT AVG(launched) FROM table_name_37 WHERE location = "germany" AND ship = "vmv-1"
What did United States place when the score was 71-70-72-68=281?
SELECT place FROM table_name_17 WHERE country = "united states" AND score = 71 - 70 - 72 - 68 = 281
Which polling institute showed a lead of 6%?
SELECT polling_institute FROM table_name_1 WHERE lead = "6%"
what is the least number of no decisions for scott feldman category:articles with hcards
SELECT MIN(no_decisions) FROM table_19864214_3 WHERE pitcher = "Scott Feldman Category:Articles with hCards"
Which record has a Loss of eichhorn (8-5)?
SELECT record FROM table_name_54 WHERE loss = "eichhorn (8-5)"
Name the sum of inversions for opened of april 20, 2002
SELECT SUM(inversions) FROM table_name_89 WHERE opened = "april 20, 2002"
Give the number of games which were published by Ascaron Entertainment GmbH.
SELECT COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Ascaron Entertainment GmbH'
What is the elevation of the city belonging to Hampden, Massachusetts?
SELECT T3.elevation FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T1.name = 'Massachusetts' AND T2.county = 'HAMPDEN' GROUP BY T3.elevation
What is the total amount of products purchased before 2018-03-17 07:13:53?
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
What are the roles for each performance?
SELECT T2.Performance_ID,T1.Role from member as T1 join member_attendance as T2 on T1.Member_ID = T2.Member_ID group by T2.Performance_ID
Who sponsored Greg Biffle's win on April 14?
SELECT sponsor FROM table_name_46 WHERE winning_driver = "greg biffle" AND date = "april 14"
What venue has g1 as the group?
SELECT venue FROM table_name_45 WHERE group = "g1"
What is the checking balance of the account whose owner’s name contains the substring ‘ee’?
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'
What nation had a ship named Roma?
SELECT nat FROM table_name_24 WHERE name = "roma"
List of majors?
SELECT distinct ( Major ) FROM STUDENT
What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?
SELECT SUM(CASE WHEN T3.Role_Id = 1 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.Role_Id > 1 THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'SC Ganguly'
When did the old manager vacate his position in Plymouth Argyle?
SELECT date_of_vacancy FROM table_19359427_6 WHERE team = "Plymouth Argyle"
What position did Lamar Green play?
SELECT position FROM table_11545282_7 WHERE player = "Lamar Green"
What is the score for game #7?
SELECT score FROM table_20745685_1 WHERE _number = 7
Who was the opponent before week 8 when the result was l 28-17?
SELECT opponent FROM table_name_49 WHERE week < 8 AND result = "l 28-17"
List the names of all left-footed players who have overall rating between 85 and 90.
SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90
Find the number of students that have at least one grade "B".
SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B"
When a variant without niqqud is as middle letter: וו with a phonemic value of /v/, what is the variant with niqqud?
SELECT variant__with_niqqud__ FROM table_name_53 WHERE phonemic_value = "/v/" AND without_niqqud = "as middle letter: וו"
In what Year is the Works No. 2040-2049?
SELECT year FROM table_name_80 WHERE works_no = "2040-2049"
What is the Music if the Dance is Jive?
SELECT music FROM table_name_75 WHERE dance = "jive"
What is the sum of Ends with a Name of abidal, and has a Since larger than 2007?
SELECT SUM(ends) FROM table_name_58 WHERE name = "abidal" AND since > 2007
What did Hawthorn score as the home team?
SELECT home_team AS score FROM table_name_21 WHERE home_team = "hawthorn"
How many documents do not have any expense?
SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )
List down the platform IDs of the games released in 2007.
SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007
Return names of songs in volumes that are by artists that are at least 32 years old.
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32
What is the name of the shop that has the most different kinds of devices in stock?
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1
What are the id of each employee and the number of document destruction authorised by that employee?
SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID
What is Rating, when Air Date is "July 24, 2008*", and when Weekly Winner is "Sales Rep. Oscar Ledezma"?
SELECT rating FROM table_name_7 WHERE air_date = "july 24, 2008*" AND weekly_winner = "sales rep. oscar ledezma"
Great! Can you filter this list to show only the names and ids for tourist attractions that were visited 2 or more times?
SELECT T1.Name , T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count ( * ) > = 2
What term did an Electorate of indi have in office?
SELECT term_in_office FROM table_name_73 WHERE electorate = "indi"
Other income sources of 2%, and a State pensions of 7%, and a Working tax credit of 2%, and a Employment ( salaries & wages) of 66% has what occupational pensions?
SELECT occupational_pensions FROM table_name_34 WHERE other_income_sources = "2%" AND state_pensions = "7%" AND working_tax_credit = "2%" AND employment___salaries_ & _wages_ = "66%"
What is the total and minimum enrollment of all schools?
SELECT SUM(enrollment), MIN(enrollment) FROM university
What is the name of the production company that made the most movies?
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1
Which League championship is the lowest one that has a Venue of penn state ice pavilion, and a Club of penn state nittany lions men's ice hockey?
SELECT MIN(league) AS championships FROM table_name_78 WHERE venue = "penn state ice pavilion" AND club = "penn state nittany lions men's ice hockey"
What year was jerry marion drafted?
SELECT MAX(draft_year) FROM table_13758243_1 WHERE player = "Jerry Marion"
What are the names of Bob's friends?
SELECT friend from personfriend where name = "Bob"
What name was listed 02/21/1990, and a CERCLIS ID of scd980844005?
SELECT name FROM table_name_97 WHERE listed = "02/21/1990" AND cerclis_id = "scd980844005"
What is the id of the patient who stayed in room 111 most recently?
SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1
Tell me the goals for score of 38-28
SELECT goals FROM table_name_54 WHERE score = "38-28"
Who was the pilot of max altitude of 55.9 miles?
SELECT pilot FROM table_221315_3 WHERE max_altitude__miles_ = "55.9"
What circuit did marlboro team penske win with an unknown fastest lap?
SELECT circuit FROM table_name_67 WHERE winning_team = "marlboro team penske" AND fastest_lap = "unknown"
For each faculty rank, show the number of faculty members who have it.
SELECT rank , count(*) FROM Faculty GROUP BY rank
What are the number of games played for students under the age of 20?
SELECT sum ( gamesplayed ) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20
Return the names of products in the category 'Spices'.
SELECT product_name FROM products WHERE product_category_code = "Spices"
What is the lowest Pick # of Saint Vincent College?
SELECT MIN(pick__number) FROM table_name_78 WHERE college = "saint vincent college"
What's the record for the match when the res was a win and the method was a decision?
SELECT record FROM table_name_91 WHERE method = "decision" AND res = "win"
In what round was a player from Michigan selected?
SELECT MAX(round) FROM table_name_54 WHERE school_club_team = "michigan"
What is Location, when Fastest Lap is Ben Spies, when Pole Position is Ben Spies, when Winner is Ben Spies, and when Date is Tooele, Utah?
SELECT location FROM table_name_77 WHERE fastest_lap = "ben spies" AND pole_position = "ben spies" AND winner = "ben spies" AND date = "tooele, utah"
Name the F. Goals for games of 22 22 and points of 012 12
SELECT F.goals FROM table_name_31 WHERE games = "22 22" AND points = "012 12"
List all the dates of the urgent orders.
SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT'
What are the first name and last name of Linda Smith's advisor?
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith"
find the number of routes from the United States to Canada
SELECT count ( * ) FROM routes WHERE dst_apid IN ( SELECT apid FROM airports WHERE country = 'Canada' ) AND src_apid IN ( SELECT apid FROM airports WHERE country = 'United States' )
Which team 1 played against team 2 of Tours FC (D2)?
SELECT team_1 FROM table_name_21 WHERE team_2 = "tours fc (d2)"
How many phones are there?
SELECT count(*) FROM phone
Which Mac OS X has a Linux of no, and an AmigaOS of no, and an Android of unknown?
SELECT mac_os_x FROM table_name_88 WHERE linux = "no" AND amigaos = "no" AND android = "unknown"
How much US dollars does a Ford Torino cost?
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino'
Find the buildings which have rooms with capacity more than 50.
SELECT DISTINCT building FROM classroom WHERE capacity > 50
What was the surface of the score of 7–5, 3–6, 7–6?
SELECT surface FROM table_name_58 WHERE score = "7–5, 3–6, 7–6"
How many total campuses were opened?
SELECT count ( * ) FROM campuses
Which Total has a Country of united states, and a Player of andy north?
SELECT AVG(total) FROM table_name_12 WHERE country = "united states" AND player = "andy north"
When the Away team of essendon was playing, what was the Home team's score?
SELECT home_team AS score FROM table_name_62 WHERE away_team = "essendon"
Now show the number of airports in each of those cities
SELECT city , count ( * ) FROM airports GROUP BY city HAVING count ( * ) > 1
Who was the Best Male MC if Best Album won the Best Male Lyricist?
SELECT best_male_mc FROM table_22546460_4 WHERE best_male_lyricist = "Best Album"
List the id, genre and artist name of English songs ordered by rating.
SELECT f_id , genre_is , artist_name FROM song WHERE languages = "english" ORDER BY rating
Give me the match ID and date of the matches that were held in Kingsmead for three consecutive days.
SELECT T1.Match_Id, T1.Match_Date FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'Kingsmead'
Show the most common apartment type code among apartments with more than 1 bathroom.
SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1
Describe the voice actors and villains in Cinderella.
SELECT T1.`voice-actor`, T2.villian FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Cinderella'