sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Show all the faculty ranks and the number of students advised by each rank. | SELECT T1.rank , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank |
What is the Club that has an Established more than 2000 for soccer plated in kuntz stadium? | SELECT club FROM table_name_90 WHERE established > 2000 AND sport = "soccer" AND venue = "kuntz stadium" |
Which player from A-League 39 (110) has the highest games per goal? | SELECT MAX(games_per_goal) FROM table_name_34 WHERE a_league = "39 (110)" |
Opponent of @ braves, and a Loss of pelfrey (2–5) had what score? | SELECT score FROM table_name_88 WHERE opponent = "@ braves" AND loss = "pelfrey (2–5)" |
What is the latitude, longitude, city of the station from which the shortest trip started? | SELECT T1.lat , T1.long , T1.city FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id ORDER BY T2.duration LIMIT 1 |
How many universities have at least 80,000 students in the year 2011? | SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011 |
Among the active employees with over 10 hours of sick leave, what is the percentage of the employees with over 20 vacation hours? | SELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10 |
Find the attribute data type for the attribute named "Green". | SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "Green" |
Name the total number of nicknames for andrew college | SELECT COUNT(nickname) FROM table_16734640_1 WHERE institution = "Andrew College" |
For all words cited in paper ID 315017, state the other paper ID and class label which also cited those words. | SELECT T1.class_label, T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 315017 |
What is the oldest year that the location was at Guangzhou? | SELECT MIN(year) FROM table_name_1 WHERE location = "guangzhou" |
Show all director names who have a movie in both year 1999 and 2000. | SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999 |
Which professor is Oliy Spratling working with? Give the full name. | SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Oliy' AND T3.l_name = 'Spratling' |
what is highest num of component? | SELECT Num_of_Component FROM furniture order by Num_of_Component desc limit 1 |
Which Partner has a Score in Final of 6–1, 6–2? | SELECT partner FROM table_name_94 WHERE score_in_final = "6–1, 6–2" |
How long does student Linda Smith spend on the restaurant in total? | SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" |
what parties have at least three representatives | SELECT Party FROM representative GROUP BY Party HAVING COUNT ( * ) > = 3 |
Can you list the base price for all rooms? | SELECT basePrice FROM Rooms |
Among paragraphs with paragraph number between 1900 to 1950, list the texts said by a character described as a sea captain, friend to Sebatian. | SELECT T1.description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'a sea captain, friend to Sebastian' AND T2.ParagraphNum BETWEEN 1500 AND 1950 |
Count the number of video games with Massively multiplayer online game type . | SELECT count(*) FROM Video_games WHERE gtype = "Massively multiplayer online game" |
Which Points have a Score of 3–3, and a Date of november 11? | SELECT points FROM table_name_4 WHERE score = "3–3" AND date = "november 11" |
What is the most recent year that the Mineola Twins was nominated for outstanding actress in a play and a Drama Desk award? | SELECT MAX(year) FROM table_name_54 WHERE nominated_work = "the mineola twins" AND category = "outstanding actress in a play" AND award = "drama desk award" |
Where is the Xian ren Qiao (fairy bridge) located? | SELECT location FROM bridge WHERE name = "Xian Ren Qiao ( Fairy Bridge ) " |
How many years have a weeks at #1 value of exactly 8? | SELECT COUNT(year) FROM table_27441210_6 WHERE weeks_at__number1 = 8 |
Among the genes with nucleic acid metabolism defects, how many of them can be found in the vacuole? | SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'vacuole' AND T1.Phenotype = 'Nucleic acid metabolism defects' |
Which band has a current freq of 8tab (hpon)? | SELECT band FROM table_name_80 WHERE freq_currently = "8tab (hpon)" |
What is the highest rank of an athlete from Switzerland in a heat larger than 3? | SELECT MAX(rank) FROM table_name_54 WHERE heat > 3 AND nationality = "switzerland" |
What is the date the customer with last name Bernhard become a customer? | SELECT date_became_customer FROM Customers WHERE last_name = "Bernhard" |
Which party does Christopher Henderson Clark belong to? | SELECT T1.party FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name OR T2.middle_name OR T2.last_name = 'ChristopherHendersonClark' |
Find the total number of employees. | SELECT count(*) FROM employee |
Which team has Top division titles larger than 0, a Founded larger than 1927, and a Stadium of miguel grau? | SELECT team FROM table_name_69 WHERE top_division_titles > 0 AND founded > 1927 AND stadium = "miguel grau" |
Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff. | SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Sales Person" EXCEPT SELECT T1.staff_name , T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Clerical Staff" |
When 1995 is the year what is the open cup? | SELECT open_cup FROM table_1986692_1 WHERE year = "1995" |
How many exhibition are there in year 2005 or after? | SELECT count(*) FROM exhibition WHERE YEAR >= 2005 |
How many episodes were written by seth hoffman, russel friend & garrett lerner? | SELECT COUNT(rank__week_) FROM table_28026156_1 WHERE written_by = "Seth Hoffman, Russel Friend & Garrett Lerner" |
Which classroom has the most students? | SELECT classroom FROM list GROUP BY classroom ORDER BY count ( * ) DESC LIMIT 1 |
What is the most common major? | SELECT Major FROM Student group by Major order by count ( * ) desc limit 1 |
what was my savings amount balance? | Sorry, what is your customer id? | 1339 | SELECT * FROM savings WHERE custid = 1339 |
Sum of cuyo selection as the opposing team? | SELECT SUM(against) FROM table_name_86 WHERE opposing_team = "cuyo selection" |
Thank you for that! Can you show me the names of all colleges with an enrollment value that is greater than the total enrollment of all of the colleges in the state of FL? | SELECT cName FROM college |
What is the Right Ascension with a Diffuse Nebula Object Type has a °42′30″ Declination and a NGC less than 6995? | SELECT right_ascension___j2000__ FROM table_name_14 WHERE ngc_number < 6995 AND object_type = "diffuse nebula" AND declination___j2000__ = "°42′30″" |
What's the number & name for the date after 1954? | SELECT number_ & _name FROM table_name_28 WHERE date > 1954 |
Sort all the rooms according to the price. Just report the room names. | SELECT roomName FROM Rooms ORDER BY basePrice; |
What is the Year of the Film Belle of the Nineties? | SELECT year FROM table_name_22 WHERE film = "belle of the nineties" |
What is the function of 1.4 version of Windows live messenger? | SELECT function FROM table_18138132_2 WHERE version = "1.4" AND title = "Windows Live Messenger" |
What Away team had an Attendance of 3,395? | SELECT away_team FROM table_name_68 WHERE attendance = "3,395" |
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. | SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country; |
Who had the high points on February 6? | SELECT high_points FROM table_17311797_8 WHERE date = "February 6" |
Who was the gorham principal in 2010-2011? | SELECT gorham_principal FROM table_25037577_1 WHERE year = "2010-2011" |
Name the Rank points which have an Event of wc beijing, and Score points of 13, and a Total of 18? | SELECT rank_points FROM table_name_75 WHERE event = "wc beijing" AND score_points = "13" AND total = "18" |
Among the students with payment due, how many of them are unemployed? | SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos' |
Find all the policy types that are used by more than 2 customers. | SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2 |
List out the full name of employee who has birth day on "3/4/1955 12:00:00 AM". | SELECT FirstName, LastName FROM Employees WHERE BirthDate = '1955-03-04 00:00:00' |
Which League showed 7,975 for an average attendance? | SELECT league FROM table_name_20 WHERE attendance_average = "7,975" |
Name 10 products that were shipped first class from the East region. | SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Region = 'East' LIMIT 10 |
Which historical legislators are members of the National Greenbacker party? Write their first and last names. | SELECT T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'National Greenbacker' |
How many products have a price higher than the average? | SELECT count(*) FROM products WHERE product_price > (SELECT avg(product_price) FROM products) |
Tell me the call sign for frequency of 0 97.3 fm | SELECT call_sign FROM table_name_67 WHERE frequency = "0 97.3 fm" |
What are their birthdays? | SELECT distinct T1.birthday FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 |
What is the overall total for players drafted from notre dame? | SELECT SUM(overall) FROM table_name_25 WHERE college = "notre dame" |
What is game 9's record? | SELECT record FROM table_name_36 WHERE game = 9 |
Who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made? | SELECT T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.arrest = 'FALSE' GROUP BY T2.commander ORDER BY COUNT(T1.report_no) DESC LIMIT 1 |
What is the average rank of the match where offaly was the opposition and the total was greater than 9? | SELECT AVG(rank) FROM table_name_5 WHERE opposition = "offaly" AND total > 9 |
What is the place of plyaer Tim Herron from the United States with a to par of +1? | SELECT place FROM table_name_15 WHERE country = "united states" AND to_par = "+1" AND player = "tim herron" |
What is the name of this storm? | SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark' |
What is the Crowd for the Venue of Princes Park? | SELECT crowd FROM table_name_88 WHERE venue = "princes park" |
And where is that college located? | SELECT T1.city, T1.state, T1.country FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY count ( * ) DESC LIMIT 1 |
What is the most recent year that Gulf Racing Middle East won? | SELECT MAX(year) FROM table_name_91 WHERE team = "gulf racing middle east" |
Which word has the most appearances in the Wikipedia page revision ID No. 28278070? Give the word ID. | SELECT pid FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE revision = 28278070 ) ORDER BY occurrences DESC LIMIT 1 |
What is Ryan Goodwin's date of birth? | SELECT date_of_birth from Customers where first_name = "Rylan" AND last_name = "Goodwin" |
What are the top 10 customers' first and last names by total number of orders and how many orders did they make? | SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10; |
Show the number of all customers without an account. | SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts) |
What is the Tie no at the Hull City Home game with a Score of 1–1? | SELECT tie_no FROM table_name_80 WHERE score = "1–1" AND home_team = "hull city" |
Find the policy types more than 4 customers use. Show their type code. | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4 |
What is the course title of the prerequisite of course Mobile Computing? | SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'Mobile Computing') |
What is the number of the rank for the name of Chen Yan in a lane less than 2? | SELECT COUNT(rank) FROM table_name_89 WHERE name = "chen yan" AND lane < 2 |
Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires? | SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.IsReshare = 'TRUE' |
What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'? | SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure != "Handful" |
What was the date when the pitcher was Jason Marquis and the length was 410'? | SELECT date FROM table_name_69 WHERE pitcher = "jason marquis" AND length = "410'" |
What is the Total for the Player who won in 1936? | SELECT COUNT(total) FROM table_name_66 WHERE year_s__won = "1936" |
If the start (utc) is November 18, 2008 18:09, what is the name of the spacecraft? | SELECT spacecraft FROM table_22385461_9 WHERE start___utc__ = "November 18, 2008 18:09" |
Find the male friend of Alice whose job is a doctor? | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' |
what is the rank of adam gilchrist | SELECT COUNT(rank) FROM table_19870086_24 WHERE player = "Adam Gilchrist" |
What team has 102 Points against? | SELECT team FROM table_name_61 WHERE points_against = "102" |
What is the team 1 with nîmes olympique (d2) as team 2? | SELECT team_1 FROM table_name_66 WHERE team_2 = "nîmes olympique (d2)" |
Find the Yelp user with the average 5-star rating of all reviews who has been yelping the longest. | SELECT user_id FROM Users WHERE user_average_stars = 5 ORDER BY user_yelping_since_year ASC LIMIT 1 |
How many days did it take to end the work order "425"? | SELECT 365 * (STRFTIME('%Y', ActualEndDate) - STRFTIME('%Y', ActualStartDate)) + 30 * (STRFTIME('%m', ActualEndDate) - STRFTIME('%m', ActualStartDate)) + STRFTIME('%d', ActualEndDate) - STRFTIME('%d', ActualStartDate) FROM WorkOrderRouting WHERE WorkOrderID = 425 |
What are the names of ships, ordered by year they were built and their class? | SELECT name FROM ship ORDER BY built_year , CLASS |
What is the Record from February 10? | SELECT record FROM table_name_47 WHERE date = "february 10" |
How about for all employees with the role name "Human Resource"? | SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" |
What was the attendance when the opponent was virginia? | SELECT SUM(attendance) FROM table_name_96 WHERE opponent = "virginia" |
Which average Total has a Place smaller than 2, and a Draw smaller than 5? | SELECT AVG(total) FROM table_name_99 WHERE place < 2 AND draw < 5 |
How many followers do the most followed repository on Github have? Give the github address of the repository. | SELECT Forks, Url FROM Repo WHERE Forks = ( SELECT MAX(Forks) FROM Repo ) |
What player scored 70-72-70=212? | SELECT player FROM table_name_35 WHERE score = 70 - 72 - 70 = 212 |
What are the codes of all the courses that are located in room KLR209? | SELECT class_code FROM CLASS WHERE class_room = 'KLR209' |
Name the 1st match for brisbane bears | SELECT 1 AS st_match FROM table_name_61 WHERE team = "brisbane bears" |
How many loses does the team have that conceded 25 and won more than 6 games? | SELECT SUM(losses) FROM table_name_6 WHERE conceded = 25 AND wins > 6 |
What is the average Apr 2013 with a Jun 2011 less than 14? | SELECT AVG(apr_2013) FROM table_name_76 WHERE jun_2011 < 14 |
What country had the publication, Drowned in Sound? | SELECT country FROM table_name_22 WHERE publication = "drowned in sound" |
LIST THE DATES OF ENROLLMENT AND COMPLETION OF THE STUDENT WITH PERSONAL NAME "KARSON"? | 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.personal_name = "Karson" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.