sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the names of the scientists, and how many projects are each of them working on? | SELECT count(*) , T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name |
Among the widowed female customers, give the income of those who has an level of education of 5 and below. | SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 5 AND SEX = 'Female' AND MARITAL_STATUS = 'Widowed' ) |
Hello! Can you provide me with the time spent in all restaurants by Linda Smith? | SELECT sum ( Spent ) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" |
Who is the player that plays position c on the New York Knicks? | SELECT player FROM table_name_54 WHERE team = "new york knicks" AND position = "c" |
In years 2011 to 2013, what is the total number of female students in university ID 40? | SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year BETWEEN 2011 AND 2013 AND university_id = 40 |
Which episode has the most vote for 10 stars rating? | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.votes DESC LIMIT 1; |
Find the total number of students living in the male dorm (with gender M). | SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M' |
Who sang for the movie Amar Deep? | SELECT singer FROM table_2528382_5 WHERE movie_album = "Amar Deep" |
What is the average ANSI code for the town of Sherman and the smaller of the water area in square miles than 0.005? | SELECT AVG(ansi_code) FROM table_name_39 WHERE township = "sherman" AND water__sqmi_ < 0.005 |
Who was the winner of the race at Belmont? | SELECT winner_2nd FROM table_1358608_4 WHERE venue = "Belmont" |
What is the sum of the numbers in series written by sam meikle, which have 21 numbers in the season? | SELECT SUM(no_in_series) FROM table_name_5 WHERE written_by = "sam meikle" AND no_in_season = 21 |
" what's the engine with turbo being yes (mitsubishi td04-15g ) " | SELECT engine FROM table_11167610_1 WHERE turbo = "Yes (Mitsubishi TD04-15g )" |
how about those whose GPA is greater than 3? | SELECT * FROM student WHERE stu_gpa > 3 |
What is Postition, when Date of Birth (Age) is Example, and when Player is Mark Spencer? | SELECT position FROM table_name_59 WHERE date_of_birth__age_ = "example" AND player = "mark spencer" |
Which Baltimore group has a viron shape of icosahedral, replicates in the cytoplasm, is non-enveloped, and is from the astroviridae family? | SELECT baltimore_group FROM table_name_13 WHERE virion_shape = "icosahedral" AND envelopment = "non-enveloped" AND replication_site = "cytoplasm" AND family = "astroviridae" |
Which were the trips that started at Mountain View City Hall and ended on a rainy day? | SELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 WHERE T2.events = 'Rain' AND T1.start_station_name = 'Mountain View City Hall' |
Show the ids of the faculty who don't participate in any activity. | SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in |
How many baseball players attended that college in 2018? | Select count ( player_id ) from player_college where year = "2018" and college_id = "texas" |
What is other when no party preference is 19.1%? | SELECT other FROM table_27003186_3 WHERE no_party_preference = "19.1%" |
List all the navy students who are disabled. | SELECT T1.name FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'navy' |
What Venue has Basketball as a Sport? | SELECT venue FROM table_name_92 WHERE sport = "basketball" |
For the biwords pair that appears "116430" times, what is the second word of the pair? | SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T2.occurrences = 116430 |
What is the percentage of 5 star ratings River City brand root beer get? | SELECT CAST(COUNT(CASE WHEN T2.StarRating = 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.StarRating) FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'River City' |
What are their first names? | select first_name from employees where first_name LIKE '%z%' |
What are the heights of body builders with total score smaller than 315? | SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total < 315 |
List down the names of person born in California, USA. | SELECT name FROM Person WHERE birth_region = 'California' AND birth_country = 'USA'; |
What scores happened on February 11? | SELECT score FROM table_23486853_7 WHERE date = "February 11" |
what is the average age for all people | SELECT avg ( age ) FROM people |
What years have a duration of 18 years, and patrizio rispo as the actor? | SELECT years FROM table_name_26 WHERE duration = "18 years" AND actor = "patrizio rispo" |
In heat 4, what is Byun Hye-young's Nationality? | SELECT nationality FROM table_name_62 WHERE heat = 4 AND name = "byun hye-young" |
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'? | SELECT T1.name , T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes' |
Show all book categories and the number of books in each category. | SELECT category , count(*) FROM book_club GROUP BY category |
Which Points have a Game larger than 25, and an Opponent of dallas stars? | SELECT AVG(points) FROM table_name_75 WHERE game > 25 AND opponent = "dallas stars" |
What is the date in location from of document id 81? | SELECT Date_in_Location_From FROM Document_locations WHERE Document_ID = '81' |
What was the crowd when the VFL played MCG? | SELECT MIN(crowd) FROM table_name_49 WHERE venue = "mcg" |
What's the lap number for time/retired of +33.912? | SELECT COUNT(laps) FROM table_name_71 WHERE time_retired = "+33.912" |
What is the high run total associated with a high score of 385 and under 407 innings? | SELECT MAX(runs) FROM table_name_96 WHERE high_score = "385" AND innings < 407 |
Show the name and opening year for three churches that opened most recently. | SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3 |
What is the name of the pregame host when the Play-by-play was by JP Dellacamera, earlier than 2009, and Color commentator(s) was Ty Keough? | SELECT pregame_host FROM table_name_67 WHERE play_by_play = "jp dellacamera" AND year < 2009 AND color_commentator_s_ = "ty keough" |
How many employees are there? | SELECT COUNT ( * ) FROM Employees |
How many calories on average does a recipe that comes from "Produce for Better Health Foundation and 5 a Day" contain? | SELECT AVG(T2.calories) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'Produce for Better Health Foundation and 5 a Day' |
Can you please tell me how many users there are? | SELECT count ( * ) FROM user_profiles |
How many All Star players who played in the 1973 season were black? | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1973 AND T1.race = 'B' |
Count the number of artists who have had volumes. | SELECT COUNT(DISTINCT Artist_ID) FROM volume |
Name the attendance on april 17 | SELECT attendance FROM table_name_15 WHERE date = "april 17" |
Which To par is scored at 70? | SELECT to_par FROM table_name_10 WHERE score = 70 |
Show the title and director for all films. | SELECT title , directed_by FROM film |
What year was the match were xavier malisse was the runner-up against lleyton hewitt? | SELECT year FROM table_name_3 WHERE outcome = "runner-up" AND opponent = "lleyton hewitt" |
Show the names of climbers and the heights of mountains they climb. | SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
Which school is the top enrollment? | SELECT school_name FROM school order by Enrollment desc limit 1 |
How many production companies made more than 150 movies? | SELECT COUNT(*) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T1.company_name) > 150 ) |
What is the number of total offense when the opponentis Penn State? | SELECT MAX(total_offense) FROM table_28697228_4 WHERE opponent = "Penn State" |
what is the venue when the runner-up is £20,000, the champion (average in final) is phil taylor (109.35)? | SELECT venue FROM table_name_86 WHERE runner_up = "£20,000" AND champion__average_in_final_ = "phil taylor (109.35)" |
Which team is ranked #10? | SELECT team FROM table_name_74 WHERE rank = 10 |
Name the least game for arco arena 13,330 | SELECT MIN(game) FROM table_17102076_10 WHERE location_attendance = "ARCO Arena 13,330" |
What is Notes, when App(L/C/E) is 13 (7/2/4)? | SELECT notes FROM table_name_89 WHERE app_l_c_e_ = "13 (7/2/4)" |
What player has a round larger than 6 with a D position. | SELECT player FROM table_name_82 WHERE round > 6 AND position = "d" |
Which Opponent has a Surface of hard on 28 august 1993? | SELECT opponent FROM table_name_46 WHERE surface = "hard" AND date = "28 august 1993" |
Name the high points for pepsi center 19,155 | SELECT high_points FROM table_23285761_8 WHERE location_attendance = "Pepsi Center 19,155" |
What is the ratio between the 5 stars votes for 'No Loan Again, Naturally' episode and 'Coming to Homerica' episode? | SELECT CAST(SUM(CASE WHEN T1.title = 'No Loan Again, Naturally' THEN T1.votes ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Coming to Homerica' THEN T1.votes ELSE 0 END) AS ratio FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5; |
What is the position of Allen Gamboa? | SELECT position FROM table_name_50 WHERE name = "allen gamboa" |
Find the number of items that did not receive any review. | SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review) |
In the game with an attendance of 18304, what was the final score? | SELECT result FROM table_17294353_1 WHERE attendance = 18304 |
List the distinct positions of pilots older than 30. | SELECT DISTINCT POSITION FROM pilot WHERE Age > 30 |
What party does the incumbent from the Ohio 7 district belong to? | SELECT party FROM table_1342218_35 WHERE district = "Ohio 7" |
Show each state and the number of addresses in each state. | SELECT state_province_county , count(*) FROM addresses GROUP BY state_province_county |
What care plans have been received by Mrs. Elly Koss during year 1970? | SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND strftime('%Y', T2.START) = '2013' |
when did kaku launch? | SELECT launch from program where name = "Kaku" |
Tell me the dates conducted for plaid cymru of 19% | SELECT date_s__conducted FROM table_name_69 WHERE plaid_cymru = "19%" |
Name the Nationality of södertälje sk? | SELECT nationality FROM table_name_78 WHERE team_from = "södertälje sk" |
What are the names of perpetrators in country "China" or "Japan"? | SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan" |
who did highest rebounds in the game with score w 105–88 (ot) | SELECT high_rebounds FROM table_17190012_7 WHERE score = "W 105–88 (OT)" |
List out the country name of upper middle income group. Which country has the earliest national account base year? List out the region where this country locates. | SELECT DISTINCT T1.CountryName FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IncomeGroup = 'Upper middle income' UNION SELECT longname FROM ( SELECT longname FROM country WHERE NationalAccountsBaseYear <> '' ORDER BY NationalAccountsBaseYear ASC LIMIT 1 ) |
What is the score of the game with Grizzlies as the visitor team on 30 December 2007? | SELECT score FROM table_name_21 WHERE visitor = "grizzlies" AND date = "30 december 2007" |
What is the nationality of supplier number 1? | SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 1 |
List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie". | SELECT T1.date_of_enrolment , T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" |
List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes. | SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor' |
Show all donor names. | SELECT DISTINCT donator_name FROM endowment |
What is the average review number for application with 5 rating? | SELECT AVG(Reviews) FROM playstore WHERE Rating = 5 |
How many stations in San Francisco are installed in 2014? | SELECT SUM(CASE WHEN city = 'San Francisco' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station |
Can you show all user ids that have more than 1 tweet? | SELECT T1.uid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count ( * ) > 1 |
In what district was keith ellison the incumbent? | SELECT district FROM table_25030512_26 WHERE incumbent = "Keith Ellison" |
What is the number of Goals on 1950-05-30? | SELECT COUNT(goals) FROM table_name_63 WHERE date = "1950-05-30" |
When was the last transcript released? | SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1 |
What is the number of tickets sold and available for the concert at Long Beach Arena? | SELECT tickets_sold___available FROM table_name_18 WHERE venue = "long beach arena" |
How many stars on average does a Yelp_Business in Anthem get from a user review? | SELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Anthem' |
What is the effective date of the claim that has the largest amount of total settlement? | SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1 |
Please list the name of the person who was in the Hall of Fame in the year 1978. | SELECT name FROM HOF WHERE year = 1978 |
How many addresses are there in country USA? | SELECT COUNT(*) FROM addresses WHERE country = 'USA' |
What is the total number of products? | SELECT sum ( t2.order_quantity ) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id |
what is the rank for Goodrich | Goodrich is the last name, right? | yes | select rank from faculty where lname = "Goodrich" |
Show all allergy type with number of students affected. | SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype |
Please give the user ID of the user who has posted the most tweets. | SELECT UserID FROM twitter GROUP BY UserID ORDER BY COUNT(DISTINCT TweetID) DESC LIMIT 1 |
Provide the full names and emails of customers whose payments were greater than 70% of the average. | SELECT DISTINCT T2.first_name, T2.last_name, T2.email FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T2.address_id = T3.address_id WHERE T1.amount > ( SELECT AVG(amount) FROM payment ) * 0.7 |
In what country is mont sokbaro a highest point | SELECT country_or_region FROM table_24285393_1 WHERE highest_point = "Mont Sokbaro" |
what is the british name when the american name is sixteenth note? | SELECT british_name FROM table_name_50 WHERE american_name = "sixteenth note" |
What is the Chassis of the Cooper Car Company after 1965 when the engine was a Maserati v12? | SELECT chassis FROM table_name_33 WHERE year > 1965 AND team = "cooper car company" AND engine = "maserati v12" |
Which school has enrollment of 887? | SELECT school FROM table_name_44 WHERE enrollment = 887 |
What is the Time/Retired with more Laps than 34, a Grid smaller than 15, and Driver Damon Hill? | SELECT time_retired FROM table_name_88 WHERE laps > 34 AND grid < 15 AND driver = "damon hill" |
What is the total number of to par when runner-up was Jonathan Kaye? | SELECT COUNT(to_par) FROM table_247955_2 WHERE runner_s__up = "Jonathan Kaye" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.