sentence
stringlengths
3
347
sql
stringlengths
18
804
What are the states or counties of the address of the stores with marketing region code "CA"?
SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA"
How many instrument does the musician with last name "Heilo" use?
SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo"
When did Geelong play as the home team?
SELECT date FROM table_name_65 WHERE home_team = "geelong"
What genres are the games published by 'Agatsuma Entertainment'?
SELECT T4.genre_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.publisher_name = 'Agatsuma Entertainment'
Which film was released in the year 2002?
SELECT film_name FROM table_name_63 WHERE year = 2002
what is the average bronze when the team is northwest territories and gold is more than 34?
SELECT AVG(bronze) FROM table_name_23 WHERE team = "northwest territories" AND gold > 34
What are the ids and first names of customers who do not hold a credit card?
SELECT customer_id , customer_first_name FROM Customers EXCEPT SELECT T1.customer_id , T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = "Credit"
Find the accreditation level that more than 3 phones use.
SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3
When 2010 is the year what is the game?
SELECT games FROM table_29743928_4 WHERE years = "2010"
What is title of album which track For Those About To Rock (We Salute You) belong to?
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "For Those About To Rock ( We Salute You ) "
What is the role code with the largest number of employees?
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
How may faculties in this survey?
select count ( * ) from Faculty
How many awards did the "Agony" win?
SELECT COUNT(T2.award) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner'
What is the value in 2008 when the value for Tournament is year?
SELECT 2008 FROM table_name_77 WHERE tournament = "year"
Name the date for result of eng by 23 runs
SELECT date FROM table_name_24 WHERE result = "eng by 23 runs"
Which Opened has a System of c-train, and a Daily ridership smaller than 269,600?
SELECT MAX(opened) FROM table_name_80 WHERE system = "c-train" AND daily_ridership < 269 OFFSET 600
Show the countries that have managers of age above 50 or below 46.
SELECT Country FROM manager WHERE Age > 50 OR Age < 46
Of all the orders placed and shipped throughout the year 2005, what percentage of those orders corresponds to customer number 186?
SELECT CAST(SUM(CASE WHEN customerNumber = 186 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(orderNumber) FROM orders WHERE status = 'Shipped' AND shippedDate BETWEEN '2005-01-01' AND '2005-12-31'
How many Points have a Game smaller than 37, and a Score of 2–3, and a December of 13?
SELECT COUNT(points) FROM table_name_98 WHERE game < 37 AND score = "2–3" AND december = 13
Which services type had both successful and failure event details?
SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
What competition took place in Berlin, Germany?
SELECT competition FROM table_name_47 WHERE venue = "berlin, germany"
What was the length for GT class at Portland International Raceway?
SELECT length FROM table_name_22 WHERE class = "gt" AND circuit = "portland international raceway"
What are the details of the lots which aren't used in any transactions?
SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id
WHAT DID HAWTHORN SCORE AT ITS AWAY GAME?
SELECT away_team AS score FROM table_name_50 WHERE away_team = "hawthorn"
List the names of mountains that do not have any climber.
SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber)
How many different players trained for more than 1000 hours?
SELECT count(*) FROM Player WHERE HS > 1000
Return the last name of the staff member who handled the complaint with the earliest date raised.
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
What is the name of the vendor that the project "Bloody Times" uses for their resources?
SELECT T3.vendor_name FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Bloody Times'
In 2014, what is the shortest duration of trips by subscribers which started at 2nd at Folsom and ended in the 5th at Howard stations, and by how much shorter than the average? Give me the minimum temperature, maximum gust speed and weather event on that trip.
SELECT MIN(T1.duration) , MIN(T1.duration) - AVG(T1.duration), T2.min_temperature_f FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_date = '1/1/2014 0:00' AND T1.end_date = '12/31/2014 11:59' AND T1.start_station_name = '2nd at Folsom' AND T1.end_station_name = '5th at Howard' AND T1.subscription_type = 'Subscriber'
How many distinct programs are broadcast at "Night" time?
SELECT count(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night'
When itogon, benguet is the city/municipality and 1st class is the income classification how many measurements of population in 2010?
SELECT COUNT(population__2010_) FROM table_29289372_1 WHERE income_classification = "1st Class" AND city_municipality = "Itogon, Benguet"
What is the col location for the location of france / italy?
SELECT col_location FROM table_2731431_1 WHERE location = "France / Italy"
what is the college for keenan robinson when overall is more than 102?
SELECT college FROM table_name_55 WHERE overall > 102 AND name = "keenan robinson"
who in that list is from canada?
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id OR T1.male_id = t2.people_id WHERE T1.year = 2016 AND t2.country = "Canada"
Which party has the 6th district?
SELECT party FROM table_name_49 WHERE district = "6th"
Awesome! Can you tell me what the date issued is for each of these two coupon_ids?
SELECT date_issued from discount_coupons where coupon_id in ( SELECT T1.coupon_id FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_id FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad' )
What year was the game at Bad Neuenahr Eppelborn?
SELECT year FROM table_name_30 WHERE venue = "bad neuenahr eppelborn"
Among students with low salary, how many of them have a gpa of 3.5?
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa = 3.5 AND T1.salary = 'low'
* I have left the chat *
select t1.name from browser as T1 join accelerator_compatible_browser as T2 on T1.id = T2.browser_id order by compatible_since_year asc limit 1
WHAT'S THE TIE NUMBER WITH AN AWAY TEAM OF WREXHAM?
SELECT tie_no FROM table_name_52 WHERE away_team = "wrexham"
Where was the tournament that happened in 1987 on a clay surface?
SELECT tournament FROM table_name_18 WHERE date = 1987 AND surface = "clay"
What is the highest average for a long less than 24, a GP-GS of 2-0, and less than 7 yards?
SELECT MAX(avg_g) FROM table_name_93 WHERE long < 24 AND gp_gs = "2-0" AND yards < 7
Find the distinct winery of wines having price between 50 and 100.
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
What is the name of the event that happened in the most recent year?
SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
How many distinct locations of perpetrators are there?
SELECT count(DISTINCT LOCATION) FROM perpetrator;
What is the average sales of the journals that have an editor whose work type is 'Photo'?
SELECT avg(T1.sales) FROM journal AS T1 JOIN journal_committee AS T2 ON T1.journal_ID = T2.journal_ID WHERE T2.work_type = 'Photo'
What is the relationship between object sample no.12 and no.8 of image no.2345511?
SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_ID = 8
Which Ties is the highest one that has Losses smaller than 9, and Starts of 26, and Wins smaller than 21?
SELECT MAX(ties) FROM table_name_65 WHERE losses < 9 AND starts = 26 AND wins < 21
Name the present share for australia
SELECT present_share FROM table_23195_5 WHERE producing_nation = "Australia"
What are the first name, last name and id of the player with the most all star game experiences? Also list the count.
SELECT T1.name_first , T1.name_last , T1.player_id , count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;
Which company has the lowest unit price? Please give the company name and the product name.
SELECT T2.CompanyName, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MIN(UnitPrice) FROM Products )
What is Syracuse, when Utica is Solsville Shale And Sandstone?
SELECT syracuse FROM table_name_51 WHERE utica = "solsville shale and sandstone"
What is the for the f136fb engine?
SELECT usage FROM table_name_98 WHERE engine = "f136fb"
what is the average when matches is less than 5 and wickets is more than 9?
SELECT average FROM table_name_26 WHERE matches < 5 AND wickets > 9
Please list the full names of any three inactive customers.
SELECT first_name, last_name FROM customer WHERE active = 0 LIMIT 3
Okay. What other countries are listed?
SELECT DISTINCT Country FROM member EXCEPT SELECT Country FROM member WHERE Country = "United States"
What is the instrumental for the dative shen?
SELECT instrumental FROM table_name_15 WHERE dative = "shen"
What are the names of musicals who have at 3 or more actors?
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*) >= 3
Which composer has a track length of 2:50?
SELECT composer_s_ FROM table_name_33 WHERE time = "2:50"
Tell me temperature for City ID 2 for Jan, Apr and Oct
SELECT Jan, Apr, Oct FROM temperature WHERE city_id = 2
Which date has china as the venue?
SELECT date FROM table_name_25 WHERE venue = "china"
What lots are associate with those transactions with a count smaller than 50? | Do you mean all the information about lots or some specific attributes? | What are all of the details about the lots?
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50
What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria?
SELECT COUNT(gold) FROM table_name_4 WHERE silver = 1 AND bronze = 1 AND nation = "austria"
Who was team 1 when team 2 was Young Africans?
SELECT team_1 FROM table_name_65 WHERE team_2 = "young africans"
Among the customers with a marital status of married-civ-spouse, list the number of inhabitants and age of those who are machine-op-inspct.
SELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 30
How many laps for a grid larger than 1 with a Time/Retired of halfshaft?
SELECT laps FROM table_name_31 WHERE grid > 1 AND time_retired = "halfshaft"
How many winners are there of farma?
SELECT COUNT(winners) FROM table_1053802_1 WHERE local_title = "Farma"
what is the name of the papers publishes by Indiana University
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Which Position has a Pick # smaller than 23, and a Player of garrett sutherland?
SELECT position FROM table_name_12 WHERE pick__number < 23 AND player = "garrett sutherland"
Show the names of all the clients with no booking.
SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID
What is the 2006-2007 points minimum is the team is Overmach Parma?
SELECT MIN(2006 AS _07_points) FROM table_23215145_2 WHERE team = "Overmach Parma"
What are the countries that have at least two perpetrators?
SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2
How many object samples in image no.1 are in the class of "man"?
SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1
What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SELECT count(*) , T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
What is the highest Goals Against, when Club is "Pontevedra CF", and when Played is less than 38?
SELECT MAX(goals_against) FROM table_name_74 WHERE club = "pontevedra cf" AND played < 38
What is the average teaching ability of the most popular professors?
SELECT CAST(SUM(teachingability) AS REAL) / COUNT(prof_id) FROM prof WHERE popularity = ( SELECT MAX(popularity) FROM prof )
How many for percentages are there when the against percentage is 35,782 (69)?
SELECT for___percentage_ FROM table_1289762_1 WHERE against___percentage_ = "35,782 (69)"
If the spectral type is g1v, what is the total distance amount?
SELECT COUNT(distance___ly__) FROM table_1820752_1 WHERE spectral_type = "G1V"
I am interested in learning who the artist is.
SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T1.Title = "Balls to the Wall"
What is the id and type code for the template used by the most documents?
SELECT T1.template_id, T2.Template_Type_Code FROM Documents AS T1 JOIN Templates AS T2 ON T1.template_id = T2.template_id GROUP BY T1.template_id ORDER BY COUNT(*) DESC LIMIT 1
What are the names and opening years of the three churches that opened the earliest?
SELECT name , open_date FROM church ORDER BY open_date Asc LIMIT 3
How many games have 5 goals and less than 8 assists?
SELECT COUNT(games) FROM table_name_20 WHERE goals = 5 AND assists < 8
In 2007 what category won?
SELECT category FROM table_name_62 WHERE result = "won" AND year < 2007
Which airlines have a flight with destination airport AHD?
SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid = T2.Airline WHERE T2.DestAirport = "AHD"
Which race happened in 1948?
SELECT race_title FROM table_name_26 WHERE year = 1948
Could you show me all the locations that have train stations with more than 25 total passengers?
SELECT DISTINCT LOCATION FROM station WHERE total_passengers > 25
What types of ships have both ships that have Panama Flags and Malta flags?
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
What is the name and address of the department with the most students?
SELECT T2.dept_name , T2.dept_address FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 1
Show the ids and names of all documents.
SELECT document_id , document_name FROM Documents
show the login name and password for registration id 2
select T1.login_name, T1.password from students AS T1 JOIN Student_Course_Enrolment AS T2 ON T2.student_id = T1.student_id WHERE registration_id = 2
Who is the Winner, when the Name is Ouninpohja 1?
SELECT winner FROM table_name_92 WHERE name = "ouninpohja 1"
When is the highest price of Terracoin?
SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Terracoin' ORDER BY T2.price DESC LIMIT 1
What is the description of the chapter with the longest number of paragraphs?
SELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id ORDER BY T1.ParagraphNum DESC LIMIT 1
When 0.6–1.4 is the b r (t) what is the h ci (ka/m)?
SELECT h_ci__ka_m_ FROM table_2282444_1 WHERE b_r__t_ = "0.6–1.4"
What is the lowest figure for her age when the year of marriage is before 1853, the number of children is less than 8, and the bride was Eliza Maria Partridge?
SELECT MIN(her_age) FROM table_name_60 WHERE year_of_marriage < 1853 AND _number_of_children < 8 AND name = "eliza maria partridge"
Which cities are they from?
SELECT city FROM employees
What was the Result in Green Lane with Kirkburton as the Runner-up?
SELECT result FROM table_name_94 WHERE runner_up = "kirkburton" AND final_venue = "green lane"
Return the codes of countries for which Spanish is the predominantly spoken language.
SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode
what are all the overall with rating being 1.4
SELECT overall FROM table_13110459_2 WHERE rating = "1.4"
Calculate the order percentage by "Carlos Miller" sales team.
SELECT CAST(SUM(CASE WHEN T2.`Sales Team` = 'Carlos Miller' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID