sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
When Baltimore County, Howard are represented, what's the first elected when the committee is environmental matters (vice-chair)? | SELECT MAX(first_elected) FROM table_name_37 WHERE counties_represented = "baltimore county, howard" AND committee = "environmental matters (vice-chair)" |
the quartier menpenti has how many 40-59 year olds? | SELECT _percentage_40_59_years FROM table_29615165_5 WHERE quartier = "Menpenti" |
Give the duration of the film starred by Nick Wahlberg with the highest rental rate. | SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1 |
What CFL Team is Pascal Masson on? | SELECT cfl_team FROM table_name_76 WHERE player = "pascal masson" |
What is maximum, minimum and average amount of outstanding of customer? | SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers; |
How many accounts do we have? | SELECT COUNT(*) FROM Accounts |
Find the busiest source airport that runs most number of routes in China. | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 |
What is the name of the player when the Score was 72-73-67-72=284? | SELECT player FROM table_name_10 WHERE score = 72 - 73 - 67 - 72 = 284 |
On what date was the time of 16:24.12 achieved? | SELECT date FROM table_name_36 WHERE time = "16:24.12" |
Show the names of journalists and the dates of the events they reported. | SELECT T3.Name , T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID |
What city does the employee who helps the customer with postal code 70174 live in? | SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId WHERE T1.PostalCode = "70174" |
What was the score for the game that kicked off at 6:00 p.m.? | SELECT final_score FROM table_24918268_2 WHERE kickoff = "6:00 p.m." |
Please list the awards won by coaches who taught the NHL League and have already died. | SELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.lgID = 'NHL' |
What was the broadcaste date for the episode with a run time of 24:44? | SELECT broadcast_date FROM table_name_60 WHERE run_time = "24:44" |
How many professors do have a Ph.D. degree? | SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' |
Find the ids of the problems reported after 1978-06-26. | SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26" |
What are the names of those dorms? | SELECT dorm_name FROM dorm |
Which nominations was the film 27 Stolen Kisses nominated for? | SELECT nomination FROM table_10236830_6 WHERE film_name = "27 Stolen Kisses" |
what ship is steered by a captain with lieutenant rank? | do you want to return the names of these ships? | yes | SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant' |
What is the average salary for employees from ID 1 to 9? | SELECT AVG(Salary) FROM Employees WHERE EmployeeID BETWEEN 1 AND 9 |
Which club has 16 league goals for a total of 20? | SELECT club FROM table_name_2 WHERE league_goals = "16" AND total = 20 |
What beer has a record of 4.08? | SELECT beer FROM table_name_67 WHERE recorded = 4.08 |
How many routes have a source airport in Canada and a destination airport in the United States, please? | select count ( * ) from ( SELECT rid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'United States' intersect SELECT rid FROM airports AS T3 JOIN routes AS T4 ON T3.apid = T4.src_apid WHERE T3.country = 'Canada' ) |
what is the total number of tackles when fumr is 0, totaltk is 54 and yards is less than 0? | SELECT COUNT(tackles) FROM table_name_21 WHERE fumr = 0 AND totaltk = 54 AND yards < 0 |
List the name of the school with the smallest enrollment. | SELECT school_name FROM school ORDER BY enrollment LIMIT 1 |
What is the stocked quantity of products manufactured from location ID 40? | SELECT COUNT(*) FROM WorkOrderRouting AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.LocationID = T2.ProductAssemblyID INNER JOIN WorkOrder AS T3 ON T3.WorkOrderID = T1.WorkOrderID WHERE T1.LocationID = 40 |
Show all product names and the number of order items on each product. | SELECT T2.product_name , count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name |
What engine does Chip Mead of Parts Washer Service use? | SELECT engine FROM table_name_36 WHERE team = "parts washer service" AND drivers = "chip mead" |
What candidates ran in the election that included john shelley? | SELECT candidates FROM table_1341973_6 WHERE incumbent = "John Shelley" |
Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000. | SELECT T2.Desert FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country WHERE T1.Area > 100000 AND T1.Population < 500000 |
What was the date of the game after week 5 with 62,262 fans attending? | SELECT date FROM table_name_82 WHERE week > 5 AND attendance = "62,262" |
How many tries for does waunarlwydd rfc have ? | SELECT tries_for FROM table_name_2 WHERE club = "waunarlwydd rfc" |
In Tie #18, who was the away team? | SELECT away_team FROM table_name_76 WHERE tie_no = "18" |
Show the names of all the donors except those whose donation amount less than 9. | SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9 |
Which Segment B has a Segment D of stone wool insulation? | SELECT segment_b FROM table_name_92 WHERE segment_d = "stone wool insulation" |
Among the papers with conference ID of 0, list down the authors of papers with a journal ID less than 100. | SELECT DISTINCT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.ConferenceId = 0 AND T1.JournalId < 100 |
What is the total if 44 is tosses/pyramids? | SELECT total FROM table_22014431_3 WHERE tosses_pyramids = "44" |
Which country became independent on 1492-01-01? Give the full name of the country. | SELECT T1.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1492-01-01' |
I want to know the team that was sacked and date of vacancy was 4 december | SELECT team FROM table_name_68 WHERE manner_of_departure = "sacked" AND date_of_vacancy = "4 december" |
What year did the IFG Club form? | SELECT T1.start_year FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T1.name = "IFG" |
How many male students join more than one organization? | SELECT COUNT(T.a) FROM ( SELECT COUNT(DISTINCT T1.name) AS a, COUNT(T2.organ) AS num FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num > 1 |
Find the first names of teachers whose email address contains the word "man". | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' |
What is the lowest wins that has a year prior to 1999, with draws greater than 1, and points greater than 17? | SELECT MIN(wins) FROM table_name_11 WHERE year < 1999 AND draws > 1 AND points > 17 |
How many regions had an incarceration rate for females of 63? | SELECT COUNT(incarceration_rate_total) FROM table_25042332_31 WHERE incarceration_rate_female = 63 |
What is the total number of people who has no friend living in the city of Austin. | SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin') |
Which event in the 2008 Beijing Games had a bronze medal? | SELECT event FROM table_name_34 WHERE games = "2008 beijing" AND medal = "bronze" |
Find id of the candidate whose email is [email protected]? | SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "[email protected]" |
What attendance has Washington redskins as the opponent? | SELECT attendance FROM table_name_89 WHERE opponent = "washington redskins" |
List out the name of products which have been applied 10% discount. | SELECT T FROM ( SELECT DISTINCT IIF(T1.`Discount Applied` = 0.1, T2.`Product Name`, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL |
How many seasons have motopark team? | SELECT COUNT(season) FROM table_23338693_1 WHERE team = "Motopark" |
What campuses were opened between 1935 and 1939? | SELECT campus FROM campuses WHERE YEAR > = 1935 AND YEAR < = 1939 |
How many different product types are there? | SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire |
Which television service has italian for its language? | SELECT television_service FROM table_name_46 WHERE language = "italian" |
What was the event on Wed 26 Aug where rider is Andrew Farrell 400cc Kawasaki? | SELECT wed_26_aug FROM table_23465864_6 WHERE rider = "Andrew Farrell 400cc Kawasaki" |
Find the room number of the rooms which can sit 50 to 100 students and their buildings. | SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 |
What is id of the city that hosted events in the most recent year? | SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1 |
What is the average react of athlete muna lee, who is ranked greater than 3? | SELECT AVG(react) FROM table_name_4 WHERE athlete = "muna lee" AND rank > 3 |
Find the day in which the difference between the max temperature and min temperature was the smallest. Also report the difference. | SELECT date , max_temperature_f - min_temperature_f FROM weather ORDER BY max_temperature_f - min_temperature_f LIMIT 1 |
Where was the order No. 10383 shipped to? Show me the address. | SELECT t2.addressLine1, t2.addressLine2 FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10383' |
With foreign banks as the bank type, and on-site ATMS less than 218, what is the average off-site ATMs? | SELECT AVG(off_site_atms) FROM table_name_66 WHERE bank_type = "foreign banks" AND on_site_atms < 218 |
What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns? | SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS' |
What are the different region names, ordered by labels? | SELECT DISTINCT region_name FROM region ORDER BY Label |
What is the Time of the Athlete with a Reaction time of 0.164? | SELECT SUM(time) FROM table_name_48 WHERE reaction_time = 0.164 |
how many products are there | select count ( * ) from Products |
Which player had a position of t1 and played in the united states? | SELECT player FROM table_name_49 WHERE place = "t1" AND country = "united states" |
What is the name for district total:? | SELECT name FROM table_name_80 WHERE district = "total:" |
What is the grid total for jean-pierre beltoise? | SELECT COUNT(grid) FROM table_name_73 WHERE driver = "jean-pierre beltoise" |
What is Location Attendance, when Team is "Orlando"? | SELECT location_attendance FROM table_name_16 WHERE team = "orlando" |
What was the average attendance on october 3, 1976? | SELECT AVG(attendance) FROM table_name_68 WHERE date = "october 3, 1976" |
Who is the director when there is 11.21 million viewers? | SELECT directed_by FROM table_24910733_1 WHERE us_viewers__millions_ = "11.21" |
In which year did the most recent crime happen? | SELECT max(YEAR) FROM perpetrator; |
What category did MCG get a nominee in? | SELECT category FROM table_name_62 WHERE label = "mcg" AND result = "nominee" |
Name the No. 5 which has a No. 8 of logan, and a No. 10 of ethan, and a No. 4 of jacob? | SELECT no_5 FROM table_name_39 WHERE no_8 = "logan" AND no_10 = "ethan" AND no_4 = "jacob" |
In complaints received in 2014, how many of them were submitted via call? | SELECT COUNT(T2.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Phone' AND strftime('%Y', T1.`Date received`) = '2014' |
Which silver has a Bronze of 1, a Total of 4, and a Nation of slovakia? | SELECT silver FROM table_name_76 WHERE bronze = "1" AND total = "4" AND nation = "slovakia" |
In users yelping since 2009 to 2011, how many of them have low count of fans? | SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year >= 2009 AND user_yelping_since_year < 2012 AND user_fans = 'Low' |
What was the Population (2011) when the Population (2006) was less than 7083, and the Population density less than 342.8, and the Change (%) of 5, and an Area (km²) larger than 4.5? | SELECT COUNT(population__2011_) FROM table_name_2 WHERE population__2006_ < 7083 AND population_density < 342.8 AND change___percentage_ = 5 AND area__km²_ > 4.5 |
Give me a list of the names of all songs ordered by their resolution. | SELECT song_name FROM song ORDER BY resolution |
What is the ward ID of the most crowded ward? | SELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1 |
What is the total number of players born between 1970 to 1975? | SELECT COUNT(Player_Id) FROM Player WHERE strftime('%Y', DOB) BETWEEN '1970' AND '1975' |
Which constructor had a grid number of less than 3 and where the Time/Retired was 1:34:31.522? | SELECT constructor FROM table_name_55 WHERE grid < 3 AND time_retired = "1:34:31.522" |
Who are the top 5 professors who teaches the highest number of professional or master/undergraduate courses? | SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.p_id) DESC LIMIT 5 |
Can you give me a list of documents that don't have any images? | Do you want document code? | I'd like both the document code and document name, please. | SELECT document_name, document_code FROM documents EXCEPT SELECT t1.document_name, t1.document_code FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id |
What is the average profit of all the products from the Clothing category? | SELECT SUM(T1.ListPrice - T1.StandardCost) / COUNT(T1.ProductID) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T3.Name = 'Clothing' |
Which average lane has 54.95 as a time? | SELECT AVG(lane) FROM table_name_99 WHERE time = 54.95 |
Return the phone numbers of employees with salaries between 8000 and 12000. | SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000 |
What event had a win, record of 8-1 and n/a round? | SELECT event FROM table_name_98 WHERE res = "win" AND round = "n/a" AND record = "8-1" |
Which version of opengl is used by model sgx520? | SELECT opengl AS ES FROM table_1439045_5 WHERE model = "SGX520" |
How many male students (sex is 'M') are allergic to any type of food? | SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
What is the Result of the Test match at the Edgbaston Venue on 5,6,7,8 June 1997? | SELECT result FROM table_name_53 WHERE date = "5,6,7,8 june 1997" |
What is the number of airports per country, ordered from most to least? | SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC |
what date did reuschel (12-3) lose? | SELECT date FROM table_name_36 WHERE loss = "reuschel (12-3)" |
How many female people are on the list? | SELECT count ( * ) FROM Person WHERE gender = 'female' |
List the open date of open year of the shop named "Apple". | SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple" |
Which Date had a Result of 7–20? | SELECT date FROM table_name_37 WHERE result = "7–20" |
what is their allergy types? | SELECT distinct AllergyType FROM Allergy_Type |
What was Italy's highest total when there were less than 4 bronze and 1 gold? | SELECT MAX(total) FROM table_name_29 WHERE bronze < 4 AND gold = 1 AND nation = "italy" |
Which role did Joseph Blair play in the show? | SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair' |
Among the male customers with an level of education of 4 and below, list their income K. | SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 4 AND SEX = 'Male' ) |
What is the average number of golds in athletics associated with over 42 silvers? | SELECT AVG(gold) FROM table_name_66 WHERE sport = "athletics" AND silver > 42 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.