sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What is the average finish that has 24 as the start, with a year after 1987?
|
SELECT AVG(finish) FROM table_name_89 WHERE start = 24 AND year > 1987
|
Find the names of all artists that have "a" in their names.
|
SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
|
Name the total number of points for 46 tries for
|
SELECT COUNT(points) FROM table_27293285_4 WHERE tries_for = "46"
|
Count the number of gymnasts.
|
SELECT count(*) FROM gymnast
|
What is the lowest round for an offensive guard when the overall is smaller than 150?
|
SELECT MIN(round) FROM table_name_59 WHERE overall < 150 AND position = "offensive guard"
|
Which School/Club Team has a Years in Orlando of 1997–1998?
|
SELECT school_club_team FROM table_name_92 WHERE years_in_orlando = "1997–1998"
|
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
|
SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
|
How many players were in the event after 2011 with less than 9 aces?
|
SELECT COUNT(player) FROM table_name_72 WHERE event > 2011 AND NOT aces < 9
|
how many trip are presented on the table
|
SELECT count ( * ) FROM trip
|
How many times is the number of Indian cities than Italian cities?
|
SELECT CAST(SUM(IIF(T1.country = 'India', 1, 0)) AS REAL) / SUM(IIF(T1.country = 'Italy', 1, 0)) FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id
|
Who was the mens doubles when womens singles is mette sørensen?
|
SELECT mens_doubles FROM table_12171145_1 WHERE womens_singles = "Mette Sørensen"
|
What is their distinct id and type?
|
SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close'
|
How many journals have a word "computing" in its full name?
|
SELECT COUNT(Id) FROM Journal WHERE FullName LIKE '%computing%'
|
How many methods in repository 150 did not have a comment and a summary?
|
SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 150 AND T2.FullComment IS NULL AND T2.Summary IS NULL
|
What is the longitude of Angerona Tholus?
|
SELECT longitude FROM table_name_35 WHERE name = "angerona tholus"
|
What's the pos for an asts less than 117?
|
SELECT pos FROM table_name_52 WHERE asts < 117
|
Which city lives most of staffs? List the city name and number of staffs.
|
SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
|
Show ID and first and last name of Engineer who has visited the most times.
|
SELECT T1.engineer_id , T1.first_name , T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 on T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY count ( * ) DESC LIMIT 1
|
List out 3 best seller products during year 2003 with their total quantity sold during 2003.
|
SELECT t3.productName, SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE STRFTIME('%Y', t1.orderDate) = '2003' GROUP BY t3.productName ORDER BY SUM(t2.quantityOrdered) DESC LIMIT 3
|
Return the ids of all products that were ordered more than three times or supplied more than 80000.
|
SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*) > 3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased) > 80000
|
What year had a title of Die Shaolin Affen EP and EP as the type?
|
SELECT AVG(year) FROM table_name_50 WHERE type = "ep" AND title = "die shaolin affen ep"
|
What is Party, when Results is "Re-Elected", and when District is "Louisiana 5"?
|
SELECT party FROM table_name_76 WHERE results = "re-elected" AND district = "louisiana 5"
|
what other types of accounts are available?
|
SELECT acc_type FROM customer where acc_type ! = "saving"
|
What was the max profit a user can make on Bitcoin on 2013/4/28?
|
SELECT T2.high - T2.low FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'
|
Show me the details of all entrepreneurs
|
SELECT * FROM entrepreneur
|
what is the average of lesson time?
|
SELECT avg ( lesson_time ) FROM Lessons
|
List the title of all projects located in Chicago along with the ID of the donor.
|
SELECT T1.title, T3.donor_acctid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T2.school_city LIKE 'Chicago'
|
What is the longitude of the township at ANSI code 1759682?
|
SELECT longitude FROM table_18600760_9 WHERE ansi_code = 1759682
|
For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings and had an atttendance smaller than 68,431?
|
SELECT COUNT(week) FROM table_name_93 WHERE opponent = "minnesota vikings" AND attendance < 68 OFFSET 431
|
how many maximum # when viewers (m) is 8.01
|
SELECT MAX(_number) FROM table_27374740_2 WHERE viewers__m_ = "8.01"
|
Bronze of 0, and a Total of 1, and a Silver smaller than 1 what is the lowest gold?
|
SELECT MIN(gold) FROM table_name_35 WHERE bronze = 0 AND total = 1 AND silver < 1
|
What position did player id "hartgi01" play in his Stanley Cup finals performance?
|
SELECT DISTINCT pos FROM ScoringSC WHERE playerID = 'hartgi01'
|
what is the total checking and saving balance of all accounts?
|
SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid
|
What is the earliest year where playoffs was "did not qualify," regular season was "2nd, New England," and Open Canada Cup is "N/A"?
|
SELECT MIN(year) FROM table_1999350_1 WHERE playoffs = "Did not qualify" AND regular_season = "2nd, New England" AND open_canada_cup = "N/A"
|
The record of 35-31 has what score?
|
SELECT score FROM table_name_52 WHERE record = "35-31"
|
how many player are presented on the table | Did you mean to ask for the number of entries in the table player? | exactly
|
SELECT COUNT ( * ) FROM player
|
In which location did the Meca World Vale Tudo 6 event happen?
|
SELECT location FROM table_name_84 WHERE event = "meca world vale tudo 6"
|
What draw has a lost less than 6 with 28 as the points?
|
SELECT draw FROM table_name_23 WHERE lost < 6 AND points = 28
|
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
|
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony")
|
Which grants are described as 'regular'?
|
SELECT * FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular'
|
Hmm, can you list the names of customers whose savings account balances are higher than the average savings balance?
|
SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > ( SELECT avg ( balance ) FROM savings )
|
What are the names of the stadiums without any concerts?
|
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
|
How many female characters are there in the movie "Spider-Man 3"?
|
SELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female'
|
What school is located in Huntsville, Texas?
|
SELECT institution FROM table_28243691_2 WHERE location = "Huntsville, Texas"
|
How many of those fault logs had faulty parts?
|
select count ( * )
from
(
SELECT fault_log_entry_id FROM Fault_Log where fault_log_entry_id in (
select fault_log_entry_id from Fault_Log_Parts )
)
|
What languages are spoken when call sign XEJAM is used?
|
SELECT languages FROM table_14670060_1 WHERE call_sign = "XEJAM"
|
List the names of all the cast members in the series.
|
SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast'
|
Which team uses lola t92/00/ buick for their chassis/engine?
|
SELECT team FROM table_23391714_1 WHERE chassis_engine = "Lola T92/00/ Buick"
|
What is the Final score on november 22?
|
SELECT final_score FROM table_name_48 WHERE date = "november 22"
|
What is the total number of FA Cup Goals, when FLT Goals is greater than 0?
|
SELECT COUNT(fa_cup_goals) FROM table_name_47 WHERE flt_goals > 0
|
What are their first names and the class rooms where they teach?
|
SELECT T2.emp_fname , T1.class_room FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Accounting'
|
What is the name of the staff that is in charge of the attraction named "US museum"?
|
SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = "US museum"
|
What is the Date of the game with a Record of 8–10–6?
|
SELECT date FROM table_name_99 WHERE record = "8–10–6"
|
What is the score for the team with a record of 2-1?
|
SELECT score FROM table_name_81 WHERE record = "2-1"
|
Name the team for 22 points
|
SELECT team FROM table_24587026_1 WHERE points = "22"
|
Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids.
|
SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2;
|
what is the building_id of the apartment apt.908?
|
SELECT building_id FROM Apartments where apt_number = "Apt. 908"
|
How many dollars is the revenue when the net profit is 55.4 million dollars?
|
SELECT revenue__us_$million_ FROM table_18077713_1 WHERE net_profit__us_$m_ = "55.4"
|
please show the undergrads total from each campus
|
SELECT t2.campus, sum ( t1.undergraduate ) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id group by t2.Campus
|
what is the ship types delivered when the total vessels built for usmc is 13 ships for usmc (plus 37 more for usn)?
|
SELECT ship_types_delivered FROM table_name_21 WHERE total_vessels_built_for_usmc = "13 ships for usmc (plus 37 more for usn)"
|
How many drivers are from Hartford city or younger than 40?
|
SELECT count(*) FROM driver WHERE home_city = 'Hartford' OR age < 40
|
What was the 2nd leg that had the Estudiantes La Plata home for the 2nd leg?
|
SELECT 2 AS nd_leg FROM table_name_41 WHERE home__2nd_leg_ = "estudiantes la plata"
|
What position does Neil Komadoski play?
|
SELECT position FROM table_1213511_4 WHERE player = "Neil Komadoski"
|
Compute the number of products with a price larger than or equal to $180.
|
SELECT COUNT(*) FROM products WHERE price >= 180
|
What Valley Vista has a Willow Canyon of 2169?
|
SELECT valley_vista FROM table_name_47 WHERE willow_canyon = "2169"
|
Thank you! What athletic conference is Rutgers University in?
|
SELECT Primary_conference FROM university where school = "Rutgers University"
|
What is every value for periselene if period is 4.947432?
|
SELECT periselene__km_ FROM table_206217_2 WHERE period__h_ = "4.947432"
|
Steve Nash (24) got high points for how many teams?
|
SELECT COUNT(team) FROM table_17340355_10 WHERE high_points = "Steve Nash (24)"
|
Show different publishers together with the number of publications they have.
|
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
|
What is the ratio between famous current legislators and famous historical legislators?
|
SELECT CAST(COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) FROM historical ) FROM current
|
Retrieve the title of the paper that has the largest number of authors.
|
SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT max(authorder) FROM authorship)
|
Which Emission (in nanometers) has an absorbtion of 593 nm?
|
SELECT emit__nm_ FROM table_name_6 WHERE absorb__nm_ = "593"
|
What is the Place of the Player with a Score of 73-73-65-73=284?
|
SELECT place FROM table_name_32 WHERE score = 73 - 73 - 65 - 73 = 284
|
Which apps have 5 rating? List out then application name.
|
SELECT DISTINCT App FROM playstore WHERE Rating = 5
|
What is the name of the room that can accommodate the most people?
|
SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;
|
List by their ID the complaints received by the company on 25/09/2014 that took the longest.
|
SELECT `Complaint ID` FROM events WHERE strftime('%J', `Date sent to company`) - strftime('%J', `Date received`) = ( SELECT MAX(strftime('%J', `Date sent to company`) - strftime('%J', `Date received`)) FROM events WHERE `Date sent to company` = '2014-09-25' ) AND `Date sent to company` = '2014-09-25'
|
What is the total installs of apps with content rating of adults only 18+ and what are the translated reviews of it?
|
SELECT SUM(T1.Installs), T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1."Content Rating" = 'Adults only 18+'
|
List the country name of the customers in the building marketing segment with an account balance greater than 80% of the average account balance of all customers.
|
SELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey INNER JOIN ( SELECT AVG(c_acctbal) * 0.8 AS avg_acctbal FROM customer ) AS T3 WHERE T1.c_acctbal > T3.avg_acctbal
|
What is the name of the primary with a DCSF number larger than 2337 and an Ofsted number smaller than 135339?
|
SELECT name FROM table_name_74 WHERE type = "primary" AND dcsf_number > 2337 AND ofsted_number < 135339
|
What are the names and ids of customers whose address contains TN?
|
SELECT customer_name , customer_id FROM customers WHERE customer_address LIKE "%TN%"
|
what song is a genre of glam
|
SELECT song_title FROM table_name_26 WHERE genre = "glam"
|
What was the Competition on September 29, 2003?
|
SELECT competition FROM table_name_15 WHERE date = "september 29, 2003"
|
In the most populated ward, how many incidents of domestic violence were reported in a bar or tavern?
|
SELECT COUNT(T2.report_no) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' AND T2.location_description = 'BAR OR TAVERN' ORDER BY T1.Population DESC LIMIT 1
|
What is the id of the patient whose hypertension started most recently?
|
SELECT PATIENT FROM conditions WHERE START = ( SELECT MAX(START) FROM conditions WHERE DESCRIPTION = 'Hypertension' )
|
Which highest rank belongs to the palestinian territories?
|
SELECT MAX(rank) FROM table_name_85 WHERE country = "palestinian territories"
|
Which start station had the most trips starting from August? Give me the name and id of the station.
|
SELECT start_station_name , start_station_id FROM trip WHERE start_date LIKE "8/%" GROUP BY start_station_name ORDER BY COUNT(*) DESC LIMIT 1
|
Name the nation when bronze is less than 4 and the total is more than 4
|
SELECT nation FROM table_name_46 WHERE total > 4 AND bronze < 4
|
What are the different instruments listed in the database?
|
SELECT DISTINCT instrument FROM Instruments
|
What are the color of products that were reviewed?
|
SELECT T1.Color FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 709 OR 937 OR 798
|
What are the name and id of the three highest priced rooms?
|
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;
|
What is the highest ff when solo is 56?
|
SELECT MAX(ff) FROM table_26176081_29 WHERE solo = 56
|
What are the countries in the region of Asia?
|
SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
|
What language was spoken in Everlasting Moments?
|
SELECT language_s_ FROM table_18994724_1 WHERE film_title_used_in_nomination = "Everlasting Moments"
|
what is the dpi of Fujitsu fi-6130 A4 Series Scanner?
|
SELECT dpi FROM product WHERE product = "Fujitsu fi-6130 A4 Series Scanner"
|
How many conditions did Tyree Eichmann have?
|
SELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Tyree' AND T1.last = 'Eichmann'
|
Show the name of the teacher for the math course.
|
SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID = T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID = T3.Teacher_ID WHERE T2.Course = "Math"
|
Find the saving balance of the account with the highest checking balance.
|
SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1
|
Which Rank has a Runner -up smaller than 0?
|
SELECT MAX(rank) FROM table_name_31 WHERE runner__up < 0
|
what year has general nominated in the category or choice breakthrough artist?
|
SELECT COUNT(year) FROM table_name_77 WHERE nominated_work = "general" AND category = "choice breakthrough artist"
|
Where did Michael Eric Bibat win bronze?
|
SELECT location FROM table_name_29 WHERE bronze = "michael eric bibat"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.