sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
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 |
List all islands that are greater than the island on which Warwickshire is located. | SELECT DISTINCT Name FROM island WHERE Area > ( SELECT DISTINCT T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Province = 'Warwickshire' ) |
What is the release date of the bonus interview with Peter Purves? | SELECT release_date FROM table_1681535_1 WHERE notes = "Bonus interview with Peter Purves" |
Please provide the subject of series of Austria. | SELECT DISTINCT T3.Topic FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode INNER JOIN Series AS T3 ON T1.Seriescode = T3.SeriesCode WHERE T2.ShortName = 'Austria' |
Which minister left office the latest? | SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 |
Find the name and training hours of players whose hours are below 1500. | SELECT pName, HS FROM Player WHERE HS < 1500 |
How many prediction classes with "has" captions are there for image id 3050? | SELECT COUNT(T2.PRED_CLASS_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 3050 AND T2.PRED_CLASS = 'has' |
What venue did he play in before 2008 and finished 14th (q)? | SELECT venue FROM table_name_71 WHERE year < 2008 AND position = "14th (q)" |
What is the title of the episode directed by Rodney Clouden? | SELECT title FROM table_23242958_1 WHERE directed_by = "Rodney Clouden" |
what is the highest attendance's ? | SELECT MAX ( Attendance ) FROM performance |
What is the highest acc percent score in the competition? | SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1 |
What is the id of the product that is booked for 3 times? | SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3 |
List title of albums have the number of tracks greater than 10. | SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10; |
Show the role code with the least employees. | SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1 |
Show the most frequently used carrier of the phones. | SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1 |
Show last names for all student who are on scholarship. | SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y' |
Name the object class of the image with a bounding (422, 63, 77, 363). | SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 422 AND T1.Y = 63 AND T1.W = 77 AND T1.H = 363 |
Find all the songs produced by artists with first name "Marianne". | SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" |
What is the product ID No.793's model name? | SELECT T1.Name FROM Product AS T1 INNER JOIN ProductModel AS T2 ON T1.ProductModelID = T2.ProductModelID WHERE T1.ProductID = 793 |
How many years Joined have a Size smaller than 417, and an IHSAA Class of A, and a School of jac-cen-del? | SELECT COUNT(year_joined) FROM table_name_68 WHERE size < 417 AND ihsaa_class = "a" AND school = "jac-cen-del" |
What was the season when the low team is chicago sting? | SELECT season FROM table_237757_10 WHERE low_team = "Chicago Sting" |
What's the largest Fall 08 number when fall 09 is less than 82, fall 06 is 5, and fall 05 is less than 3? | SELECT MAX(fall_08) FROM table_name_96 WHERE fall_09 < 82 AND fall_06 = 5 AND fall_05 < 3 |
What is the value for Lost, when the value for Try bonus is 2, and when the value for Losing bonus is 4? | SELECT lost FROM table_name_35 WHERE try_bonus = "2" AND losing_bonus = "4" |
What is the content for la sorgente sat 3? | SELECT content FROM table_name_20 WHERE television_service = "la sorgente sat 3" |
Name the production code for 60 number in series | SELECT production_code FROM table_26702078_1 WHERE no_in_series = 60 |
What are the schools names? | SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count ( * ) > 1 |
List the positions of the dish "breaded veal cutlet with peas" on every menu where it appeared. | SELECT T2.xpos, T2.ypos FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'breaded veal cutlet with peas' |
Show the id and builder of the railway that are associated with the most trains. | SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1 |
In reviews of product with 5 stars, what is the percentage of the reviews coming from the division of East North Central? | SELECT CAST(SUM(CASE WHEN T1.division = 'East North Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.division) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 |
what is the date of settlement on Overtime Meal Subsidy | Did you want the date of settlement of claim headers with a type code Overtime Meal Subsidy? | exactly | SELECT date_of_settlement from claim_headers where claim_type_code = "Overtime Meal Subsidy" |
If the horizontal bar is n/a and the floor is 14.175, what is the number for the parallel bars? | SELECT parallel_bars FROM table_18662026_10 WHERE floor = "14.175" AND horizontal_bar = "N/A" |
Show all flight numbers with aircraft Airbus A340-300. | SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" |
What are the lname and fname of all authors that wrote exactly 1 paper? | SELECT t1.lname,t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid
group by t1.authID having count ( * ) = 1 |
For different directors who direct well, how many of them have directed an action film? | SELECT COUNT(DISTINCT T2.directorid) FROM movies2directors AS T2 INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T2.genre = 'Action' AND T3.d_quality = 4 |
What is the height of the highest roller coaster? | SELECT max ( height ) FROM roller_coaster |
Which competition has a Date of 2007-08-22? | SELECT competition FROM table_name_55 WHERE date = "2007-08-22" |
How many devices from the list use the Android platform? | SELECT count ( * ) FROM device where Software_Platform = "Android" |
What 2009 has 3r as the 1999, and w as 2002? | SELECT 2009 FROM table_name_40 WHERE 1999 = "3r" AND 2002 = "w" |
What is Player, when Year(s) Won is before 1961, and when To Par is 6? | SELECT player FROM table_name_42 WHERE year_s__won < 1961 AND to_par = 6 |
Find the number of schools that have more than one donator whose donation amount is less than 8.5. | SELECT count(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING count(*) > 1) |
Where was the game located on January 23, 2008? | SELECT location FROM table_name_93 WHERE date = "january 23, 2008" |
Provide at least 5 social security numbers of patients with a prevalent disease with a prevalence percentage lower than 30% of the average prevalence percentage of conditions. | SELECT DISTINCT T2.ssn FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN all_prevalences AS T3 ON lower(T1.DESCRIPTION) = lower(T3.ITEM) WHERE CAST(T3."PREVALENCE PERCENTAGE" AS REAL) * 100 / ( SELECT AVG('PREVALENCE PERCENTAGE') FROM all_prevalences ) < 30 LIMIT 5 |
Shawn Respert play for what school/club team? | SELECT school_club_team FROM table_name_66 WHERE player = "shawn respert" |
How many distinct birth places are there? | SELECT COUNT(DISTINCT Birth_Place) FROM people |
which countries' tv channels are not playing any cartoon written by Todd Casey? | SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey' |
What are the names of the pilots with IDs 1 and 2? | select pilot_name from pilot where pilot_ID = 1 or pilot_ID = 2 |
Amazing! Can you do add up the bathroom counts and bedroom counts for the department type Flat and add those to the table? | SELECT apt_type_code , sum ( room_count ) , sum ( bathroom_count ) ,sum ( bedroom_count ) FROM Apartments WHERE apt_type_code = "Flat" |
What was the score of the game where stafford rangers was the away team? | SELECT score FROM table_name_92 WHERE away_team = "stafford rangers" |
How many cases have been arrested among the crimes that happened in the restaurant of Englewood? | SELECT SUM(CASE WHEN T1.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Englewood' AND T1.location_description = 'RESTAURANT' |
What date was the game that resulted in L 30-27? | SELECT date FROM table_name_34 WHERE result = "l 30-27" |
Where was the world race walking cup held before 2001? | SELECT venue FROM table_name_49 WHERE year < 2001 AND competition = "world race walking cup" |
Calculate the difference in sales between the games released in 1990 and 2000. | SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id |
What is the address for the customer Cleo? | SELECT customer_address FROM customers WHERE customer_name = "Cleo" |
What's the smallest amount of Laps that had a finish of 7 with a start of 6? | SELECT MIN(laps) FROM table_name_49 WHERE finish = "7" AND start = "6" |
What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people. | SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 2; |
Which unique cities are in Asian countries where Chinese is the official language ? | select distinct t3.name from country as t1 join countrylanguage as t2 on t1.code = t2.countrycode join city as t3 on t1.code = t3.countrycode where t2.isofficial = 't' and t2.language = 'chinese' and t1.continent = "asia" |
Count the number of addressed in the California district. | SELECT count(*) FROM address WHERE district = 'California' |
What is the average Silver, when Rank is 5, and when Bronze is less than 1? | SELECT AVG(silver) FROM table_name_87 WHERE rank = 5 AND bronze < 1 |
List all titles with a 57 series number. | SELECT title FROM table_27397948_2 WHERE no_in_series = 57 |
Which team has Firestone Tires a Reynard 95i Chassis and is sponsored by Motorola? | SELECT team FROM table_name_48 WHERE tire = "firestone" AND chassis = "reynard 95i" AND sponsor = "motorola" |
What is the name of the customer who has made the largest amount of claim in a single claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT max(amount_claimed) FROM claim_headers) |
Find the number and time of the train that goes from Chennai to Guruvayur. | SELECT train_number , TIME FROM train WHERE origin = 'Chennai' AND destination = 'Guruvayur'; |
Which engine finished 7th with the reynard 95i chassis? | SELECT engine FROM table_name_51 WHERE rank = "7th" AND chassis = "reynard 95i" |
Who was the incumbent who was first elected in 1876? | SELECT incumbent FROM table_name_43 WHERE first_elected = "1876" |
When did the country that produced 1,213,000 (21st) bbl/day join Opec? | SELECT joined_opec FROM table_166346_1 WHERE production___bbl__day_ = "1,213,000 (21st)" |
On what date was the Loss by Flanagan (6-7)? | SELECT date FROM table_name_40 WHERE loss = "flanagan (6-7)" |
Which Year is the highest one that has a Reg Season of 3rd, western, and a Division larger than 2? | SELECT MAX(year) FROM table_name_30 WHERE reg_season = "3rd, western" AND division > 2 |
Provide the country with its full name which has the most ethnic group? List them all ethnic group together with its percentage. | SELECT T1.Name, T2.Name, T2.Percentage FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1 ) GROUP BY T1.Name, T2.Name, T2.Percentage |
List the clubs that have at least a member with advisor "1121". | SELECT DISTINCT t1.clubname 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 t3.advisor = 1121 |
Which Muklom has a Halang of wɯ¹cʰi¹? | SELECT muklom FROM table_name_23 WHERE halang = "wɯ¹cʰi¹" |
What is the highest number of bronze medals received by an ensemble who received fewer than 0 gold medals? | SELECT MAX(bronze_medals) FROM table_name_77 WHERE gold_medals < 0 |
how many canton with commune being waldbillig | SELECT COUNT(canton) FROM table_1417184_1 WHERE commune = "Waldbillig" |
What is the title of the employee that inspected the establishment with license number 1576687? | SELECT DISTINCT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1576687 |
Who is the candidate for the district Arkansas 2? | SELECT candidates FROM table_1342218_5 WHERE district = "Arkansas 2" |
Which country is McMaster University located in? | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'McMaster University' |
Which game platform is the most popular in Europe? | SELECT T.platform_name FROM ( SELECT T4.platform_name, SUM(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t |
what are all the positions of players who's hometown is concord, california | SELECT position FROM table_11677691_12 WHERE hometown = "Concord, California" |
In films with rental rate of 4.99, list down the inventory ID of the films starred by Lucille Dee. | SELECT T4.inventory_id 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 INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'Lucille' AND T1.last_name = 'Dee' AND T3.rental_rate = 4.99 |
What are the other awards for 1995? | SELECT other_awards FROM table_name_77 WHERE year = 1995 |
How many years had budgets of $39 million? | SELECT SUM(year) FROM table_name_42 WHERE budget = "$39 million" |
What was the Ravg for 2003? | SELECT ravg FROM table_name_87 WHERE year = "2003" |
What is the transfer window for the player whose status was loan ended? | SELECT transfer_window FROM table_name_55 WHERE status = "loan ended" |
Which flight had the aircraft avro rj-100? | SELECT flight FROM table_name_28 WHERE aircraft = "avro rj-100" |
What is the thumbnail photo file for the product with the id "979"? | SELECT T2.ThumbnailPhotoFileName FROM ProductProductPhoto AS T1 INNER JOIN ProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.ProductID = 979 |
How many have a kilometers of 233? | SELECT number FROM table_16654785_2 WHERE kilometer = 233 |
List the name of the aircraft that has been named winning aircraft the most number of times. | SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1 |
Score F–A of 2–0, and a Opponents of walsall has what date? | SELECT date FROM table_name_49 WHERE score_f_a = "2–0" AND opponents = "walsall" |
What is the total count of teachers? | SELECT count(*) FROM teacher |
Show the account id with most number of transactions. | SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1 |
Can you show me the carriers that have phones with memories bigger than 64? | SELECT Carrier FROM phone WHERE Memory_in_G > 64 |
What is the name of the state with the most counties? | SELECT T1.name FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state GROUP BY T2.state ORDER BY COUNT(T2.county) DESC LIMIT 1 |
What is the Nationality of the Player with Jersey Number 6? | SELECT nationality FROM table_name_13 WHERE jersey_number_s_ = 6 |
How many registed students do each course have? List course name and the number of their registered students? | SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id |
Which people severed as governor most frequently? | SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1 |
From which club is player C. Dickinson? | SELECT loan_club FROM table_name_35 WHERE name = "c. dickinson" |
List of high assists with high rebounds for k. mchale (10) | SELECT high_assists FROM table_17344582_11 WHERE high_rebounds = "K. McHale (10)" |
Provide the names, cities, and countries of the customers who ordered the Plantronics single ear headset. | SELECT DISTINCT T2.`Customer Name`, T2.City, T2.Country FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Plantronics Single Ear Headset' |
What was the attendance on 10/29/1932? | SELECT attendance FROM table_name_15 WHERE date = "10/29/1932" |
show the titles, and authors or editors for all books made after the year 1989. | SELECT book_title , author_or_editor FROM book_club WHERE YEAR > 1989 |
List the location cities in the Western states. | SELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.