sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
List the email of customers that bought the book titled Switch on the Night. | SELECT T4.email FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.title = 'Switch on the Night' |
Display the full name , hire date , salaer, and department member of the above results. | SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%' |
What is the total number of deaths and damage for all storms with a max speed greater than the average? | SELECT sum(number_deaths) , sum(damage_millions_USD) FROM storm WHERE max_speed > (SELECT avg(max_speed) FROM storm) |
What is the height of Patrick Femerling, of the Alba Berlin club? | SELECT COUNT(height) FROM table_name_36 WHERE current_club = "alba berlin" AND player = "patrick femerling" |
Which position had fewer rounds than 3, and an overall of less than 48? | SELECT position FROM table_name_96 WHERE round < 3 AND overall < 48 |
When 0-1 is the aggregate what are the home (1st leg)? | SELECT home__1st_leg_ FROM table_14219514_2 WHERE aggregate = "0-1" |
What is Points Against, when Try Bonus is "Try bonus"? | SELECT points_against FROM table_name_77 WHERE try_bonus = "try bonus" |
What is the favourite movie genre for audiences of age 18? | SELECT T1.genre FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T3.age = 18 GROUP BY T1.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1 |
Provide the platform where the Panzer Tactics can be played. | SELECT T4.platform_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 INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics' |
How many of those films do not have any market estimation? | SELECT count ( Title ) FROM film WHERE Film_ID NOT IN ( SELECT Film_ID FROM film_market_estimation ) |
Tell me the total number of gold for bronze more than 0 and total more than 100 | SELECT COUNT(gold) FROM table_name_2 WHERE bronze > 0 AND rank = "total" AND "total" > 100 |
How many contestants did not get voted? | SELECT count(*) FROM contestants WHERE contestant_number NOT IN ( SELECT contestant_number FROM votes ) |
What is the Tie no when Swansea City is the Away team with a Score of 2–2? | SELECT tie_no FROM table_name_75 WHERE score = "2–2" AND away_team = "swansea city" |
What is the total population with less than 789 males? | SELECT COUNT(total_population) FROM table_name_12 WHERE male < 789 |
Which Programming has a Channel greater than 51.2 and a PSIP Short Name of kyaz-5? | SELECT programming FROM table_name_53 WHERE channel > 51.2 AND psip_short_name = "kyaz-5" |
How many students are there in total? | SELECT count(*) FROM STUDENT |
Which car in the database provides the best crash protection based on its weight? How much is it? | SELECT T1.ID, T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1 |
How many services has each resident requested? List the resident id, details, and the count in descending order of the count. | SELECT T1.resident_id , T1.other_details , count(*) FROM Residents AS T1 JOIN Residents_Services AS T2 ON T1.resident_id = T2.resident_id GROUP BY T1.resident_id ORDER BY count(*) DESC |
What is the highest number of rebounds of the game with a 6-14 record? | SELECT high_rebounds FROM table_name_53 WHERE record = "6-14" |
Who was the contstructor of the car having a grid of 20? | SELECT constructor FROM table_name_66 WHERE grid = "20" |
What is the average transaction amount? | SELECT avg ( transaction_amount ) FROM Financial_transactions |
How many games did they play on october 9? | SELECT COUNT(opponent) FROM table_27539808_3 WHERE october = 9 |
What home team scored 102-87? | SELECT home_team FROM table_name_60 WHERE score = "102-87" |
What were the notes for the time of 6:34.51? | SELECT notes FROM table_name_56 WHERE time = "6:34.51" |
Who is the narrator of the "Flight" episode? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Flight' AND T2.role = 'Narrator' |
Which Object type has a Constellation of cancer? | SELECT object_type FROM table_name_58 WHERE constellation = "cancer" |
What are the average score and average staff number of all shops? | SELECT avg(num_of_staff) , avg(score) FROM shop |
What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance? | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT avg(balance) FROM savings)) |
Show the distinct leader names of colleges associated with members from country "Canada". | SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada" |
Find all the instruments ever used by the musician with last name "Heilo"? | SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo" |
Name the dishes that cost 180,000. | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.price = 180000 |
What is the length for years 2012-2013? | SELECT length FROM table_name_29 WHERE year = "2012-2013" |
Find the titles of the papers that contain the word "ML". | SELECT title FROM papers WHERE title LIKE "%ML%" |
What is the first name of students enrolled in class ACCT-211 and got grade C? | SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C' |
Show the name of colleges that have at least two players. | SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 |
shows for the artist Santana featuring the product g&b? | SELECT volume AS :issue FROM table_name_78 WHERE artist = "santana featuring the product g&b" |
What is the original air date for episode 4? | SELECT original_air_date FROM table_23399481_3 WHERE season__number = 4 |
What is the highest number of games drawn, where the games played was less than 7? | SELECT MAX(drawn) FROM table_name_86 WHERE games < 7 |
When was there a Time of 18:00, and a Set 1 of 22–25? | SELECT date FROM table_name_92 WHERE time = "18:00" AND set_1 = "22–25" |
Which of their position titles contain the word senior in it? | SELECT Position FROM physician WHERE POSITION LIKE '%senior%' |
Find the name and building of the department with the highest budget. | SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1 |
Who had a transfer fee of released and played the position of DF? | SELECT player FROM table_name_30 WHERE transfer_fee = "released" AND pos = "df" |
What is the zip code of the customer Carole Bernhard? | SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" |
What is the relationship between "feathers" and "onion" in image no.2345528? | SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE (T4.OBJ_CLASS = 'feathers' OR T4.OBJ_CLASS = 'onion') AND T2.IMG_ID = 2345528 GROUP BY T1.PRED_CLASS |
How many times was the rank (night) 11? | SELECT COUNT(viewers__millions_) FROM table_11253290_2 WHERE rank__night_ = 11 |
Hmm, I want to know the asset ids that did not incur any fault log. | Select asset_id from Assets where asset_id not in ( SELECT asset_id from Fault_Log ) |
Name the season for position 4th | SELECT COUNT(season) FROM table_25375093_1 WHERE position = "4th" |
What are the names of the artists that released the oldest song on the list? | SELECT artist_name FROM song ORDER BY releasedate LIMIT 1 |
Find the addresses of the course authors who teach the course with name "operating system" or "data structure". | SELECT T1.address_line_1 FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure" |
How many "Mountain-100 Silver, 38" were sold by Stearns MacFeather? | SELECT SUM(T2.Quantity) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Stearns' AND T1.LastName = 'MacFeather' AND T3.Name = 'Mountain-100 Silver, 38' |
How many cars on a train that runs in the east direction have a flat roof? | SELECT SUM(CASE WHEN T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' |
What is the lowest attendance total on August 26? | SELECT MIN(attendance) FROM table_name_71 WHERE date = "august 26" |
What is the name of the department that has the largest number of students enrolled? | SELECT T4.dept_name FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code GROUP BY T3.dept_code ORDER BY count(*) DESC LIMIT 1 |
Show all locations where a gas station for company with market value greater than 100 is located. | SELECT T3.location 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.market_value > 100 |
What are the male names in weddings after 2014? | SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id WHERE T1.year > 2014 |
Which party does Timothy Kirkhope lead? | SELECT party FROM table_name_50 WHERE leader = "timothy kirkhope" |
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'? | SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama' |
How many employees came into the Quality Assurance Group in the year 2007? | SELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T2.GroupName = 'Quality Assurance' AND STRFTIME('%Y', T1.StartDate) = '2007' |
What is the smallest crowd at the Victoria Park Venue? | SELECT MIN(crowd) FROM table_name_94 WHERE venue = "victoria park" |
What's the highest bronze with a less than 1 Rank? | SELECT MAX(bronze) FROM table_name_40 WHERE rank < 1 |
Where was the game when Collingwood was the home team? | SELECT venue FROM table_name_19 WHERE away_team = "collingwood" |
Which Artist has an Issue Price of $8,159.95? | SELECT artist FROM table_name_11 WHERE issue_price = "$8,159.95" |
Find the number of matches happened in each year. | SELECT count(*) , YEAR FROM matches GROUP BY YEAR |
Which Status has a Opposing Teams of wales? | SELECT status FROM table_name_16 WHERE opposing_teams = "wales" |
Which Partner has Opponents in the final of john bromwich frank sedgman? | SELECT partner FROM table_name_20 WHERE opponents_in_the_final = "john bromwich frank sedgman" |
what is the first name of the student with last name smith? | SELECT Fname from Student where LName = "Smith" |
Among the author included in the paper of "Inspection resistant memory: Architectural support for security from physical examination", write down the author name and ID who were affiliated with Microsoft Research, USA. | SELECT T2.Name, T1.Id FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Inspection resistant memory: Architectural support for security FROM physical examination' AND T2.Affiliation = 'Microsoft Research, USA' |
List the food type of the restaurant located in 22779 6th St., Hayward City. | SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_num = 22779 AND T1.street_name = '6th St' AND T2.city = 'hayward' |
How many students are there for each major? | SELECT major , count(*) FROM Student GROUP BY major |
Show the opening year in which at least two churches opened | SELECT open_date FROM church GROUP BY open_date HAVING count ( * ) > = 2 |
How many students play video games? | SELECT count(DISTINCT StuID) FROM Plays_games |
Who are the technicians from team "CLE" and "CWS"? | select Name from technician where Team = 'CLE' or team = 'CWS' |
List the description of all the colors. | SELECT color_description FROM ref_colors |
WHAT WAS HER SONG CHOICE WHEN THE WEEK WAS TOP 10? | SELECT song_choice FROM table_15778392_1 WHERE week__number = "Top 10" |
How many students are there? | SELECT count(*) FROM student |
Return the average and minimum age of captains in each class. | SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS |
What is the result under the season coach Rich Rodriguez? | SELECT result FROM table_name_29 WHERE season_coach = "rich rodriguez" |
What is the average Points for a year before 1955? | SELECT AVG(points) FROM table_name_68 WHERE year < 1955 |
When were those built? | SELECT built FROM railway GROUP BY LOCATION HAVING COUNT ( * ) > = 2 |
What skip has switzerland as the country? | SELECT skip FROM table_name_15 WHERE country = "switzerland" |
What are the product names of all products with the color description red? | SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "red" |
What is the course id for the International Finance course? | SELECT course_id FROM course WHERE title = 'International Finance' |
Show the description of transaction type with code "PUR". | SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = "PUR" |
Which competition was played on 8 June 2005? | SELECT competition FROM table_name_90 WHERE date = "8 june 2005" |
Return the structure description of the document that has been accessed the fewest number of times. | SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1 |
How many values for result correspond to attendance of 74,111? | SELECT COUNT(result) FROM table_15647838_3 WHERE attendance = "74,111" |
Is prothrombin time long when thromboplastin is prolonged? | SELECT prothrombin_time FROM table_1226250_1 WHERE bleeding_time = "Prolonged" AND partial_thromboplastin_time = "Prolonged" |
How many engines are there for model 97H00? | SELECT COUNT(engine) FROM table_20866024_4 WHERE model_designation = "97H00" |
Which Total has a League Cup smaller than 0? | SELECT MAX(total) FROM table_name_69 WHERE league_cup < 0 |
What Game had a Result of 125-123 (OT)? | SELECT game FROM table_name_45 WHERE result = "125-123 (ot)" |
What was the total Attendance in weeks previous of 5, playing the Seattle Seahawks? | SELECT COUNT(attendance) FROM table_name_47 WHERE week < 5 AND opponent = "seattle seahawks" |
Name the total number of round for against the netherlands | SELECT COUNT(round) FROM table_22825058_23 WHERE against = "The Netherlands" |
Who is the captain of the team coached by Giles White? | SELECT captain FROM table_name_28 WHERE coach = "giles white" |
Who is the one representing the company "Heli Swaren GmbH & Co. KG"? | SELECT ContactName FROM Suppliers WHERE CompanyName = 'Heli Swaren GmbH & Co. KG' |
What player had a transfer window of winter, and free as the transfer fee? | SELECT name FROM table_name_72 WHERE transfer_window = "winter" AND transfer_fee = "free" |
Is wireless combo keyboard and mouse support part of the DDM class? | SELECT ddm_class FROM table_1153898_1 WHERE comparisons = "Wireless Combo keyboard and mouse support" |
What is the highest position of the Bangor City team? | SELECT MAX(position) FROM table_17366952_1 WHERE team = "Bangor City" |
Name the result for first elected being 1798 1825 | SELECT result FROM table_2668243_18 WHERE first_elected = "1798 1825" |
How many courses are provided in each semester and year? | SELECT count(*) , semester , YEAR FROM SECTION GROUP BY semester , YEAR |
In the final, who are the opponents of partner Simon Aspelin? | SELECT opponents_in_the_final FROM table_name_9 WHERE partner = "simon aspelin" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.