sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What state was the president who was elected earlier than 1848 born in? | SELECT birth_state FROM table_name_43 WHERE election_year < 1848 |
What is the description of the claim status "Open"? | SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = "Open" |
Show names for all regions except for Denmark. | SELECT region_name FROM region WHERE region_name != 'Denmark'; |
What is the last name and office of the professor from the history department? | SELECT T1.emp_lname , T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T2.dept_code = T3.dept_code WHERE T3.dept_name = 'History' |
List the names of customers who have once canceled the purchase of the product "food" (the item status is "Cancel"). | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = "Cancel" AND T4.product_name = "food" GROUP BY T1.customer_id HAVING count(*) >= 1 |
What is the total home game attendance of team Boston Red Stockings from 2000 to 2010? | SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010; |
Show the average price of hotels for different pet policy. | SELECT pets_allowed_yn , avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn |
Show names of people whose nationality is not "Russia". | SELECT Name FROM people WHERE Nationality <> "Russia" |
What Partner had a Score of 6–3, 2–6, 6–3? | SELECT partner FROM table_name_31 WHERE score = "6–3, 2–6, 6–3" |
how many students have a food allergy? | SELECT count ( * ) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" |
Team with average of 1.035? | SELECT team FROM table_name_79 WHERE average = 1.035 |
What is the largest weight that appears in the people table? | SELECT weight from people order by weight desc limit 1 |
What is TV Time, when Date is December 22, 1996? | SELECT tv_time FROM table_name_91 WHERE date = "december 22, 1996" |
What is the height of the player who is from Huntington, WV? | SELECT height FROM table_name_93 WHERE hometown = "huntington, wv" |
Show the names of phones with carrier either "Sprint" or "TMobile". | SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile" |
Find out the first name and last name of staff living in city Damianfort. | SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"; |
Name the least population 1.1.2008 with population per square km of 1.957 and population 1.1.2006 less than 12.67 | SELECT MIN(population_112008) FROM table_name_62 WHERE population_per_square_km = 1.957 AND population_112006 < 12.67 |
Which Host Team has Final Score of 42-23? | SELECT host_team FROM table_name_86 WHERE final_score = "42-23" |
What's the class when the identifier is cbf-fm-14? | SELECT class FROM table_name_94 WHERE identifier = "cbf-fm-14" |
How many video game publishers have Interactive in their names? | SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%' |
What is the premium associated with tariff code g9? | SELECT approx_premium FROM table_10408617_5 WHERE tariff_code = "g9" |
What Away team is visiting Carlton? | SELECT away_team FROM table_name_27 WHERE home_team = "carlton" |
What is the human development index for the year 2000 where the ingei code is 10? | SELECT human_development_index__2000_ FROM table_1480455_1 WHERE inegi_code = 10 |
What is 2012, when Tournament is "French Open"? | SELECT 2012 FROM table_name_55 WHERE tournament = "french open" |
How many male employees do not wish to receive e-mail promotion? | SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 0 AND T1.Gender = 'M' |
What are the first name and major of the students who are able to consume soy? | SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") |
Who was the visiting team when Winnipeg was the home team? | SELECT visitor FROM table_name_33 WHERE home = "winnipeg" |
How many papers have "Atsushi Ohori" published? | SELECT count(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori" |
How about their e-mail addresses? | SELECT T1.email FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5 |
What are the names of the contestants whose names are not 'Jessie Alloway' | SELECT contestant_name FROM contestants WHERE contestant_name <> 'Jessie Alloway' |
Add another column showing the shipping agent name | SELECT T1.shipping_agent_code, T1.shipping_agent_name, count ( * ) FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T2.shipping_agent_code = T1.shipping_agent_code group by T2.shipping_agent_code |
What track name had Terry Tamm as the soloist? | SELECT track FROM table_28715942_3 WHERE soloist_s_ = "Terry Tamm" |
What is the total number of Lost, when Played is less than 34? | SELECT COUNT(lost) FROM table_name_91 WHERE played < 34 |
NJame the total number of population for towns/villages for 217 | SELECT COUNT(population) FROM table_16278825_1 WHERE towns__villages = 217 |
Name the Production Number with a Director of friz freleng, and a Title of wacky worm, the? | SELECT production_number FROM table_name_52 WHERE director = "friz freleng" AND title = "wacky worm, the" |
Which Year has the Orginal title of La Cérémonie? | SELECT year FROM table_name_13 WHERE original_title = "la cérémonie" |
List down the district's commander associated with the crime that happened at the yard and has a beat of 532. | SELECT T2.address, T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.location_description = 'YARD' AND T1.beat = 532 |
What is the catalogue number for Brazil? | SELECT catalogue__number FROM table_name_8 WHERE country = "brazil" |
Calculate the percentage of business which opened on Sunday from 9AM to 9PM based on the number of business opened on Sunday. | SELECT CAST(SUM(CASE WHEN T2.opening_time = '9AM' AND T2.closing_time = '9PM' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.day_id) FROM Days AS T1 INNER JOIN Business_Hours AS T2 ON T1.day_id = T2.day_id WHERE T1.day_of_week = 'Sunday' |
Which player from Scotland has a To Par score of +7? | SELECT player FROM table_name_50 WHERE to_par = "+7" AND country = "scotland" |
Which opponent is friendly and played on 15-08-2012? | SELECT opponent FROM table_name_38 WHERE competition = "friendly" AND date = "15-08-2012" |
What is the Time with an Away that is broadview hawks? | SELECT time FROM table_name_91 WHERE away = "broadview hawks" |
Who was the opposing team during the game in Zagreb? | SELECT opponent FROM table_name_80 WHERE city = "zagreb" |
What are the first names of the professors who do not teach a class. | SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num = T2.prof_num |
what was the car grade? | SELECT Grade FROM list where LastName = 'CAR' |
List all orders where its products were shipped from Daly City. | SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`City Name` = 'Daly City' THEN T1.OrderNumber END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL |
Who was the winning pitcher on june 25? | SELECT winning_pitcher FROM table_12125069_2 WHERE date = "June 25" |
How many sections does course ACCT-211 has? | SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211' |
Which Round has a Club team of brandon wheat kings (whl)? | SELECT round FROM table_name_92 WHERE club_team = "brandon wheat kings (whl)" |
Which Record has a Method of submission (heel hook), a Round larger than 1, and a Time of 2:28? | SELECT record FROM table_name_32 WHERE method = "submission (heel hook)" AND round > 1 AND time = "2:28" |
What is the party of the governor under Hugh Thomas Miller. | SELECT governor FROM table_name_4 WHERE name = "hugh thomas miller" |
What is the title of the episode with the most nominations? | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' GROUP BY T2.episode_id ORDER BY COUNT(T1.result) DESC LIMIT 1 |
How many main actors are there in the movie Pirates of the Caribbean: At World's End? | SELECT COUNT(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' AND T2.cast_order = ( SELECT MIN(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' ) |
What is the Shift start time for Shift ID No.2? | SELECT StartTime FROM Shift WHERE ShiftID = '2' |
What is the least september 1943 when late 1943 is 78000 | SELECT MIN(sept_1943) FROM table_1115992_1 WHERE late_1943 = 78000 |
What was the team that scored 122 points? | SELECT team FROM table_17968274_2 WHERE points = 122 |
What date sent has cancer as the constellation? | SELECT date_sent FROM table_name_29 WHERE constellation = "cancer" |
What are the states with the most invoices? | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; |
How many distinct FDA approval statuses are there for the medicines? | SELECT count(DISTINCT FDA_approved) FROM medicine |
Who is the lowest ranked player from the United States that has less than 3 Wins? | SELECT MIN(rank) FROM table_name_59 WHERE country = "united states" AND wins < 3 |
Calculate the total price of products purchased by Adam. | SELECT SUM(T3.Price * T2.quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Adam' |
Give me the name of the customer who ordered the most items in total. | SELECT t1.customer_name 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 t1.customer_name ORDER BY sum(t3.order_quantity) DESC LIMIT 1 |
How many members of club "Bootup Baltimore" are younger than 18? | SELECT count(*) 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 = "Bootup Baltimore" AND t3.age < 18 |
Which students not enrolled in any course? Find their personal names. | SELECT personal_name FROM Students EXCEPT SELECT T1.personal_name FROM Students AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.student_id = T2.student_id |
Which building is the highest? | SELECT name FROM buildings ORDER BY Height DESC LIMIT 1 |
Who was the winner for the Winton Motor Raceway circuit? | SELECT winner FROM table_name_51 WHERE circuit = "winton motor raceway" |
How many members of "Bootup Baltimore" are older than 18? | SELECT count(*) 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 = "Bootup Baltimore" AND t3.age > 18 |
What are the numbers of constructors for different nationalities? | SELECT count(*) , nationality FROM constructors GROUP BY nationality |
Return the flag that is most common among all ships. | SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1 |
Show the ids of all employees who don't destroy any document. | SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed |
and can you tell me if OU is the college with the largest size? | SELECT cName FROM college ORDER BY enr DESC LIMIT 1 |
What is the distance of the race at the Atlanta Motor Speedway? | SELECT distance FROM table_name_48 WHERE venue = "atlanta motor speedway" |
What are the names of students who have no friends? | SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id |
What the number of matches when the BBI is 3/27? | SELECT MIN(matches) FROM table_28846752_9 WHERE bbi = "3/27" |
What is the lowest round of Ed Smith, who had a pick lower than 19? | SELECT MIN(round) FROM table_name_29 WHERE player = "ed smith" AND pick > 19 |
On how many days in October was the score 6-1? | SELECT COUNT(october) FROM table_27537870_3 WHERE score = "6-1" |
What is the overall number for Louisiana Tech college, and a pick more than 10? | SELECT SUM(overall) FROM table_name_59 WHERE college = "louisiana tech" AND pick__number > 10 |
List the name of employees who had left the company? When were they hired? | SELECT T1.FirstName, T1.LastName, T2.HireDate FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.EndDate IS NOT NULL |
What ws the method of resolution for the fight against joe kielur? | SELECT method FROM table_name_35 WHERE opponent = "joe kielur" |
What is the theme and artist name for the exhibition with a ticket price higher than the average? | SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT avg(ticket_price) FROM exhibition) |
Select the average price of each manufacturer's products, showing only the manufacturer's code. | SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer |
What are the awards won by the coach who coached the team with the most number of victories of all time? Indicate the choach ID. | SELECT DISTINCT T2.coachID, T1.award FROM AwardsCoaches AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID GROUP BY T2.coachID, T1.award ORDER BY SUM(T2.w) DESC LIMIT 1 |
Which Home team has an Away team of everton? | SELECT home_team FROM table_name_57 WHERE away_team = "everton" |
What is the lowest enrolled school that was founded in 1992 and joined a conference before 1998? | SELECT MIN(enrollment) FROM table_name_19 WHERE founded = "1992" AND joined_conference < 1998 |
what is the country when the bie recognised is no and years(s) is 2014? | SELECT country FROM table_name_83 WHERE bie_recognised = "no" AND year_s_ = "2014" |
What is the share of votes in the 2000 (2nd) election? | SELECT share_of_votes FROM table_name_20 WHERE election = "2000 (2nd)" |
What is the name of the plaza where the toll for heavy vehicles with 2 axles is r87.00? | SELECT name FROM table_1211545_2 WHERE heavy_vehicle__2_axles_ = "R87.00" |
What date was the game played on the hard surface at the Tournament of Sweden f2? | SELECT date FROM table_name_77 WHERE surface = "hard" AND tournament = "sweden f2" |
What is the average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8? | SELECT AVG(wickets) FROM table_name_24 WHERE overs > 44 AND player = "danish kaneria" AND average > 13.8 |
Which Laps have a Time/Retired of + 4 laps, and a Grid larger than 18? | SELECT AVG(laps) FROM table_name_72 WHERE time_retired = "+ 4 laps" AND grid > 18 |
Which publisher published the most games? | SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t |
What is the average February that has 56 as the game? | SELECT AVG(february) FROM table_name_77 WHERE game = 56 |
What is the lowest number of attempts for the player with a rank number larger than 3, who started after 1984 and had less than 6.1 yds/att? | SELECT MIN(attempts) FROM table_name_57 WHERE rank > 3 AND start > 1984 AND yds_att < 6.1 |
Who are the customers that Steve supports? | This is the information for all the customers that Steve Johnson supports | How many customers does he support? | SELECT count ( * ) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson" |
Show the country where people older than 30 and younger than 25 are from. | SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30 |
What's the part 4 for the verb whose part 3 is borgen? | SELECT part_4 FROM table_1745843_7 WHERE part_3 = "borgen" |
Give the full address of the office of the highest paid manager. | SELECT T2.address FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' ORDER BY T1.salary DESC LIMIT 1 |
What is the rank of Israel? | SELECT MAX(rank) FROM table_name_97 WHERE country = "israel" |
What nationality has a ranking less than 7 with tony stenson as the name? | SELECT nationality FROM table_name_13 WHERE ranking < 7 AND name = "tony stenson" |
How many leagues are there in England? | SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.