sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Can you please show me the characteristic name used by least number of products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY count ( * ) LIMIT 1 |
Name the player for mercer | SELECT player FROM table_17308269_2 WHERE college_country_team = "Mercer" |
List the title of the earliest published Japanese book. | SELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Japanese' ORDER BY T1.publication_date ASC LIMIT 1 |
How many courses do the student whose id is 171 attend? | SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171 |
Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year? | SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) > 20000 AND T2.positiontitle = 'Trainee' |
Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed" | SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" |
What entrant had a Maserati 250F chassis and fewer than 6 points before 1957? | SELECT entrant FROM table_name_17 WHERE chassis = "maserati 250f" AND year < 1957 AND points < 6 |
Who's the race leader of Cuneo to Turin? | SELECT race_leader FROM table_name_90 WHERE course = "cuneo to turin" |
What is the maximum number in the series for the episode directed by Harvey S. Laidman? | SELECT MAX(no_in_series) FROM table_228973_9 WHERE directed_by = "Harvey S. Laidman" |
What Position has a Level of tier 4 with a Season smaller than 2003? | SELECT position FROM table_name_85 WHERE level = "tier 4" AND season < 2003 |
Does student348 have a due payment? | SELECT bool FROM no_payment_due WHERE name = 'student348' |
Which city has the lowest GDP? Please list the city name and its GDP. | SELECT city , GDP FROM city ORDER BY GDP LIMIT 1 |
What are the cities no customers live in? | SELECT city FROM addresses WHERE city NOT IN ( SELECT DISTINCT t3.city FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id) |
What is the sum of the grid of driver ryan hunter-reay, who has more than 24 points? | SELECT SUM(grid) FROM table_name_7 WHERE driver = "ryan hunter-reay" AND points > 24 |
which one has the most followers? | SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1 |
What is the average vitamin C amount of all cakes? | SELECT AVG(T1.vitamin_c) FROM Nutrition AS T1 INNER JOIN Recipe AS T2 ON T2.recipe_id = T1.recipe_id WHERE T2.title LIKE '%cake%' |
How many crimes happened in longitude -8772658001? | SELECT COUNT(*) FROM Crime WHERE longitude = '-87.72658001' |
Which membership card has more than 5 members? | SELECT Membership_card FROM member GROUP BY Membership_card HAVING COUNT(*) > 5 |
What was the 08-09 i/o best of the player with 1386 points? | SELECT 08 AS _09_i_o_best FROM table_24990183_5 WHERE ws_points = 1386 |
List 5 patients' name that need medication due to streptococcal sore throat disorder. | SELECT DISTINCT T2.first, T2.last FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.REASONDESCRIPTION = 'Streptococcal sore throat (disorder)' LIMIT 5 |
Please give the title of the film starring PENELOPE GUINESS and has the highest replacement cost. | SELECT T3.title 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 WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.replacement_cost DESC LIMIT 1 |
What is the date that the Montreal Canadiens hosted a game with a record of 14–11–3? | SELECT date FROM table_name_77 WHERE home = "montreal canadiens" AND record = "14–11–3" |
What is the title of the episode that aired on May 10, 1958? | SELECT title FROM table_25800134_2 WHERE airdate = "May 10, 1958" |
What is the name of the airline that flew the most flights to Chicago Midway International? | SELECT T3.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T1.Description = 'Chicago, IL: Chicago Midway International' AND T2.DEST = 'MDW' GROUP BY T3.Description ORDER BY COUNT(T3.Description) DESC LIMIT 1 |
In 1983 what is the tournament that is 0 / 1? | SELECT tournament FROM table_name_24 WHERE 1983 = "0 / 1" |
What are the document ids for the budget type code 'SF'? | SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' |
List all customer status codes and the number of customers having each status code. | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code |
What was the highest round that had northwestern? | SELECT MAX(round) FROM table_name_18 WHERE school = "northwestern" |
In what district is the city listed in Serial number 9? | SELECT COUNT(district) FROM table_18425346_2 WHERE serial_no = 9 |
What is the total number of games played? | SELECT sum(gamesplayed) FROM Sportsinfo |
What was the W-L record when HIgh Points was andre miller (30)? | SELECT record FROM table_17323042_11 WHERE high_points = "Andre Miller (30)" |
Please list all clients' phone numbers and complaint IDs which are still in progress. | SELECT T1.phone, T2.`Complaint ID` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress' |
Who was the team with the smallest crowd at the Princes Park venue? | SELECT MIN(crowd) FROM table_name_73 WHERE venue = "princes park" |
Round that greg huntington went in? | SELECT round FROM table_name_54 WHERE name = "greg huntington" |
Which Score has a Home of quebec nordiques, and a Visitor of vancouver blazers on february 28? | SELECT score FROM table_name_52 WHERE home = "quebec nordiques" AND visitor = "vancouver blazers" AND date = "february 28" |
What type of video coding has a format name of dvcam? | SELECT video_coding FROM table_name_69 WHERE format_name = "dvcam" |
How many of those bookings were studio apartments? | SELECT count ( * ) FROM apartment_bookings as T1 join apartments as T2 on T1.apt_id = T2.apt_id where T1.booking_start_date like "%2016%" and T2.apt_type_code = "Studio" |
Find the name of the company that produces both furnitures with less than 6 components and furnitures with more than 10 components. | SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component < 6 INTERSECT SELECT t3.name FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID JOIN manufacturer AS t3 ON t2.manufacturer_id = t3.manufacturer_id WHERE t1.num_of_component > 10 |
What score to par won in 1998? | SELECT to_par FROM table_18862490_2 WHERE year = 1998 |
What's Sara Isakovič's lane number that had a heat of 3? | SELECT SUM(lane) FROM table_name_43 WHERE heat = 3 AND name = "sara isakovič" |
What is Melbourne's home venue? | SELECT venue FROM table_name_74 WHERE home_team = "melbourne" |
Name the party for new york 4 | SELECT party FROM table_19753079_35 WHERE district = "New York 4" |
What are the ages of the gymnasts, ordered descending by their total points? | SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC |
How many countries are there in the region whose comment description is "asymptotes sublate after the r." | SELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r' |
Which Spanish voice actor does the same character as French voice actor Dennis Boileau? | SELECT spanish_voice_actor FROM table_name_61 WHERE french_voice_actor = "dennis boileau" |
How many unique room numbers are currently in the table? | SELECT count ( distinct room_number ) FROM classroom WHERE capacity > 50 |
Which head's name has the substring 'Ha' ? List the id and name. | SELECT head_id , name FROM head WHERE name LIKE '%Ha%' |
What is Mike Skinner's Chevrolet's Car #? | SELECT COUNT(car__number) FROM table_name_74 WHERE make = "chevrolet" AND driver = "mike skinner" |
What was the record for July 26? | SELECT record FROM table_name_16 WHERE date = "july 26" |
Name the students with above-average capability. | SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T2.capability > ( SELECT AVG(capability) FROM RA ) |
Perfect, what about the lowest consider rate? | SELECT min ( consider_rate ) FROM candidate |
What is the station type of DWZM-TV? | SELECT station_type FROM table_24673888_1 WHERE callsign = "DWZM-TV" |
What is the average Grid for the honda cbr1000rr, with 18 laps and a time of +1:12.884? | SELECT AVG(grid) FROM table_name_45 WHERE bike = "honda cbr1000rr" AND laps = 18 AND time = "+1:12.884" |
how many songs has Enrique produced? | SELECT count ( * ) FROM song where artist_name = "Enrique" |
What was the attendance at the game that had a loss of Ayala (6-12)? | SELECT attendance FROM table_name_49 WHERE loss = "ayala (6-12)" |
Find the first name and gender of the student who has allergy to milk but not cat. | SELECT fname, sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") |
Which Date has a Partner of daniella dominikovic? | SELECT date FROM table_name_66 WHERE partner = "daniella dominikovic" |
What is the most recent year that Iftiraas was the winner? | SELECT MAX(year) FROM table_name_68 WHERE winner = "iftiraas" |
What's the sum of points for the 1963 season when there are more than 30 games? | SELECT SUM(points) FROM table_name_8 WHERE season = "1963" AND games > 30 |
When the opponent was Yan Zi Jie Zheng, what was the outcome? | SELECT outcome FROM table_2516282_3 WHERE opponents = "Yan Zi Jie Zheng" |
When the mark is 8.54, the reaction time was over 0.23800000000000002 seconds, what's the highest amount of points recorded? | SELECT MAX(points) FROM table_name_79 WHERE mark = "8.54" AND react > 0.23800000000000002 |
Can you tell me the Season that has the Team 2 of hanoi acb? | SELECT season FROM table_name_99 WHERE team_2 = "hanoi acb" |
Who was North Melbourne's home opponent? | SELECT home_team FROM table_name_26 WHERE away_team = "north melbourne" |
What was the surface where the outcome was winner on 12 march 1989? | SELECT surface FROM table_name_19 WHERE outcome = "winner" AND date = "12 march 1989" |
Tell me the organization type of organisation_id 1? | SELECT organisation_type FROM Organisations where organisation_id = 1 |
How much would be the total sales profit for shopping cart ID 20621 ? | SELECT SUM((T1.ListPrice - T1.StandardCost) * T2.Quantity) FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 20621 |
Alright! Now can you update this list to show the associated complain type code for these two status codes? | SELECT complaint_status_code,complaint_type_code FROM complaints GROUP BY complaint_status_code HAVING count ( * ) > 3 |
What states have at least two representatives? | SELECT State FROM representative GROUP BY State HAVING COUNT(*) >= 2 |
How many rooms have a king bed? | SELECT count(*) FROM Rooms WHERE bedType = "King"; |
What was the score of the game that had a loss of Wegman (2-6)? | SELECT score FROM table_name_7 WHERE loss = "wegman (2-6)" |
Which character is the villain of the most popular movie? | SELECT T2.villian FROM `movies_total_gross` AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY T1.total_gross DESC LIMIT 1 |
What year was the brabham bt46 bt48 bt49 Chassis common? | SELECT AVG(year) FROM table_name_89 WHERE chassis = "brabham bt46 bt48 bt49" |
What was the date of the game when Colorado was the visiting team and Chicago was the home team? | SELECT date FROM table_name_36 WHERE visitor = "colorado" AND home = "chicago" |
Count the number of chip model that do not have wifi. | SELECT count(*) FROM chip_model WHERE wifi = 'No' |
What is the season # for the episode with air date february 2, 1970? | SELECT MAX(season__number) FROM table_25800134_14 WHERE airdate = "February 2, 1970" |
Show the date of the tallest perpetrator. | SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 |
Which Reigon has a Village of Chassagne-Montrachet? | SELECT region FROM table_name_82 WHERE village = "chassagne-montrachet" |
What is the average price of all wine products? | SELECT avg ( Price ) from wine |
What are the final tables made and best finishes for all poker players? | SELECT Final_Table_Made , Best_Finish FROM poker_player |
Who was the home team at Brunswick Street Oval? | SELECT home_team FROM table_name_65 WHERE venue = "brunswick street oval" |
When circuit ricardo tormo is the circuit what is the round? | SELECT COUNT(round) FROM table_21191496_1 WHERE circuit = "circuit Ricardo Tormo" |
On average, how many Starts have Wins that are smaller than 0? | SELECT AVG(starts) FROM table_name_86 WHERE wins < 0 |
What is the score when high points is from pierce (30)? | SELECT score FROM table_11959669_6 WHERE high_points = "Pierce (30)" |
Which kickoff had an attendance of 58,120? | SELECT kickoff_[a_] FROM table_name_9 WHERE attendance = "58,120" |
What was the result of the election when Tic Forrester ran as an incumbent? | SELECT result FROM table_1342149_11 WHERE incumbent = "Tic Forrester" |
Where is store number 2 located? | SELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 2 |
How many laps have a race time of 3:31:24? | SELECT laps FROM table_2226343_1 WHERE race_time = "3:31:24" |
Who played hte home team when the score was 2:1? | SELECT home FROM table_name_45 WHERE score = "2:1" |
How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total? | SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990; |
What is the maximum torque at rpm for the engine with code BMM? | SELECT max_torque_at_rpm FROM table_name_90 WHERE engine_code_s_ = "bmm" |
What trains have a category of express and a weekly frequency? | SELECT train_name FROM table_21716139_1 WHERE category = "Express" AND frequency = "Weekly" |
find the name of all departments that do actually have one or more employees assigned to them. | SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
How many distinct countries are the climbers from? | SELECT COUNT(DISTINCT Country) FROM climber |
Who was the opponent when the result was 2-2 (draw)? | SELECT opponenent FROM table_name_70 WHERE result = "2-2 (draw)" |
What is the location of Classification of T12? | SELECT location FROM table_name_96 WHERE classification = "t12" |
What year was there a Tony award category of Best Revival of a Musical? | SELECT year FROM table_name_72 WHERE award = "tony award" AND category = "best revival of a musical" |
What was the attendance for the week 1 game? | SELECT attendance FROM table_name_9 WHERE week = 1 |
What American Southwest Conference school was founded in 1883? | SELECT institution FROM table_name_87 WHERE founded > 1883 AND current_conference = "american southwest" |
What is the date of enrollment in the course named "database"? | SELECT T2.date_of_enrolment FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "database" |
Find the name of the department which has the highest average salary of professors. | SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.