sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Which Source has a Undecided of 2%? | SELECT source FROM table_name_46 WHERE undecided = "2%" |
List the name of all the distinct customers who have ordered with status "packing" | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" |
Name the area km 2 for balmoral | SELECT area_km_2 FROM table_171361_2 WHERE official_name = "Balmoral" |
How many players were in the team Boston Red Stockings in 2000? | SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000 |
When 22' 37.06 100.090mph is the time for Monday August 24th how many times are there for Friday August 28th? | SELECT COUNT(fri_28_aug) FROM table_23465864_3 WHERE mon_24_aug = "22' 37.06 100.090mph" |
What is the name of the CBSA of the city with the highest average house value? | SELECT DISTINCT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1 |
What is the total transaction amount? | SELECT sum ( transaction_amount ) FROM Financial_transactions |
How many clients who live in New York City submitted their complaints via fax? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City' AND T2.`Submitted via` = 'Fax' |
Can you list the patient IDs associated with appointment IDs 93216548 and 86213939? | SELECT Patient FROM Appointment WHERE AppointmentID = 93216548 OR AppointmentID = 86213939 |
Waht laps have points smaller than 1, and a team of dale coyne racing, and the grid larger than 13? | SELECT laps FROM table_name_87 WHERE points < 1 AND team = "dale coyne racing" AND grid > 13 |
What is the socket of the model atom e680t? | SELECT socket FROM table_name_55 WHERE model_number = "atom e680t" |
What is the Score of game 35? | SELECT score FROM table_name_43 WHERE game = 35 |
Which Opponents in Final has an Outcome of winner, and a Surface of hard, and a Date of april 17, 1994? | SELECT opponents_in_final FROM table_name_15 WHERE outcome = "winner" AND surface = "hard" AND date = "april 17, 1994" |
List the names of buildings in descending order of building height. | SELECT name FROM buildings ORDER BY Height DESC |
How many losses did the Golden rivers of hay have? | SELECT AVG(losses) FROM table_name_2 WHERE golden_rivers = "hay" |
What is maximum group equity shareholding of the companies? | SELECT MAX(group_equity_shareholding) FROM operate_company |
What are the authors of submissions and their colleges? | SELECT Author, College FROM submission |
List the first and last name of the students who do not have any food type allergy. | SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") |
What is the average frequency MHz for license of eastville, virginia? | SELECT AVG(frequency_mhz) FROM table_name_24 WHERE city_of_license = "eastville, virginia" |
List the names of 5 users followed by the largest number of other users. | SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5 |
What is the smallest rank with a Lane of 1? | SELECT MIN(rank) FROM table_name_65 WHERE lane = 1 |
where is Chicagoland Speedway located? | SELECT T2.Location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id where T2.Name = 'Chicagoland Speedway' |
Which party does the incumbent first elected in 1994 belong to? | SELECT party FROM table_1341423_22 WHERE first_elected = 1994 |
In Round 19, where did Tony Lockett play? | SELECT venue FROM table_name_20 WHERE round = "19" AND player = "tony lockett" |
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice? | SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2 |
What is the max pressure of the cartridge where the muzzle energy is 201ft•lbf (273 j)? | SELECT max_pressure FROM table_173103_1 WHERE muzzle_energy = "201ft•lbf (273 J)" |
How many instructors are in the statistics department? | SELECT count ( * ) FROM instructor WHERE dept_name = 'Statistics' |
How many students are affected by each allergy type? | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype |
Can you list the first and last names of employees who were hired after 1987? | SELECT first_name,last_name FROM employees WHERE hire_date > 1987 |
show me the name of the restaurant with ResID 1? | select ResName from Restaurant where ResID = 1 |
What was the highest attendance for a game where Geelong was the home team? | SELECT MAX(crowd) FROM table_name_25 WHERE home_team = "geelong" |
and can you show me only those headquarters that have both companies in oil and gas as well as banking industry? | SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas" |
List all of Wolfgang Reitherman's movies and their voice actors. | SELECT T1.name, T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T1.director = 'Wolfgang Reitherman' |
what is the end date of Deputy? | select end_Date from Policies where Policy_Type_Code = 'Deputy' |
What percentage of all tied games did the Sassuolo team play in? | SELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D' |
Name the first elected for re-elected and brian higgins | SELECT first_elected FROM table_19753079_35 WHERE result = "Re-elected" AND incumbent = "Brian Higgins" |
What is the difference in the average GPA of students who took the hardest and easiest courses? | SELECT AVG(T1.gpa) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.diff IN (2, 1) GROUP BY T3.diff |
What place is Nolan Henke in? | SELECT place FROM table_name_10 WHERE player = "nolan henke" |
In businesses with a category of "DJs", how many businesses are rated less than 5? | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'DJs' AND T1.stars < 5 |
Please list the titles of the papers published in the journal "Concepts in Magnetic Resonance Part A" in 2008. | SELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Concepts in Magnetic Resonance Part A' AND T2.Year = 2008 |
For each country and airline name, how many routes are there? | SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name |
what is the start date of Jurisdiction? | select Start_Date from Policies where Policy_Type_Code = 'Jurisdiction' |
For the device with an event occurring on 2016/5/1 at 0:55:25, what is the gender of its user? | SELECT T1.gender FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-01 00:55:25' |
What percent did GRÜNE get in the state where FRITZ got 1.3%? | SELECT grüne FROM table_name_14 WHERE fritz = "1.3%" |
What was the rank for Great Britain? | SELECT COUNT(rank) FROM table_name_28 WHERE country = "great britain" |
when first elected was 1898 what was the party? | SELECT party FROM table_name_9 WHERE first_elected = "1898" |
What is the Speed for Chris Swallow? | SELECT speed FROM table_name_13 WHERE rider = "chris swallow" |
What teams played in Washington, DC the year that Ramapo LL Ramapo was the game in New York? | SELECT washington, _dc FROM table_13012165_1 WHERE new_york = "Ramapo LL Ramapo" |
What's the TDP for the 7130N model? | SELECT MIN(tdp__w_) FROM table_269920_3 WHERE model = "7130N" |
How many exhibitions has each artist had? | SELECT T2.name , count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id |
What are the maximum fastest lap speed in races held after 2014 grouped by race name and ordered by year? | SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year |
Excellent! Can you update this list to show me the enrollment quantity associated with each college? | SELECT cName, enr FROM college WHERE enr > ( SELECT max ( enr ) FROM college WHERE state = 'FL' ) |
list all store email addresses | select store_email_address from Drama_Workshop_Groups |
Provide the phone brands and models of the users who were at the coordinates of (80,44). | SELECT DISTINCT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T2.longitude = 80 AND T2.latitude = 44 |
What are the ids for templates that are not used in any documents? | SELECT template_id FROM Templates EXCEPT SELECT template_id FROM Documents |
What's the result for the clay surface edition on july 17, 1992? | SELECT result FROM table_name_97 WHERE surface = "clay" AND date = "july 17, 1992" |
How many tries for are there when 11 were won? | SELECT tries_for FROM table_17625749_3 WHERE won = "11" |
Which products are being supplied by "G'day, Mate"? List all of their names. | SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName LIKE 'G%day, Mate' |
Find the names of all the employees whose the role name is "Editor". | SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor" |
how many followers in Iron Man | SELECT followers FROM user_profiles WHERE name = "Iron Man" |
who was the successor for district ohio 15th? | SELECT successor FROM table_1652224_5 WHERE district = "Ohio 15th" |
Can you tell me which instructor teaches the most number of courses? | SELECT instructor from Course group by instructor order by count ( * ) desc limit 1 |
Who had the high assists @ Dallas? | SELECT high_assists FROM table_11964154_11 WHERE team = "@ Dallas" |
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 |
Name the sum of goals conceded when lost is more than 7 and points less than 26 | SELECT SUM(goals_conceded) FROM table_name_60 WHERE lost > 7 AND points < 26 |
Yards larger than 52, and a Opponent of san francisco 49ers is what kicker? | SELECT kicker FROM table_name_5 WHERE yards > 52 AND opponent = "san francisco 49ers" |
What nation had the athlete sebastian coe category:articles with hcards? | SELECT nation FROM table_22355_11 WHERE athlete = "Sebastian Coe Category:Articles with hCards" |
Show me the scores of the body builders | Which score, Snatch, Clean Jerk, or Total? | Total score | SELECT T1.Total FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID |
Give the name of the territory where Mr. Robert King works. | SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.TitleOfCourtesy = 'Mr.' AND T1.FirstName = 'Robert' AND T1.LastName = 'King' |
What is the average score of submissions? | SELECT avg(Scores) FROM submission |
What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'? | SELECT player , number_of_matches , SOURCE FROM injury_accident WHERE injury != 'Knee problem' |
List the name, nationality and id of all male architects ordered by their names lexicographically. | SELECT name , nationality , id FROM architect WHERE gender = 'male' ORDER BY name |
show me the list of authors who have submissions to workshop. | SELECT distinct T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID |
What was the outcome of the game when the opponent was Magdaléna Rybáriková? | SELECT outcome FROM table_18183850_12 WHERE opponent = "Magdaléna Rybáriková" |
Give me the names of those customers | select T1.first_name, T1.last_name from customers as T1 join addresses as T2 on T2.address_id = T1.customer_address_id where T2.city = ( SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count ( * ) DESC LIMIT 1 ) |
Where is it located? | SELECT location FROM station where name = "London Waterloo" |
What is the Capacity of the Venue of Head Coach Ali Asghar Modir Roosta? | SELECT MAX(capacity) FROM table_name_93 WHERE head_coach = "ali asghar modir roosta" |
Name the sum of points for chassis of brm p160e and year more than 1974 | SELECT SUM(points) FROM table_name_32 WHERE chassis = "brm p160e" AND year > 1974 |
Find the average ranking for each player and their first name. | SELECT avg(ranking) , T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id = T2.player_id GROUP BY T1.first_name |
What are the ages of all of Zach's friends who are in the longest relationship? | SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach') |
What is the average number of years associated with 51 games tied and over 1184 total games? | SELECT AVG(years) FROM table_name_60 WHERE tied = 51 AND total_games > 1184 |
How many years have they each been working, please? | SELECT name,years_working from journalist |
what department is McKinnon? | select dept_name from instructor where name = 'McKinnon' |
Which color is the background of the mandatory instructions? | SELECT background_colour FROM table_name_43 WHERE type_of_sign = "mandatory instructions" |
When the Loss is Johnson (4-12), what is the date? | SELECT date FROM table_name_9 WHERE loss = "johnson (4-12)" |
When were the members tenured in the Field school? | SELECT tenure FROM table_28051859_3 WHERE school = "Field" |
When did the episode that had 3.69 million total viewers (Live and SD types combined) first air? | SELECT original_airdate FROM table_24222929_3 WHERE live + sd_total_viewers = "3.69 million" |
Find the official names of cities with population bigger than 1500 or smaller than 500. | SELECT Official_Name FROM city WHERE Population > 1500 OR Population < 500 |
Can you please show me the song name with highest resolution? | SELECT song_name from song order by resolution desc limit 1 |
What district re-elected a Republican? | SELECT district FROM table_name_21 WHERE party = "republican" AND results = "re-elected" |
Which product did Cruz & Sons Co. ask for the biggest amount in a single order? | SELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' ORDER BY t1.priceEach * t1.quantityOrdered DESC LIMIT 1 |
how many host in the id no_3? | SELECT Number_of_hosts from party where Party_ID = 3 |
How many of these apartments have 3 bedrooms? | SELECT count ( * ) FROM Apartments WHERE apt_number IN ( SELECT DISTINCT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" ) AND bedroom_count = 3 |
How many deserts are not located in a single country? Name them. | SELECT Desert FROM geo_desert GROUP BY Desert HAVING COUNT(DISTINCT Country) > 1 |
Hi, how many people have friends with ages above 40? | SELECT COUNT ( * ) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN ( SELECT name FROM Person WHERE age > 40 ) |
Which side has Orcagna as the inscription? | SELECT side FROM table_name_89 WHERE inscription = "orcagna" |
What is the name of artwork id 2? | select Name from artwork where Artwork_ID = 2 |
Show all church names except or those that had a wedding in year 2015. | SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015 |
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300. | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300" |
What is the average rank of a player with fewer than 3 matches? | SELECT AVG(rank) FROM table_name_38 WHERE matches < 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.