sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Who were those churches organized by? | SELECT Organized_by FROM church ORDER BY open_date Asc LIMIT 3 |
List all customer names with orders that are disputed. | SELECT t3.firstName, t3.lastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN employees AS t3 ON t2.salesRepEmployeeNumber = t3.employeeNumber WHERE t1.status = 'Disputed' |
What is the number of the series written by Teresa Lin? | SELECT COUNT(no_in_series) FROM table_26801821_1 WHERE written_by = "Teresa Lin" |
What are the names of each district? | select district_name from district |
what is the pick for robert griffin iii? | SELECT pick FROM table_name_97 WHERE name = "robert griffin iii" |
How many counties are there in total? | SELECT count(*) FROM county |
Count the number of regions. | SELECT count(*) FROM region |
What character is in over 22 episodes? | SELECT character FROM table_name_91 WHERE episodes > 22 |
Which home has a Date of november 7? | SELECT home FROM table_name_16 WHERE date = "november 7" |
Which courses ran in Fall 2009 and in Spring 2010? | SELECT * FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 INTERSECT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010 |
What is the releases number under Season 2? | SELECT release FROM table_16279520_1 WHERE timeline = "Season 2" |
Which transportation method is used the most often to get to tourist attractions? | SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1 |
Calculate the percentage of complaints made by Google account client in server ZOHARI. | SELECT CAST(SUM(CASE WHEN T1.email LIKE '%@gmail.com' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.email) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.server = 'ZOHARI' |
What are the personal name, family name, and author ID of the course author who teaches the most courses? | SELECT T1.personal_name , T1.family_name , T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1 |
Show the manager name for gas stations belonging to the ExxonMobil company. | SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil' |
What is the Result of the Game on April 9? | SELECT result FROM table_name_87 WHERE date = "april 9" |
What is the name of the building with the largest height? | SELECT name FROM buildings ORDER BY Height DESC LIMIT 1 |
Please list the dates of the flights that were cancelled due to the most serious reason. | SELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE |
What are the names of all students who tried out in alphabetical order? | SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName |
Name the least bronze for silver being less than 0 | SELECT MIN(bronze) FROM table_name_45 WHERE silver < 0 |
Is the right halfback player a starter? | SELECT starter FROM table_25517718_3 WHERE position = "Right halfback" |
What is the smallest width for a frame size of 5k and a height shorter than 2700? | SELECT MIN(width) FROM table_name_18 WHERE frame_size = "5k" AND height < 2700 |
what is Dan's friend's name and age? | SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' |
What nation has a sport of weightlifting and a pinyin of kùkè qúndǎo? | SELECT nation FROM table_name_24 WHERE sport = "weightlifting" AND pinyin = "kùkè qúndǎo" |
State the name of the optional ingredient of no.1397 recipe. | SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.recipe_id = 1397 AND T2.optional = 'TRUE' |
List the names of the first andthe second teams that played a match with the point of the winning margin lower than the 30% of the average winning margin of the matches held in 2011. | SELECT DISTINCT CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T2.Team_Name END, CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T3.Team_Name END FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T1.Match_Date LIKE '2011%' |
Which date has the most ordered quantity? What is the total order quantity on that day? | SELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1 |
Oh sorry! I am all mixed up! Third time's a charm! Can you provide me with the lot details for all lots that belong to investors which belong to the 'investor id' category of "l"? | SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" |
What are the names of the technicians aged either 36 or 37? | SELECT Name FROM technician WHERE Age = 36 OR Age = 37 |
Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date. | SELECT COUNT(CASE WHEN JULIANDAY(t1.shippeddate) - JULIANDAY(t1.requireddate) > 3 THEN T1.customerNumber ELSE NULL END) FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.status = 'Shipped' |
How many authors were associated with the Microsoft Research when paper number 1 was written? | SELECT COUNT(PaperId) FROM PaperAuthor WHERE Affiliation LIKE '%Microsoft Research%' |
List down the business ID and attribute value of the attribute name of "payment_types_visa". | SELECT T2.business_id, T2.attribute_value FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'payment_types_visa' |
Which is the largest average number when the swimsuit is 9.4 and the evening gown stat is less than 9.486? | SELECT MAX(average) FROM table_name_75 WHERE swimsuit = 9.4 AND evening_gown < 9.486 |
What school/club did the player who layed shooting guard attend? | SELECT school_club_team FROM table_name_35 WHERE position = "shooting guard" |
How many restaurants' owners are in California? | SELECT COUNT(owner_state) FROM businesses WHERE owner_state = 'CA' |
List the id of students who attended some courses? | SELECT student_id FROM student_course_attendance |
What are the names of everybody sorted by age in descending order? | SELECT name FROM Person ORDER BY age DESC |
What is the highest number of bronze when silver is larger than 0, rank is larger than 3? | SELECT MAX(bronze) FROM table_name_69 WHERE silver > 0 AND rank > 3 |
Which class had a machine of RS125R, points over 113, and a rank of 4th? | SELECT class FROM table_name_30 WHERE machine = "rs125r" AND points > 113 AND rank = "4th" |
What is the host year of city "Taizhou ( Zhejiang )"? | SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )" |
What is the first, middle, and last name of the first student to register? | SELECT first_name , middle_name , last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1 |
Find the product of enzyme id 1? | SELECT product FROM enzyme where id = 1 |
Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25. | SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25" |
What coutry had a rampaged killing 14 in 1965? | SELECT country FROM table_name_29 WHERE killed = "14" AND year = 1965 |
How long is the Fairy Bridge? | SELECT length_meters from bridge where name = "Fairy Bridge" |
List the names of all the producers in the movie "Pirates of the Caribbean: At World's End". | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Pirates of the Caribbean: The Curse of the Black Pearl' AND T2.job = 'Producer' |
What are their prices? | Do you mean typical buying price or typical selling price? | Buying price. | SELECT T2.typical_buying_price FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' |
What are the mascots for schools with enrollments above the average? | SELECT mascot FROM school WHERE enrollment > (SELECT avg(enrollment) FROM school) |
Which policy type has the most records in the database? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 |
What is the school and organization enrolled by student211? | SELECT T2.school, T1.organ FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T2.name = T1.name WHERE T1.name = 'student211' |
What rounds did Gordini participate in? | SELECT rounds FROM table_name_74 WHERE constructor = "gordini" |
Which Capacity has a School of windlehurst school, and an Ofsted smaller than 131889? | SELECT SUM(capacity) FROM table_name_63 WHERE school = "windlehurst school" AND ofsted < 131889 |
What Nationality has the Player of Marcus Walker? | SELECT nationality FROM table_name_19 WHERE player = "marcus walker" |
Name the entrant for 1975 and chassis of hill gh1 | SELECT entrant FROM table_name_25 WHERE year = 1975 AND chassis = "hill gh1" |
Name the venue for march 28, 2008 | SELECT venue FROM table_name_47 WHERE date = "march 28, 2008" |
What was the released date of Polarium? | SELECT released_date FROM table_1616608_2 WHERE western_title = "Polarium" |
WHAT IS THE PLAYER WITH TOTAL LESS THAN 151, TO PAR OF 8? | SELECT player FROM table_name_41 WHERE total < 151 AND to_par = 8 |
When did Essendon play as the home team? | SELECT date FROM table_name_70 WHERE home_team = "essendon" |
Describe the hero, director, and the release date of Mulan. | SELECT T1.hero, T2.director, T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.movie_title = 'Mulan' |
How many scenes are there in the 5th act of "History of Henry VIII"? | SELECT SUM(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 5 AND T1.LongTitle = 'History of Henry VIII' |
Who played drums for the Gray Race album? | SELECT drums FROM table_name_89 WHERE album = "the gray race" |
What is the Record when the high rebounds was Antonio Davis (9)? | SELECT record FROM table_name_5 WHERE high_rebounds = "antonio davis (9)" |
Which championship had an oppenent of mario ančić in the final? | SELECT championship FROM table_name_8 WHERE opponent_in_the_final = "mario ančić" |
What model has a builder of zhuzhou, and a power output of 9600 (kw)? | SELECT model FROM table_name_20 WHERE builder__family_ = "zhuzhou" AND power_output__kw_ = "9600" |
What is Cristiano Ronaldo's birthday? | SELECT birthday from Player where player_name = "Cristiano Ronaldo" |
Which customers have made at least two orders? Give me each customer name and number of orders made. | SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2 |
Hello, how many drivers are there in total? | SELECT count ( * ) from drivers |
In the least populated community, what is the most common location of all the reported crime incidents? | SELECT T2.location_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.population = ( SELECT MIN(population) FROM Community_Area ) AND T2.location_description IS NOT NULL GROUP BY T2.location_description |
Which team is from earlier than 1994? | SELECT team FROM table_name_53 WHERE year < 1994 |
On broadcast date is 25april1970, how many people tuned in? | SELECT viewers__in_millions_ FROM table_2102898_1 WHERE broadcast_date = "25April1970" |
Which aircraft won the most matches? | SELECT winning_aircraft FROM match group by winning_aircraft order by count ( * ) desc limit 1 |
What is the id of the store that has the most items in inventory? | SELECT store_id FROM inventory GROUP BY store_id ORDER BY count(*) DESC LIMIT 1 |
Who won the mens doubles when wang hao won the mens singles? | SELECT mens_doubles FROM table_28138035_26 WHERE mens_singles = "Wang Hao" |
Name the date successor seated for successor being vacant | SELECT date_successor_seated FROM table_2417330_4 WHERE successor = "Vacant" |
How many crimes had happened in Central Chicago? | SELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' |
Which Elector has an Order of cardinal-priest, and a Nationality of french? | SELECT elector FROM table_name_74 WHERE order = "cardinal-priest" AND nationality = "french" |
What is the total time for all lessons taught by Janessa Sawayn? | SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; |
Hello! Can you show me a list of all of the hometowns? | SELECT Hometown FROM people |
Among products bought by Kathryn Ashe, what is the name of the product with the highest quantity? | SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Kathryn' AND T3.LastName = 'Ashe' ORDER BY T2.Quantity DESC LIMIT 1 |
What was Collingwood's score as the home team? | SELECT home_team AS score FROM table_name_54 WHERE home_team = "collingwood" |
What is the party where the incumbent is overton brooks? | SELECT party FROM table_1342198_18 WHERE incumbent = "Overton Brooks" |
What is the total number of adventure games released in 2005? | SELECT COUNT(DISTINCT T3.id) FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Adventure' AND T1.release_year = 2005 |
Show the zip code of the county with name "Howard". | SELECT Zip_code FROM county WHERE County_name = "Howard" |
What was the percentage of votes for coakley when kennedy won 1.6% | SELECT coakley__percentage FROM table_24115349_4 WHERE kennedy__percentage = "1.6%" |
Calculate the difference between the average satisfaction of the students with high salaries and no salary. | SELECT AVG(T2.sat) - ( SELECT AVG(T2.sat) FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' ) AS diff FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' |
Show the name for regions and the number of storms for each region. | SELECT T1.region_name , count(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id |
Please list the names of the movies that received more than 20 likes? | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic_likes > 20 |
What is the highest profit order in the East superstore of customers from Houston, Texas? | SELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1 |
What is the venue when fitzroy was the away team? | SELECT venue FROM table_name_80 WHERE away_team = "fitzroy" |
What was the record after game 20? | SELECT record FROM table_20010140_9 WHERE game = 20 |
How many different scientists are assigned to any project? | SELECT count(DISTINCT scientist) FROM assignedto |
Calculate the percentage of games published by 'Brash Entertainment'? | SELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Brash Entertainment' THEN T2.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id |
Who is the arranger for "I KIssed a Girl"? | SELECT arranger_s_ FROM table_28715942_6 WHERE track = "I Kissed a Girl" |
Among the product lists in order ID 10337, write down the product names and suppliers which had the highest in reorder level. | SELECT T2.ProductName, T1.CompanyName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID WHERE T3.OrderID = 10337 ORDER BY T2.ReorderLevel DESC LIMIT 1 |
What is the name and city of the airport that the most routes end at? | SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid ORDER BY count(*) DESC LIMIT 1 |
Which champion has a Group Stage LLWS in Russellville? | SELECT champion FROM table_name_16 WHERE llws = "group stage" AND city = "russellville" |
List the 1st air date for season 12. | SELECT original_air_date FROM table_27437601_2 WHERE no_in_season = 12 |
What are the first names for all students who are from the major numbered 600? | SELECT Fname FROM Student WHERE Major = 600 |
List the runtime of movies starred by an African-American actor born on December 28, 1954. | SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28' |
Find and list the names of districts which has below-average stars for Eagle Capital. | SELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.