sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Find the last name of the latest contact individual of the organization "Labour Party". | SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1 |
What is the highest prominence in ft of the peak with a prominence in m less than 103? | SELECT MAX(prominence__ft_) FROM table_name_18 WHERE prominence__m_ < 103 |
What percentage of clients who sent their complaints by postal mail are age 50 and older? | SELECT CAST(SUM(CASE WHEN T1.age > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail' |
who is the away team when the home team is sydney spirit? | SELECT away_team FROM table_name_28 WHERE home_team = "sydney spirit" |
List by name all the games released in the year 2010. | SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = '2010' |
What is the To par of the New Zealand Player? | SELECT to_par FROM table_name_79 WHERE country = "new zealand" |
What is the Title of paperID 200? | select title from Papers where paperID = '200' |
For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name. | SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1 |
What was the result of the week 16 game? | SELECT result FROM table_name_49 WHERE week = 16 |
Name the streets in Dallas. | SELECT street_name FROM address WHERE city = 'Dallas' |
What is the total combined weight of players from minnetonka, mn? | SELECT SUM(weight) FROM table_name_22 WHERE home_town = "minnetonka, mn" |
When did the season with 1 team format premiere? | SELECT premiere_air_dates FROM table_1949994_7 WHERE format = "1 Team" |
List the year in which there are more than one festivals. | SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1 |
What is the city of license when the class is LP and the identifier is CBDK? | SELECT city_of_license FROM table_name_70 WHERE class = "lp" AND identifier = "cbdk" |
What is the train name that has a destination of Tuticorin? | SELECT train_name FROM table_21716139_1 WHERE destination = "Tuticorin" |
What is the average last yr with an l plyf less than 0? | SELECT AVG(last_yr) FROM table_name_98 WHERE l_plyf < 0 |
What is the ratio of male and female users in 27-28 age group? | SELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1, 0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1, 0)) AS r FROM gender_age |
What is the teacher's account ID for the project that got the donation at 11:38:43 on 2008/7/29 ? | SELECT T1.teacher_acctid FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_timestamp LIKE '2008-07-29 11:38:43.361' |
What position is Jessie Clark? | SELECT position FROM table_14655757_1 WHERE player = "Jessie Clark" |
Find the id and first name of the student that has the most number of assessment notes? | SELECT T1.student_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 |
For each year, return the year and the average number of attendance at home games. | SELECT YEAR , avg(attendance) FROM home_game GROUP BY YEAR; |
What is the afflilation of university of rhode island? | SELECT affiliation FROM university WHERE school = "University of Rhode Island" |
what is the venue when the result is loss and the opponent is st george-illawarra dragons? | SELECT venue FROM table_name_58 WHERE result = "loss" AND opponent = "st george-illawarra dragons" |
Find the first and last name of students who are living in the dorms that have amenity TV Lounge. | SELECT T1.fname , T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') |
What is the V OC (V), when t (µm) is greater than 5, and when I SC (A) is 0.8? | SELECT v_oc__v_ FROM table_name_46 WHERE t__µm_ > 5 AND i_sc__a_ = "0.8" |
What is the sum of the FAC/LC apps with less than 25 PC apps and a UEFA YC less than 0? | SELECT SUM(fac___lc_apps) FROM table_name_11 WHERE pl_apps < 25 AND UEfa_yc < 0 |
Scunthorpe United as the home team has what tie number? | SELECT tie_no FROM table_name_52 WHERE home_team = "scunthorpe united" |
Count the number of Annual Meeting events that took place in the region of the United Kingdom. | SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting" |
Show writers who have published a book with price more than 4000000. | SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000 |
What is the catalog entry id and product stock number for Cola? | SELECT catalog_entry_id,product_stock_number FROM catalog_contents WHERE catalog_entry_name = "Cola" |
How many customers have never married? | SELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Never-married' |
In 1961, what was the Chassis when the points were lower than 6? | SELECT chassis FROM table_name_51 WHERE points < 6 AND year = 1961 |
What is the latest week when the chicago bears are the opponent? | SELECT MAX(week) FROM table_name_27 WHERE opponent = "chicago bears" |
Which sliding tackle has no dump tackle and a restricted shoulder charge? | SELECT sliding_tackle FROM table_name_3 WHERE dump_tackle = "no" AND shoulder_charge = "restricted" |
What was the aggregate score for the match won by Viadana? | SELECT aggregate_score FROM table_28068063_2 WHERE winners = "Viadana" |
What was the attendance when St Kilda played as the away team? | SELECT AVG(crowd) FROM table_name_79 WHERE away_team = "st kilda" |
What is the away team score at vfl park? | SELECT away_team AS score FROM table_name_19 WHERE venue = "vfl park" |
Show template ids, version numbers, and template type codes for all templates. | SELECT template_id, version_number, template_type_code FROM Templates |
Which apartment type code is the most common among apartments with more than one bathroom? | SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1 |
Show all template type codes and number of templates for each. | SELECT template_type_code , count(*) FROM Templates GROUP BY template_type_code |
Give me a list of all the service names sorted alphabetically. | SELECT service_name FROM services ORDER BY service_name |
Find the prices of products which has never received a single complaint. | SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints) |
How many times was "Blanket Beverly" rented? | SELECT COUNT(T3.rental_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE T1.title = 'Blanket Beverly' |
Which company has the largest sales? | Did you mean the name of the company with the largest sales? | Yes thr name of the company that has the largest sales | SELECT name FROM company ORDER BY Sales_in_Billion DESC LIMIT 1 |
Which First elected has a Incumbent of none (new seat)? | SELECT first_elected FROM table_name_15 WHERE incumbent = "none (new seat)" |
Where was the game when Geelong was the away team? | SELECT venue FROM table_name_28 WHERE away_team = "geelong" |
List the id and type of each thing, and the details of the organization that owns it. | SELECT T1.thing_id , T1.type_of_Thing_Code , T2.organization_details FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id |
Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments. | SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC |
show me the names and ids of all stations | SELECT name , id FROM station |
How many sales team were from Northeast? | SELECT SUM(CASE WHEN Region = 'Northeast' THEN 1 ELSE 0 END) FROM `Sales Team` |
Which district has the largest population? | SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1 |
Which rowers represented the country of portugal? | SELECT rowers FROM table_name_4 WHERE country = "portugal" |
Tell me the party phone of the party id 2 ? | SELECT party_phone FROM parties WHERE party_id = "2" |
What is the average rank of the Reliance Entertainment movie with an opening day on Wednesday before 2012? | SELECT AVG(rank) FROM table_name_8 WHERE day_of_week = "wednesday" AND year < 2012 AND studio_s_ = "reliance entertainment" |
What is Country, when Player is "Billy Maxwell"? | SELECT country FROM table_name_77 WHERE player = "billy maxwell" |
Which customers have ordered "food"? | ok, did you want to just return their names? | Yes. I just want to know the names of which customers have placed orders under the category "food" | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = "food" |
Which Allied Force targetted Woensdrecht? | SELECT allied_forces FROM table_1160161_12 WHERE target = "Woensdrecht" |
Find the id of users who are followed by Mary or Susan. | SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" OR T1.name = "Susan" |
Who held the same position in 2014 that Garion Weller held in 2014? | SELECT 2014 FROM table_name_82 WHERE 2012 = "garion weller" |
What is the away team at the game with an Attendance of 1,730? | SELECT away_team FROM table_name_73 WHERE attendance = "1,730" |
What is the s B share for the shareholder that has 2.55 percent of votes? | SELECT MAX(s_b_share) FROM table_206419_3 WHERE percent_of_votes = "2.55" |
What is total number of show times per day for each cinema? | SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id |
What is the Week number on December 18, 1960? | SELECT COUNT(week) FROM table_name_17 WHERE date = "december 18, 1960" |
Please list the names of the top three movies in the number comments related to the critic made by the user rating the movie. | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_comments DESC LIMIT 3 |
Tally the full names of actors in the film "Alabama Devil." | SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ALABAMA DEVIL' |
If the night rank is 9, what is the total share number? | SELECT COUNT(share) FROM table_19805130_3 WHERE rank__night_ = "9" |
LIST THE NAME OF THE AIRCRAFTS | SELECT name from aircraft |
Who voiced the villain in "The Rescuers"? | SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie WHERE T2.movie_title = 'The Rescuers' AND T1.character = T2.villian |
Can you show me all tracks which were opened after 2000? | Do you mean the names of all the tracks which were opened after 2000? | Yes. | SELECT name FROM track WHERE year_opened > 2000 |
How many users, who were not a a trialist when they rated the movie, gave the movie "The South" a rating score of not more than 2? | SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score <= 2 AND T1.movie_title = 'The South' |
What game in the season does this list start? | SELECT MIN(game) FROM table_27713030_7 |
How many of the customers are male? | SELECT COUNT(ID) FROM Customers WHERE SEX = 'Male' |
Which company is headed by Austin city? | Did you mean the name of manufacturers whose headquarters are Austin? | Yes | SELECT name from manufacturers where headquarter = "Austin" |
How many ranks by average when Keiron & Brianne are the couple? | SELECT COUNT(rank_by_average) FROM table_26375386_28 WHERE couple = "Keiron & Brianne" |
List the community area names in the Northwest. | SELECT community_area_name FROM Community_Area WHERE side = 'Northwest' |
What location did Sherry Middaugh win in? | SELECT location FROM table_name_13 WHERE winning_skip = "sherry middaugh" |
What is the df when Adam Hinshelwood is Junior Mendes? | SELECT df FROM table_23835213_2 WHERE adam_hinshelwood = "Junior Mendes" |
Provide the names and locations of the facilities that failed inspections on 29th July 2013. | SELECT T2.dba_name, T2.longitude, T2.latitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2013-07-29' AND T1.results = 'Fail' |
how many months in total | select count ( distinct month ) from happy_hour |
What was the score against the phillies on may 24? | SELECT score FROM table_name_28 WHERE opponent = "phillies" AND date = "may 24" |
Can you give me the names of those trains and tell me when they have service | SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id where T1.station_id = 1 |
What total number of opened has a stadium of stade de la mosson and is larger than 32,939 capacity? | SELECT COUNT(opened) FROM table_name_49 WHERE stadium = "stade de la mosson" AND capacity > 32 OFFSET 939 |
What is the status of the unit with a net capacity of 1212 MW? | SELECT status FROM table_name_50 WHERE net_capacity = "1212 mw" |
How many employees are there? | select count ( employee_id ) from employees |
What is the date for week 15? | SELECT date FROM table_name_28 WHERE week = 15 |
Gives the average number of chapters in Shakespeare's 1599 work. | SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T2.id) FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.Date = '1599' |
What is the number of different different airports that are destinations for American Airlines? | SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
List the names of wrestlers that have not been eliminated. | SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination) |
What is 2000, when 1996 is "A", when 1997 is "A", and when 2007 is "A"? | SELECT 2000 FROM table_name_30 WHERE 1996 = "a" AND 1997 = "a" AND 2007 = "a" |
Which player from the Ironi Nahariya club was born in 1980? | SELECT player FROM table_name_4 WHERE current_club = "ironi nahariya" AND year_born = 1980 |
What is listed under chister tornell when karianne gulliksen is 7? | SELECT MIN(christer_tornell) FROM table_28677723_10 WHERE karianne_gulliksen = 7 |
What's the average year for the accolade 100 greatest singles of all time? | SELECT AVG(year) FROM table_name_57 WHERE accolade = "100 greatest singles of all time" |
How many sitting Representatives are there in the New York 10 polling area? | SELECT COUNT(incumbent) FROM table_1342256_32 WHERE district = "New York 10" |
Where was the game with the result of 22-20 played? | SELECT venue FROM table_name_81 WHERE result = "22-20" |
What are the majors of male (sex is M) students? | SELECT Major FROM STUDENT WHERE Sex = "M" |
How many Points has Wins larger than 0? | SELECT COUNT(points) FROM table_name_24 WHERE wins > 0 |
What is the part 2 entry for class 3a? | SELECT part_2 FROM table_name_36 WHERE class = "3a" |
What is City of License, when Frequency MHz is less than 102.5? | SELECT city_of_license FROM table_name_8 WHERE frequency_mhz < 102.5 |
Name of the crew that were born in California, USA between 1958 and 1969. | SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1958' AND birth_place = 'California' AND birth_country = 'USA'; |
What is the country of the contestant with a swimsuit of 9.46? | SELECT country FROM table_name_19 WHERE swimsuit = 9.46 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.