sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the total and minimum enrollment of all schools?
SELECT sum(enrollment) , min(enrollment) FROM university
List down the app IDs under the category of game-Rowing .
SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Rowing'
Which skill is used in fixing the most number of faults ? List the skill id and description
SELECT T1.skill_id , T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY count ( * ) DESC LIMIT 1
List all content reviewed for podcast with the best rating under the 'fiction' category. State the podcast title.
SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.rating = 5 AND T1.category = 'fiction'
Show the delegates and the names of county they belong to.
SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
How many laps were there when the Time/Retired was +14.403?
SELECT laps FROM table_name_45 WHERE time_retired = "+14.403"
How many proteins are associated with an institution founded after 1880 or an institution with type "Private"?
SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'
What is the name of the course that has the most student enrollment?
SELECT T1.course_name FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC LIMIT 1
What are the names of all departments in alphabetical order?
SELECT dept_name FROM department ORDER BY dept_name
Who was the opponent when the fight had a time of 2:01?
SELECT opponent FROM table_name_71 WHERE time = "2:01"
Give me the names of members whose address is in Harford or Waterbury.
SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'
What are the names of all high schoolers in grade 10?
SELECT name FROM Highschooler WHERE grade = 10
Name the october when november is buffy tyler
SELECT october FROM table_name_17 WHERE november = "buffy tyler"
What is the id of the department with the least number of staff?
SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1
What is the name of Alice's friend?
SELECT friend from personfriend where name = "Alice"
Which Type has a Principal activities of health services?
SELECT type FROM table_name_28 WHERE principal_activities = "health services"
Count the number of rooms in Lamberton with capacity lower than 50.
SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50
What is the percentage of total orders of Stephen Payne that had a net profit of over 1000?
SELECT CAST(SUM(CASE WHEN REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') > 1000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Stephen Payne'
What is the description of the department whose name has the substring the computer?
SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
What is the best seller root beer brand and what is the average star rating for this root beer?
SELECT T1.BrandID, AVG(T1.StarRating) FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1
Which player is associated with the date July 6, 1949?
SELECT player FROM table_name_93 WHERE date = "july 6, 1949"
How many faculty is there in total in the year of 2002?
SELECT sum(faculty) FROM faculty WHERE YEAR = 2002
Of them which was launched most recently?
SELECT name FROM program ORDER BY launch DESC LIMIT 1
What is the score of the 2006 Fifa World Cup Qualification?
SELECT score FROM table_name_85 WHERE competition = "2006 fifa world cup qualification"
What is the average surface area of all countries?
SELECT AVG(SurfaceArea) FROM Country
what is the score on march 8?
SELECT score FROM table_name_40 WHERE date = "march 8"
What is the name with a Decile less than 10, and a Roll of 297?
SELECT name FROM table_name_55 WHERE decile < 10 AND roll = 297
What rank is Super Mario Land 2: 6 Golden Coins?
SELECT MIN(rank) FROM table_18590048_1 WHERE title = "Super Mario Land 2: 6 Golden Coins"
Name the years in orlando that the player from concord hs was in
SELECT years_in_orlando FROM table_15621965_10 WHERE school_club_team = "Concord HS"
What is the salary and name of the employee who has the least number of certificates on aircrafts with distance more than 5000?
SELECT T1.salary, T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count ( * ) ASC LIMIT 1
How many people hosted the show in the year when Chenoa ended up in fourth place?
SELECT COUNT(host) FROM table_1149495_1 WHERE fourth_place = "Chenoa"
Name all the organisations that were established from 1970 to 1980.
SELECT Name FROM organization WHERE STRFTIME('%Y', Established) BETWEEN '1970' AND '1980'
Which team has a match played of 10 4?
SELECT team FROM table_21824695_8 WHERE match_played = "10 4"
What Competition has a Year smaller than 1983?
SELECT competition FROM table_name_52 WHERE year < 1983
Between 1/1/2017 to 12/31/2017, how many users who were eligible for trial when they rated the movie "Patti Smith: Dream of Life"and what is the image URL to the movie on Mubi?
SELECT COUNT(T1.user_id), T2.movie_image_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE datetime(T1.rating_timestamp_utc) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 00:00:00'
What is the Away Team when the Home Team is Fulham?
SELECT away_team FROM table_name_26 WHERE home_team = "fulham"
Find the total quantity of products associated with the orders in the "Cancelled" status.
SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
What is the NHL team that has Peter Strom?
SELECT nhl_team FROM table_1013129_8 WHERE player = "Peter Strom"
What are the lowest number of points with a Year of 1978, and a Chassis of ensign n177?
SELECT MIN(points) FROM table_name_15 WHERE year = 1978 AND chassis = "ensign n177"
Tell me the week for pittsburgh steelers opponent
SELECT week FROM table_name_34 WHERE opponent = "pittsburgh steelers"
How many docks were left at the end station for trip ID4069?
SELECT SUM(T2.docks_available) FROM trip AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.end_station_id WHERE T1.ID = 4069
Among the immunizations in 2017, calculate the percentage of patients who received the Influenza seasonal injectable preservative free. Among them, how many patients are English?
SELECT CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient), SUM(CASE WHEN T1.ethnicity = 'english' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE strftime('%Y', T2.DATE) = '2017'
What is the status of the player who is moving to Nantes?
SELECT status FROM table_name_72 WHERE moving_to = "nantes"
What are the poles is #08 Miller racing?
SELECT poles FROM table_2190919_1 WHERE team_s_ = "#08 Miller Racing"
What are the famous title of the artists associated with volumes with more than 2 weeks on top?
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2
What was the score of game 4?
SELECT score FROM table_name_84 WHERE game = 4
If Dragon Souveniers, Ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to?
SELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Dragon Souveniers, Ltd.'
Which is the catching hand for the goaltender who had the most shutouts in 1996?
SELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1996 ORDER BY T2.SHO DESC LIMIT 1
What is the power play percentage of the team with the least number of penalty kill chances and to which team were they playing against? Indicate whether the team lost or victorious.
SELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1
How many Dates have a Builder of laconia car company, and a Number of 63-68?
SELECT COUNT(date) FROM table_name_8 WHERE builder = "laconia car company" AND number = "63-68"
Name the object element that is described as being scattered on image no. 10.
SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T4.ATT_CLASS = 'scattered' AND T1.IMG_ID = 10 GROUP BY T2.OBJ_CLASS
Find the total number of tours for each ranking date.
SELECT sum(tours) , ranking_date FROM rankings GROUP BY ranking_date
What is the average number of games of the player with a rank less than 1?
SELECT AVG(games) FROM table_name_55 WHERE rank < 1
What was the first year that the artist of every little thing ranked lower than 10?
SELECT MIN(year) FROM table_name_56 WHERE artist = "every little thing" AND rank < 10
Find the name and component amount of the least popular furniture.
SELECT name , Num_of_Component FROM furniture ORDER BY market_rate LIMIT 1
What are all the role codes, role names, and role descriptions?
SELECT role_code , role_name , role_description FROM ROLES
How many games were published by Acclaim Entertainment?
SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment'
Which player from "AFS" team has the tallest height?
SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'AFS' ORDER BY T1.height DESC LIMIT 1
How many laps associated with a Time/Retired of + 1:25.475?
SELECT COUNT(laps) FROM table_name_62 WHERE time_retired = "+ 1:25.475"
How many classes does the professor whose last name is Graztevski teach?
SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski'
List all the zip codes in the county of New Castle in Delaware.
SELECT DISTINCT T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T2.county = 'NEW CASTLE' AND T1.name = 'Delaware'
What is the Date when the label was alfa records, and a Catalog of alca-487?
SELECT date FROM table_name_61 WHERE label = "alfa records" AND catalog = "alca-487"
Who was the opponent on December 10, 2000?
SELECT opponent FROM table_name_36 WHERE date = "december 10, 2000"
Name the least 2 credits for flush
SELECT MIN(2 AS _credits) FROM table_148535_2 WHERE hand = "Flush"
What is the Elimination move listed against Regal?
SELECT elimination AS Move FROM table_name_28 WHERE wrestler = "regal"
What is the organisation details of Id 3? | Do you mean the organisation id of grant id 3? | yes
SELECT organisation_id FROM grants WHERE grant_id = 3
How many rooms are located for each block code?
SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode
Name the Date when has robert smith (7)?
SELECT date FROM table_name_8 WHERE winner__title__number_ = "robert smith (7)"
Which year had the most festivals?
SELECT year FROM festival_detail group by year order by count ( * ) desc limit 1
How many low-income countries under the lending category of the International Development Associations have a note on the series code SM.POP.TOTL?
SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.LendingCategory = 'IDA' AND T2.Seriescode = 'SM.POP.TOTL' AND IncomeGroup = 'Low income'
What are the id of songs whose format is mp3.
SELECT f_id FROM files WHERE formats = "mp3"
What NFL team did the Tight End position belong to?
SELECT nfl_team FROM table_name_62 WHERE position = "tight end"
How many universities scored 0 in Awards between 2005 to 2015?
SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0
How many sections does each course has?
SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code
What time/retired for grid 18?
SELECT time_retired FROM table_name_49 WHERE grid = 18
What is the percentage of athletes from Vanuatu who are taller than 175?
SELECT CAST(COUNT(CASE WHEN T3.height > 175 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Vanuatu'
Who was the opponent in the game with save ||33,389||87–62?
SELECT opponent FROM table_name_58 WHERE save = "||33,389||87–62"
What is the rank for the player with 5 wins and under 32 events?
SELECT SUM(rank) FROM table_name_52 WHERE wins = 5 AND events < 32
When mount gauttier is the peak what is the highest prominence in meters?
SELECT MAX(prominence__m_) FROM table_18946749_1 WHERE peak = "Mount Gauttier"
What's the highest attendance for a game the Texan's played at Arrowhead Stadium?
SELECT MAX(attendance) FROM table_name_87 WHERE game_site = "arrowhead stadium"
Which opponent was played at Forbes Field after week 4?
SELECT opponent FROM table_name_76 WHERE game_site = "forbes field" AND week > 4
How many news stations opened on the date of June 24, 2000?
SELECT _number_of_new_stations FROM table_1817879_2 WHERE date_opened = "June 24, 2000"
How many cards are credit cards?
SELECT count ( * ) FROM Customers_cards where card_type_code = "Credit"
What are the notes for bydgoszcz, Poland?
SELECT notes FROM table_name_37 WHERE venue = "bydgoszcz, poland"
What is Record, when Method is KO, and when Opponent is Rich Guerin?
SELECT record FROM table_name_99 WHERE method = "ko" AND opponent = "rich guerin"
Please list the full name and region of each employee in alphabetical order.
SELECT DISTINCT T1.FirstName, T1.LastName, T4.RegionDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID ORDER BY T1.FirstName
display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.
SELECT first_name , last_name , hire_date , salary , department_id FROM employees WHERE first_name NOT LIKE '%M%'
Which average rank has an Earning amount that is less than $224,589?
SELECT AVG(rank) FROM table_name_82 WHERE earnings__$__ < 224 OFFSET 589
What are the manager name and district of the shop that sells the largest number of products?
SELECT manager_name , district FROM shop ORDER BY number_products DESC LIMIT 1
What is the average age of all the artists from United States?
SELECT avg ( age ) from artist where country = 'United States'
What is the name of the museum that had no visitor yet?
SELECT name FROM museum WHERE Museum_ID NOT IN (SELECT museum_id FROM visit)
What is every score when the date is January 2?
SELECT score FROM table_28220778_21 WHERE date = "January 2"
Which are the rivers that flows to Black Sea?
SELECT Name FROM river WHERE Sea = 'Black Sea'
What is the largest mass(kg)?
SELECT MAX(mass__kg_) FROM table_1558077_2
How many degrees were conferred in "San Jose State University" in 2000?
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
State the name of the platforms for games released in 2000.
SELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000
What are the names, classes, and ranks of all captains?
SELECT name , CLASS , rank FROM captain
Name the number of team for 19th position
SELECT COUNT(team) FROM table_27666856_3 WHERE position_in_table = "19th"
Hmm, can you list the student ids with sports played?
SELECT stuID ,sportname FROM SportsInfo
What is the name of the shipping agent that shipped the smallest number of documents?
SELECT T1.shipping_agent_name FROM Ref_Shipping_Agents AS T1 JOIN Documents AS T2 ON T2.shipping_agent_code = T1.shipping_agent_code GROUP BY T1.shipping_agent_code ORDER BY count ( T2.document_id ) LIMIT 1