sentence
stringlengths
3
347
sql
stringlengths
18
804
Who was the home team on September 20, 1998 at Spartan Stadium?
SELECT home_team FROM table_name_39 WHERE venue = "spartan stadium" AND date = "september 20, 1998"
When did the episode 1.13 air for the first time?
SELECT date_aired FROM table_28283535_4 WHERE episode = "1.13"
How many customers are from the place with the highest average income per month?
SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_K DESC LIMIT 1
How many policies are listed total?
SELECT count ( Policy_ID ) FROM Customers_Policies
what is the title where the airdate is december 5, 1964?
SELECT title FROM table_25800134_9 WHERE airdate = "December 5, 1964"
Who is the opponent with a 0-1 record?
SELECT opponent FROM table_name_81 WHERE record = "0-1"
which countries' tv channels are not playing any cartoon written by Todd Casey?
SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'
Provide the last name of the youngest student.
SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)
How many bonus points are there when points for is 385?
SELECT bonus_points FROM table_17510803_2 WHERE points_for = "385"
Find the id and star rating of each hotel and sort them in increasing order of price.
SELECT hotel_id , star_rating_code FROM HOTELS ORDER BY price_range ASC
What are their full names?
SELECT first_name, last_name FROM employees WHERE first_name NOT LIKE '%M%'
Show the ids and names of festivals that have at least two nominations for artworks.
SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2
Find the names of the artists who are from UK and have produced English songs.
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT artist_name FROM song WHERE languages = "english"
Which tie number has Bolton Wanderers as away?
SELECT tie_no FROM table_name_59 WHERE away_team = "bolton wanderers"
Who visited on march 26?
SELECT visitor FROM table_name_6 WHERE date = "march 26"
Find the founded year of the newest non public school.
SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
Name the Team which has Points larger than 9, and a Year larger than 1971, and a Class of 250cc?
SELECT team FROM table_name_12 WHERE points > 9 AND year > 1971 AND class = "250cc"
Find the name, population and expected life length of asian country with the largest area?
SELECT Name , Population , LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1
Can you tell me the extension for the professor in office KLR229D, please?
SELECT prof_extension from professor where prof_high_degree = "Ph.D." and dept_code = "ACCT" and prof_office = "KLR 229D"
Please show the most common publication date.
SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1
Name the driver for 200 laps 1997
SELECT driver FROM table_2150776_1 WHERE laps = "200" AND year = "1997"
which is the minimun amount of silver medals?
SELECT MIN(silver) FROM table_22355_35
What is the least top division titles?
SELECT MIN(top_division_titles) FROM table_11250_4
Can you tell me the lowest Pts/game that has the Name of philippa tuttiett, and the Points larger then 6?
SELECT MIN(pts_game) FROM table_name_59 WHERE name = "philippa tuttiett" AND points > 6
please tell me Clara phone number
SELECT phone_number FROM customers where first_name = "Clara"
List the names and buildings of all departments sorted by the budget from large to small.
SELECT dept_name , building FROM department ORDER BY budget DESC
Name the number of locations for uk32
SELECT COUNT(location_s_) FROM table_19897294_8 WHERE no_overall = "UK32"
Since which year has CProxy been compatible?
SELECT T2.compatible_since_year FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.accelerator_id WHERE T1.name = "CProxy"
Find the name of the customer who made an order most recently.
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
And the name with the smallest population?
SELECT County_name FROM county ORDER BY Population ASC LIMIT 1
What was Spring Creek School's area when the decile was 4?
SELECT area FROM table_name_67 WHERE decile = 4 AND name = "spring creek school"
Which level has marvin gaye as artist 1 and david bowie as artist 2?
SELECT level FROM table_23649244_1 WHERE artist_1 = "Marvin Gaye" AND artist_2 = "David Bowie"
What was the opponent at the League Play Offs at home?
SELECT opponents FROM table_name_8 WHERE venue = "home" AND competition = "league play offs"
what would be final four mvp maximum when first team is 1
SELECT MAX(final_four_mvp) FROM table_26130295_3 WHERE first_team = 1
How many floors did the tallest building in Aston have?
SELECT floors FROM table_name_43 WHERE location = "aston"
Ok, the class will be in Room 224. Do you know who the instructor will be?
SELECT Instructor FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
What is the ratio number of territories in Northern region and number territories in Western region?
SELECT CAST(( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Northern' ) AS REAL) * 100 / ( SELECT COUNT(T1.TerritoryID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Westerns' ) AS Calu
how many end of term with age at inauguration being 64-066 64years, 66days
SELECT COUNT(end_of_term) FROM table_12134383_1 WHERE age_at_inauguration = "64-066 64years, 66days"
Which of these claims is most recently created?
SELECT t1.claim_header_id FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.document_type_code = "Document" ORDER BY created_date LIMIT 1
What was the attendance on October 6?
SELECT attendance FROM table_name_78 WHERE date = "october 6"
who wrote with original air date being september23,1995
SELECT written_by FROM table_14637853_3 WHERE original_air_date = "September23,1995"
Which airport has an IATA of AMS?
SELECT airport FROM table_name_39 WHERE iata = "ams"
What is the listed crowd at windy hill?
SELECT crowd FROM table_name_4 WHERE venue = "windy hill"
How many violent crimes occurred the year that the index was 191037?
SELECT violent FROM table_25271777_1 WHERE index = 191037
Name all salaried employee who are hired in 2007 and later.
SELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.HireDate) >= '2007' AND T2.SalariedFlag = 1
What town is Muscle Shoals High School located in?
SELECT hometown FROM table_11677691_10 WHERE school = "Muscle Shoals High school"
Find the name and account balance of the customer whose name includes the letter ‘a’.
SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%'
What is the total number of losses of the player that has drawn 1 and played smaller than 12?
SELECT COUNT(lost) FROM table_name_73 WHERE drawn = 1 AND played < 12
Who was the LMP2 winner when the LMP1 winning team was No. 20 Oryx Dyson Racing?
SELECT lmp2_winning_driver FROM table_27743641_2 WHERE lmp1_winning_team = "No. 20 Oryx Dyson Racing"
What is the type of store located in the city with the highest amount of water area?
SELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations`
List the name of artists who have released albums and mixtape from 1980 to 1985 in "dance" genre.
SELECT COUNT(T1.artist) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'dance' AND T1.groupYear BETWEEN 1980 AND 1985 AND T1.releaseType LIKE 'album' OR T1.releaseType LIKE 'mixtape'
What is the para with a 0.1% sipaliwini?
SELECT para FROM table_name_70 WHERE sipaliwini = "0.1%"
How many wins of average has cuts made less than 0?
SELECT AVG(wins) FROM table_name_79 WHERE cuts_made < 0
Name the country vijay singh is from
SELECT country FROM table_name_16 WHERE player = "vijay singh"
What is the most common type of weapon that causes death?
SELECT subject_weapon FROM incidents WHERE subject_statuses = 'Deceased' GROUP BY subject_weapon ORDER BY COUNT(case_number) DESC LIMIT 1
What was the record for May 26?
SELECT record FROM table_name_64 WHERE date = "may 26"
What are the ids of all reviewers who did not give 4 stars?
SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4
Among the listed winery, what is the street number of the winery named "Tulocay Winery"?
SELECT T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'Tulocay winery' AND T2.food_type = 'winery'
Find the type and weight of the youngest pet.
SELECT pettype, weight FROM pets ORDER BY pet_age LIMIT 1
How many reporters for the year 1993?
SELECT COUNT(reporters) FROM table_22514845_3 WHERE year = 1993
What are the weights of entrepreneurs in descending order of money requested?
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
When Naomi Owen won the Womens Singles and Ricardo Walther won the Mens Singles, who won the mixed veteran?
SELECT mixed_veteran FROM table_28211674_3 WHERE womens_singles = "Naomi Owen" AND mens_singles = "Ricardo Walther"
What is the highest attendance for the game after week 1 on November 12, 1961?
SELECT MAX(attendance) FROM table_name_27 WHERE week > 1 AND date = "november 12, 1961"
What is the total number of laps done by Massimo Roccoli when his grid was smaller than 4?
SELECT COUNT(laps) FROM table_name_45 WHERE rider = "massimo roccoli" AND grid < 4
How many u.s. viewers (million) have a series # 83?
SELECT us_viewers__millions_ FROM table_22570439_1 WHERE series__number = 83
Find the last name of female (Sex as F) students in the descending order of age.
SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC
What was the Original Canadian air-date for the episode directed by mark rydell?
SELECT original_canadian_air_date FROM table_name_25 WHERE director = "mark rydell"
what is the location of California State University-Bakersfield
SELECT location FROM campuses where campus = "California State University-Bakersfield"
Which Cover Model was featured on 8-03?
SELECT cover_model FROM table_name_8 WHERE date = "8-03"
Show all the buildings along with the number of faculty members the buildings have.
SELECT building , count(*) FROM Faculty GROUP BY building
How many gold medals does Henk Jan Zwolle have?
SELECT COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Henk Jan Zwolle' AND T4.medal_name = 'Gold'
Great! Can you tell me how many instances of role code "researcher" there are?
SELECT count ( * ) FROM Project_Staff where role_code = 'researcher'
What is the average of goals against, where overall goals are more than 35 and the goal difference is 20?
SELECT AVG(goals_against) FROM table_name_68 WHERE goals_for > 35 AND goal_difference = 20
What is the away team score of Melbourne?
SELECT away_team AS score FROM table_name_54 WHERE away_team = "melbourne"
What are the terminals for line 2?
SELECT terminals FROM table_1603807_2 WHERE line = "line 2"
Name the Report of tourist trophy?
SELECT report FROM table_name_77 WHERE name = "tourist trophy"
Which Affected area codes have an Effective date of august 30, 2014?
SELECT affected_area_codes FROM table_name_95 WHERE effective_date = "august 30, 2014"
How many current legislators chose Republican as their political party?
SELECT COUNT(*) FROM `current-terms` WHERE party = 'Republican'
What time was achieved on Saturday 29th August by the rider who recorded 23' 18.82 97.102mph on Tuesday 25th August?
SELECT sat_29_aug FROM table_23465864_4 WHERE tues_25_aug = "23' 18.82 97.102mph"
Name the most races
SELECT MAX(races) FROM table_21457754_2
Show the names of members and the location of performances they attended in ascending alphabetical order of their names.
SELECT T2.Name , T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID ORDER BY T2.Name ASC
What is the highest elevation of an airport in the country of Iceland?
SELECT max(elevation) FROM airports WHERE country = 'Iceland'
Name the league for paul paton
SELECT league FROM table_17598822_11 WHERE player = "Paul Paton"
what is the highest attendance for week 3?
SELECT MAX(attendance) FROM table_name_34 WHERE week = 3
What are the names of organizations that contain the word "Party"?
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
In the female customers, how many bought root beer that contains artificial sweetener?
SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.Gender = 'F' AND T4.ArtificialSweetener = 'TRUE'
How many venues are located at Centurion, South Africa?
SELECT COUNT(T1.Venue_name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id WHERE T3.country_name = 'South Africa' AND T2.city_name = 'Centurion'
Show the countries that have managers of age above 50 or below 46.
SELECT Country FROM manager WHERE Age > 50 OR Age < 46
Which cities have lower temperature in March than in July and have been once host cities?
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Hmm. Can you also give me his last name.
SELECT T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count ( * ) LIMIT 1
Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.
SELECT Amount_Settled, Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
List out years that only have summer games.
SELECT games_year FROM games WHERE season != 'Winter' GROUP BY games_year HAVING COUNT(season) = 1
How many activities does Mark Giuliano participate in?
SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
Give the color of the grape whose wine products have the highest average price?
SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
What is the total price charged for orders shipped by air without shipping instructions?
SELECT l_extendedprice * (1 - l_discount) * (1 + l_tax) AS totalprice FROM lineitem WHERE l_shipmode = 'AIR' AND l_shipinstruct = 'NONE'
What is the highest debut year for player Joe Youlden, with goals larger than 0?
SELECT MAX(debut_year) FROM table_name_56 WHERE player = "joe youlden" AND goals > 0
What is the most popular full name of the actors?
SELECT first_name , last_name FROM actor GROUP BY first_name , last_name ORDER BY count(*) DESC LIMIT 1
What is the total number of crimes that happened in Bridgeport with beat less than 1000?
SELECT SUM(CASE WHEN T2.beat < 1000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Bridgeport'
Among the universities with over 20000 students in 2011, how many of them have an international students percentage of over 25% in the same year?
SELECT COUNT(*) FROM university_year WHERE year = 2011 AND pct_international_students > 25 AND num_students > 20000
What is the ratio of male and female among the age of teenager when the education is above 10?
SELECT CAST(SUM(CASE WHEN SEX = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN SEX = 'Female' THEN 1 ELSE 0 END) FROM Customers WHERE age BETWEEN 13 AND 19 AND EDUCATIONNUM > 10