sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Please list the categories of the Yelp_Business that closes at 12PM on Sundays. | SELECT T4.category_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T4.category_id = T4.category_id WHERE T1.closing_time = '12PM' AND T2.day_of_week = 'Sunday' GROUP BY T4.category_name |
Which Gain is the lowest one that has a Loss larger than 2, and an Avg/G larger than -6, and a Name of sheehan, tyler, and a Long larger than 11? | SELECT MIN(gain) FROM table_name_84 WHERE loss > 2 AND avg_g > -6 AND name = "sheehan, tyler" AND long > 11 |
What was the away team that played at Corio Oval? | SELECT away_team FROM table_name_9 WHERE venue = "corio oval" |
What was the date of the game when the record of the series was 0–1? | SELECT date FROM table_name_10 WHERE series = "0–1" |
How many students got accepted after the tryout? | SELECT COUNT(*) FROM tryout WHERE decision = 'yes' |
How many tariff codes have a bts retail price of 2.553p/min? | SELECT COUNT(tariff_code) FROM table_10408617_5 WHERE bts_retail_price__regulated_ = "2.553p/min" |
What is total number of show times per dat for each cinema? | SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id |
Which Date has a Remainder of 20%? | SELECT date FROM table_name_21 WHERE remainder = "20%" |
Which Competition has a Year larger than 2000? | SELECT competition FROM table_name_45 WHERE year > 2000 |
How many drivers did not participate in the races held in 2009? | SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 ) |
Count the number of companies. | SELECT count(*) FROM Companies |
Which sport has most number of students on scholarship? | SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1 |
Show all the distinct districts for elections. | SELECT DISTINCT District FROM election |
Show the minimum, average, and maximum age of all students. | SELECT MIN(age), AVG(age), MAX(age) FROM Student |
When did essendon play away? | SELECT date FROM table_name_53 WHERE away_team = "essendon" |
What are their names? | SELECT name FROM airports WHERE country = 'United States' GROUP BY city HAVING count ( * ) > 4 |
Please list the indicator names belonging to Education: Inputs topic in 2000. | SELECT DISTINCT T2.IndicatorName FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year = 'YR2000' AND T2.Topic = 'Education: Inputs' |
What are the document dates of all documents with the document type code "BK"? | SELECT T2.Document_Date FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.Document_Type_Code = "BK" |
What percentage of restaurants in Monterey County have Mexican food? | SELECT CAST(SUM(IIF(T2.food_type = 'mexican', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'monterey county' |
Name the minister for end date of 31 july 2004 | SELECT minister FROM table_name_12 WHERE end_date = "31 july 2004" |
Find all the distinct district names ordered by city area in descending. | SELECT DISTINCT District_name FROM district ORDER BY city_area DESC |
Name the chassis for tyre of g and carlos reutemann | SELECT chassis FROM table_name_24 WHERE tyre = "g" AND driver = "carlos reutemann" |
What venue featured the home side of st kilda? | SELECT venue FROM table_name_67 WHERE home_team = "st kilda" |
Who were the candidates in the district won by the incumbent Del Latta? | SELECT candidates FROM table_1341690_35 WHERE incumbent = "Del Latta" |
What is the name and marketing segment of the customer with the total order price of 199180.63? | SELECT T2.c_name, T2.c_mktsegment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 199180.63 |
Which wood has stabilizing earth? | SELECT wood FROM table_name_50 WHERE earth = "stabilizing" |
What is the medium through which most complaints are registered in Florida? | SELECT T3.`Submitted via` FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.state = 'FL' GROUP BY T1.`Complaint ID` ORDER BY COUNT(T1.`Complaint ID`) DESC LIMIT 1 |
Name the city with july of 88 °f / 31.1 °c | SELECT city FROM table_name_74 WHERE jul = "88 °f / 31.1 °c" |
Reported Offenses larger than 216, and a U.S. Rate smaller than 3274, and a Texas Rate smaller than 2688.9, and a Crime of violent crime has what killeen rate? | SELECT SUM(killeen_rate) FROM table_name_8 WHERE reported_offenses > 216 AND us_rate < 3274 AND texas_rate < 2688.9 AND crime = "violent crime" |
What was the lowest number of wins for the team that scored more than 14 points and had a position of 7? | SELECT MIN(wins) FROM table_name_78 WHERE position = 7 AND scored > 14 |
What is the long title of the work with the highest number of scenes in act 1? | SELECT T2.LongTitle FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T1.Act = 1 ORDER BY T1.Scene DESC LIMIT 1 |
What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id? | SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id |
What is the competition before the 1930 season, and a winning draw? | SELECT competition_round_[d_] FROM table_name_75 WHERE season < 1930 AND winner = "draw" |
Name the laps for suzuki and time/retired of +1:02.804 | SELECT laps FROM table_name_92 WHERE manufacturer = "suzuki" AND time_retired = "+1:02.804" |
What is the description where the date is 1911? | SELECT description FROM table_name_58 WHERE date = 1911 |
Which Year has a Result smaller than 20.26, and a Location of eugene? | SELECT SUM(year) FROM table_name_80 WHERE result < 20.26 AND location = "eugene" |
That's a big list, thank you. Then could you please exclude Central Coast area from them? | SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast" |
What is the series number when al horford (10) had the high rebounds? | SELECT series FROM table_27734577_13 WHERE high_rebounds = "Al Horford (10)" |
What order did Lambert perform in the top 11? | SELECT order__number FROM table_21501511_1 WHERE week__number = "Top 11" |
What is the Cuchumela Municipality minimum? | SELECT MIN(cuchumuela_municipality) FROM table_2509112_3 |
What is the highest number of divisions mentioned? | SELECT MAX(division) FROM table_21602734_1 |
what is the swimsuit score when the interview score is 8.626 (5)? | SELECT swimsuit FROM table_name_19 WHERE interview = "8.626 (5)" |
with api level of 18, what's the code name? | SELECT code_name FROM table_name_71 WHERE api_level = 18 |
Show first name and id for all customers with at least 2 accounts. | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 |
What are the details of the project with no outcomes? | SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes ) |
What is all the information regarding employees who are managers? | SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id |
How many laps did Emerson Fittipaldi do on a grid larger than 14, and when was the Time/Retired of accident? | SELECT COUNT(laps) FROM table_name_98 WHERE grid > 14 AND time_retired = "accident" AND driver = "emerson fittipaldi" |
How many votes were tallied with a % of national vote of 13.11, and over 39 candidates nominated? | SELECT COUNT(votes) FROM table_name_72 WHERE _percentage_of_national_vote = 13.11 AND candidates_nominated > 39 |
On which date was the Winning score –5 (70-65-69-75=279)? | SELECT date FROM table_name_92 WHERE winning_score = –5(70 - 65 - 69 - 75 = 279) |
What was Olga Govortsova's outcome when she played on a grass surface? | SELECT outcome FROM table_name_59 WHERE surface = "grass" |
What is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”? | SELECT T2.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e' |
and Camylle? | Do you mean the zip postcode in the area where the person with first name Camylle lived? | Yes | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Camylle" |
What is the language, when "house" is "balay", when "three" is "tatlo", and when "four" is "apat"? | SELECT english FROM table_name_52 WHERE house = "balay" AND three = "tatlo" AND four = "apat" |
How many opponents were there when the record was 6-0? | SELECT date FROM table_21197135_1 WHERE record = "6-0" |
How many totals have a Player of ahmad fouzee masuri, and an FA Cup larger than 0? | SELECT COUNT(total) FROM table_name_37 WHERE player = "ahmad fouzee masuri" AND fa_cup > 0 |
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS. | SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"; |
Among the releases with the tag "1980s", which one of them is the most downloaded? Please give its title. | SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s' ORDER BY T1.totalSnatched DESC LIMIT 1 |
Find the delegates who are from counties with population below 100000. | SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000 |
Which Barrel twist has a Stock of canadian 3rd generation and a Hand guards of short ribbed? | SELECT barrel_twist FROM table_name_33 WHERE stock = "canadian 3rd generation" AND hand_guards = "short ribbed" |
Count the number of postal points under New York-Newark-Jersey City, NY-NJ-PA. | SELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA' |
What is the rank of the airport with the BKK/VTBS code? | SELECT rank FROM table_name_60 WHERE code__iata_icao_ = "bkk/vtbs" |
what is the average of rates? | SELECT avg ( Rate ) FROM Reservations |
What was the loss of the game when the record was 14–8? | SELECT loss FROM table_name_90 WHERE record = "14–8" |
Which Kickoff (ET) has a Result of w 34–23? | SELECT kickoff__et_ FROM table_name_67 WHERE result = "w 34–23" |
Which Venue has a Competition of european championships, and a Position of 7th? | SELECT venue FROM table_name_22 WHERE competition = "european championships" AND position = "7th" |
Which year experienced the most rain? | SELECT SUBSTR(CAST(date AS TEXT), -4) FROM weather GROUP BY SUBSTR(CAST(date AS TEXT), -4) ORDER BY SUM(CASE WHEN events LIKE '%Rain%' OR events LIKE '%rain%' THEN 1 ELSE 0 END) DESC LIMIT 1 |
What is 2012, when 2009 is "A"? | SELECT 2012 FROM table_name_44 WHERE 2009 = "a" |
What is the sum of laps for Derek Warwick? | SELECT SUM(laps) FROM table_name_20 WHERE driver = "derek warwick" |
What is the total time of the vehicle having a navigator of Vandenberg? | SELECT total_time FROM table_name_79 WHERE navigator = "vandenberg" |
Name the class aaaa for menard | SELECT class_aAAA FROM table_14630796_1 WHERE class_a = "Menard" |
What is the Player that has a To standard of –7? | SELECT player FROM table_name_47 WHERE to_par = "–7" |
Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance. | SELECT T1.name , T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance |
Name all products and total quantity for each item for shopping cart ID 14951. | SELECT T1.Name, T2.Quantity FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 14951 |
What car had the fewest laps with a qual of 138.750? | SELECT MIN(laps) FROM table_name_16 WHERE qual = "138.750" |
Can i have the city code of all members of the tennis club | SELECT t3.city_code 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" |
what's the width with frame size being 4.5k | SELECT width FROM table_1251878_1 WHERE frame_size = "4.5K" |
Which campus has the most degrees conferred in all times? | SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1 |
Who is the winning driver of the Oschersleben circuit with Timo Scheider as the pole position? | SELECT winning_driver FROM table_name_36 WHERE pole_position = "timo scheider" AND circuit = "oschersleben" |
Where is the college where Keith Hartwig plays? | SELECT college FROM table_10361625_1 WHERE player_name = "Keith Hartwig" |
Which Genre has an English title (Chinese title) of the romance of the white hair maiden 白髮魔女傳? | SELECT genre FROM table_name_92 WHERE english_title__chinese_title_ = "the romance of the white hair maiden 白髮魔女傳" |
What are the full names and hire dates for employees in the same department as someone with the first name Clara, not including Clara? | SELECT first_name , last_name , hire_date FROM employees WHERE department_id = ( SELECT department_id FROM employees WHERE first_name = "Clara") AND first_name != "Clara" |
What are the name and phone of the customer with the most ordered product quantity? | SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1 |
What are the id of students who registered course 301? | SELECT student_id FROM student_course_attendance WHERE course_id = 301 |
list the card number of all members whose hometown address includes word "Kentucky". | SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%" |
Can you show the artist name of f id 2? | SELECT artist_name FROM files WHERE f_id = '2' |
What about the lowest student capacity? | SELECT dorm_name FROM dorm order by student_capacity asc limit 1 |
What are the name of the players who received a card in descending order of the hours of training? | SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC |
What is the name of the customer who has made the minimum amount of payment in one claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT MIN(amount_piad) FROM claim_headers) |
What are the addresses of the course authors who teach either "operating system" or "data structure" course. | SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure" |
What are the member ids of the people who have that membership level? | select member_id from member where level in ( SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY count ( * ) ASC LIMIT 1 ) |
Provide the territory IDs under employee ID of 7. | SELECT TerritoryID FROM EmployeeTerritories WHERE EmployeeID = 7 |
How many teachers in this table? | SELECT count ( * ) from teachers |
how many times was it the district illinois 18? | SELECT COUNT(candidates) FROM table_1341718_14 WHERE district = "Illinois 18" |
Which country is Scott McCarron from? | SELECT country FROM table_name_90 WHERE player = "scott mccarron" |
what is the speed of Dauling Dragon | SELECT speed from roller_coaster where name = "Dauling Dragon" |
What were the number of deputies for the 1964 election year? | SELECT number_of_deputies FROM table_name_44 WHERE election_date = 1964 |
Which position has the highest amount of poor performing employees? | SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1 |
What was the South Asian population in Nova Scotia in 2001? | SELECT south_asians_2001 FROM table_1717824_1 WHERE province = "Nova Scotia" |
Could you filter this same list to list only the Headquarter countries that have more than one company in them? | SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT ( * ) > = 2 |
and can you tell me the names of those 5 products? | SELECT product_name FROM Products WHERE Product_ID NOT IN ( SELECT Product_ID FROM Products_in_Events ) |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.