Question: Who authored the book with greatest number of pages?

SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.num_pages DESC LIMIT 1

Who authored the book with greatest number of pages ?


Question: List all the cities in Sumatra and state the population of each city.

SELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Name = 'Sumatra'

List all the cities in Sumatra and state the population of each city .

O O O O O B-VALUE B-COLUMN O O B-COLUMN O O B-COLUMN O


Question: What are the publishers who have published a book in both 1989 and 1990?

SELECT publisher FROM book_club WHERE YEAR  =  1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR  =  1990

What are the publishers who have published a book in both 1989 and 1990 ?

O O O B-COLUMN O O O O B-TABLE O O B-VALUE O B-VALUE O


Question: For the constructor which got the highest point in the race No. 9 , what is its introduction website?

SELECT T2.url FROM constructorResults AS T1 INNER JOIN constructors AS T2 ON T2.constructorId = T1.constructorId WHERE T1.raceId = 9 ORDER BY T1.points DESC LIMIT 1

For the constructor which got the highest point in the race No . 9 , what is its introduction website ?

O O B-TABLE O O O O B-COLUMN O O B-COLUMN O O B-VALUE O O O O O O O


Question: Is the payment in mastercard possible for the Yelp business No."12476"?

SELECT T1.attribute_value FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.business_id = 12476 AND T2.attribute_name = 'payment_types_mastercard'

Is the payment in mastercard possible for the Yelp business No . "12476 " ?

O O B-VALUE I-VALUE I-VALUE O O O O B-COLUMN O O B-VALUE O O


Question: Which countries have notes on the indicator BX.KLT.DINV.CD.WD?

SELECT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.Seriescode = 'BX.KLT.DINV.CD.WD'

Which countries have notes on the indicator BX.KLT.DINV.CD.WD ?


Question: Return the average number of units sold in millions among games played by players who have the position Guard.

SELECT avg(Units_sold_Millions) FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.Position  =  "Guard"

Return the average number of units sold in millions among games played by players who have the position Guard .

O O O O O B-COLUMN I-COLUMN I-COLUMN I-COLUMN O B-TABLE B-COLUMN O B-TABLE O O O B-COLUMN B-COLUMN O


Question: What is the full name of the customer who visited on the earliest date?

SELECT T1.FirstName ,  T1.LastName FROM customers AS T1 JOIN receipts AS T2 ON T1.id  =  T2.CustomerId ORDER BY T2.date LIMIT 1

What is the full name of the customer who visited on the earliest date ?

O O O O B-COLUMN O O B-TABLE O O O O O B-COLUMN O


Question: What is the description of the most popular role among users that have logged in?

SELECT role_description FROM ROLES WHERE role_code  =  (SELECT role_code FROM users WHERE user_login  =  1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)

What is the description of the most popular role among users that have logged in ?

O O O B-COLUMN O O O O B-TABLE O B-TABLE O O O O O


Question: Provide the phone number of the customer with the highest total price in an order.

SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1

Provide the phone number of the customer with the highest total price in an order .

O O B-COLUMN O O O B-TABLE O O O B-COLUMN I-COLUMN O O B-TABLE O


Question: Which region has the most number of sales team?

SELECT Region FROM `Sales Team` GROUP BY Region ORDER BY COUNT(DISTINCT `Sales Team`) DESC LIMIT 1

Which region has the most number of sales team ?

O B-COLUMN O O O O O B-COLUMN I-COLUMN O


Question: Display the first and last name, and salary for those employees whose first name is ending with the letter m.

SELECT first_name ,  last_name ,  salary FROM employees WHERE first_name LIKE '%m'

Display the first and last name , and salary for those employees whose first name is ending with the letter m.

O O O O B-COLUMN I-COLUMN O O B-COLUMN O O B-TABLE O B-COLUMN I-COLUMN O O O O O O


Question: Count the number of films.


Question: When did each artist who created less than 4 paintings die ?

select t1.deathyear from artists as t1 join paintings as t2 on t1.artistid  =  t2.painterid group by t2.painterid having count(*)  <  4

O O O B-TABLE O O O O B-VALUE B-TABLE O O


Question: Show the average, maximum, minimum enrollment of all schools.

SELECT avg(enrollment) ,  max(enrollment) ,  min(enrollment) FROM school

Show the average , maximum , minimum enrollment of all schools .


Question: Describe ID and active status of the business under category of "Diagnostic Imaging".

SELECT T2.business_id, T3.active FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Diagnostic Imaging'

Describe ID and active status of the business under category of " Diagnostic Imaging " .

O O O B-COLUMN O O O B-TABLE B-TABLE B-TABLE O O B-VALUE I-VALUE O O


Question: Among the teams that had more wins than loses in the year 2006, how many of them have over 100 points?

SELECT COUNT(tmID) FROM Teams WHERE year = 2006 AND W > L AND Pts > 100

Among the teams that had more wins than loses in the year 2006 , how many of them have over 100 points ?

O O B-TABLE O O O O O O O O B-COLUMN B-VALUE O O O O O O O B-VALUE B-COLUMN O


Question: Count the number of cinemas.


Question: For each classroom with at least 2 classes, how many classes are offered?

SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2

For each classroom with at least 2 classes , how many classes are offered ?

O O B-COLUMN O O O B-VALUE O O O O B-TABLE O O O


Question: Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111.

SELECT T2.name, T1.risk_category, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = '103111'

Provide the names , risk categories and descriptions for the eateries with violation type ID of 103111 .

O O B-COLUMN O B-COLUMN I-COLUMN O B-COLUMN O O O O B-TABLE B-COLUMN I-COLUMN O B-VALUE O


Question: What is the free rate for students between the ages of 5 and 17 at the school run by Kacey Gibson?

SELECT CAST(T2.`Free Meal Count (Ages 5-17)` AS REAL) / T2.`Enrollment (Ages 5-17)` FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.AdmFName1 = 'Kacey' AND T1.AdmLName1 = 'Gibson'

What is the free rate for students between the ages of 5 and 17 at the school run by Kacey Gibson ?

O O O O O O O O O O O O O O O O B-TABLE O O B-VALUE B-VALUE O


Question: What is the description of the club "Pen and Paper Gaming"?

SELECT clubdesc FROM club WHERE clubname  =  "Pen and Paper Gaming"

What is the description of the club " Pen and Paper Gaming " ?

O O O O O O B-TABLE O B-COLUMN I-COLUMN I-COLUMN I-COLUMN O O


Question: List the number of games that ended up with 5-0 in Greece.

SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0

List the number of games that ended up with 5 - 0 in Greece .

O O O O O O O O O B-VALUE O B-VALUE O B-VALUE O


Question: Which game has Jessica Carolina Aguilera Aguilera participated in? Give the id of the game.

SELECT T2.games_id FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Jessica Carolina Aguilera Aguilera'

Which game has Jessica Carolina Aguilera Aguilera participated in ? Give the i d of the game .

O B-COLUMN O B-VALUE I-VALUE I-VALUE I-VALUE O O O O O B-COLUMN I-COLUMN O O O O


Question: What is the number of professors who are in the Accounting or Biology departments?

SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE T2.dept_name  =  'Accounting' OR T2.dept_name  =  'Biology'

What is the number of professors who are in the Accounting or Biology departments ?

O O O O O B-TABLE O O O O B-VALUE O B-VALUE B-COLUMN O


Question: Count the matches with a total of two innings.

SELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2

Count the matches with a total of two innings .


Question: Please list all the categories of the Yelp_Business in Arizona.

SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.state LIKE 'AZ' GROUP BY T1.category_name

Please list all the categories of the Yelp_Business in Arizona .

O B-COLUMN I-COLUMN I-COLUMN B-TABLE O O B-TABLE B-COLUMN O O


Question: In the year 2000, which team has played the most games against the Buffalo Sabres?

SELECT T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.oppID = T2.tmID INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.tmID = T3.tmID WHERE T1.year = 2000 AND T2.name = 'Buffalo Sabres' GROUP BY T3.name ORDER BY SUM(T2.G) DESC LIMIT 1

In the year 2000 , which team has played the most games against the Buffalo Sabres ?

O O B-COLUMN B-VALUE O O B-TABLE O O B-TABLE I-TABLE B-COLUMN O O B-VALUE I-VALUE O


Question: Calculate the percentage of molecules containing carcinogenic compounds that element is hydrogen.

SELECT CAST(COUNT(CASE WHEN T1.element = 'h' AND T2.label = '+' THEN T2.molecule_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id

Calculate the percentage of molecules containing carcinogenic compounds that element is hydrogen .


Question: Please list any two clients with their full names who have been tagged as "Older American" by the company without seeking their permission.

SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Older American' AND T2.`Consumer consent provided?` IN (NULL, 'N/A', '') LIMIT 2

Please list any two clients with their full names who have been tagged as " Older American " by the company without seeking their permission .

O B-COLUMN O O B-TABLE O O O O O O O O B-COLUMN O B-VALUE I-VALUE O O O O O O O O O


Question: What is the first name and the last name of the customer who made the earliest rental?

SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1

What is the first name and the last name of the customer who made the earliest rental ?

O O O B-COLUMN I-COLUMN O O B-COLUMN I-COLUMN O O B-TABLE O O O O B-TABLE O


Question: For the players who had a 77 points overall rating on 2016/6/23, who was the oldest? Give the name of the player.

SELECT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-06-23' AND t2.overall_rating = 77 ORDER BY t1.birthday ASC LIMIT 1

For the players who had a 77 points overall rating on 2016/6/23 , who was the oldest ? Give the name of the player .

O O B-TABLE O O O B-VALUE O B-COLUMN I-COLUMN O B-VALUE O O O O O O O O O O O B-TABLE O


Question: Provide the district of the city with a population of 201843.

SELECT District FROM City WHERE population = 201843

Provide the district of the city with a population of 201843 .

O O B-COLUMN O O B-TABLE O O B-COLUMN O B-VALUE O


Question: Of the customers who are from Canada, how many used Federal Shipping?

SELECT COUNT(T3.CustomerID) FROM Shippers AS T1 INNER JOIN Orders AS T2 ON T1.ShipperID = T2.ShipVia INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T2.ShipName = 'Federal Shipping'

Of the customers who are from Canada , how many used Federal Shipping ?

O O B-TABLE O O O O O O O O B-VALUE B-COLUMN O


Question: Return the apartment number and the number of rooms for each apartment.

SELECT apt_number ,  room_count FROM Apartments

Return the apartment number and the number of rooms for each apartment .


Question: 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

What are the names of the scientists , and how many projects are each of them working on ?

O O O B-COLUMN O O B-COLUMN O O O O O O O O O O O O


Question: Count the number of different locations of hangars.

SELECT count(DISTINCT LOCATION) FROM hangar

Count the number of different locations of hangars .


Question: Provide business ids with opening hours 10AM on Saturday.

SELECT DISTINCT business_id FROM Business_Hours WHERE day_id = 6 AND opening_time = '10AM'

Provide business ids with opening hours 10AM on Saturday .

O B-COLUMN I-COLUMN O B-COLUMN O B-VALUE O O O


Question: By how much did the indicator on Adolescent fertility rate increase from 1960 to 1961 in the country whose Alpha2Code is 1A?

SELECT ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 ) DIFF

By how much did the indicator on Adolescent fertility rate increase from 1960 to 1961 in the country whose Alpha2Code is 1A ?

O O O O O B-TABLE O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE B-VALUE O B-VALUE O O B-TABLE O B-COLUMN O B-VALUE O


Question: Find the name of department has the highest amount of students?

SELECT dept_name FROM student GROUP BY dept_name ORDER BY count(*) DESC LIMIT 1

Find the name of department has the highest amount of students ?


Question: How many users answered "No" to question 19?

SELECT COUNT(QuestionID) FROM Answer WHERE QuestionID = 19 AND AnswerText LIKE 'No'

How many users answered " No " to question 19 ?

O O O B-TABLE O B-VALUE O O B-COLUMN B-VALUE O


Question: List the location cities in the Western states.

SELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA')

List the location cities in the Western states .


Question: 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 total number of deaths and damage for all storms with a max speed greater than the average ?

O O O O B-COLUMN I-COLUMN I-COLUMN O O O O B-TABLE O O B-COLUMN I-COLUMN O O O O O


Question: How many products with a thumpnail photo?

SELECT COUNT(ProductID) FROM ProductProductPhoto WHERE ProductPhotoID != 1

How many products with a thumpnail photo ?


Question: Display the number of 9-star votes the episode Sideshow received.

SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 9 AND T1.title = 'Sideshow'

Display the number of 9 - star votes the episode Sideshow received .

O O O O B-VALUE O B-COLUMN B-TABLE O B-TABLE B-VALUE O O


Question: Please list the names of the courses taken by Laughton Antonio.

SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.f_name = 'Laughton' AND T1.l_name = 'Antonio'

Please list the names of the courses taken by Laughton Antonio .

O O O B-COLUMN O O B-TABLE O O B-VALUE B-VALUE O


Question: Return the names of drivers who have driven vehicles with power over 5000.

SELECT DISTINCT T1.Name FROM driver AS T1 JOIN vehicle_driver AS T2 ON T1.driver_id  =  T2.driver_id JOIN vehicle AS T3 ON T2.vehicle_id  =  T3.vehicle_id WHERE T3.power  >  5000

Return the names of drivers who have driven vehicles with power over 5000 .

O O B-COLUMN O B-TABLE O O O B-TABLE O B-COLUMN O B-VALUE O


Question: How many 24 years old competitors competed in Men's Basketball?

SELECT COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id WHERE T3.event_name LIKE 'Basketball Men%s Basketball' AND T2.age = 24

How many 24 years old competitors competed in Men 's Basketball ?

O O B-VALUE O O B-COLUMN O B-VALUE I-VALUE I-VALUE I-VALUE O


Question: List the top 10 USA movies, by descending order, from the highest to the lowest, the user rating.

SELECT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' GROUP BY T1.movieid ORDER BY AVG(T1.rating) DESC LIMIT 10

List the top 10 USA movies , by descending order , from the highest to the lowest , the user rating .

O O O O B-VALUE B-TABLE O O O O O O O O O O O O O B-TABLE B-COLUMN O


Question: How many customers have an address that is located in the city of Villeneuve-la-Garenne?

SELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne'

How many customers have an address that is located in the city of Villeneuve - la - Garenne ?

O O O O O B-TABLE O O O O O B-COLUMN O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O


Question: What are the total quantities of the items ordered by customer 101660 on 10/5/1995?

SELECT SUM(T2.l_quantity) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1995-10-05' AND T1.o_custkey = 101660

What are the total quantities of the items ordered by customer 101660 on 10/5/1995 ?

O O O O B-COLUMN O O B-TABLE B-TABLE O B-COLUMN B-VALUE O O O


Question: How many songs appear in studio albums?

SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.type  =  "Studio"

How many songs appear in studio albums ?


Question: Calculate the percentage of penalty minutes of Swedish players in OHL league among all players.

SELECT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T2.PIM ELSE NULL END) AS REAL) * 100 / COUNT(*) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL'

Calculate the percentage of penalty minutes of Swedish players in OHL league among all players .

O O O O O O O B-VALUE B-TABLE I-TABLE B-VALUE B-COLUMN O O O O


Question: What is the longest server time when the call is about the issue of arbitration?

SELECT MAX(T1.ser_time) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.issue = 'Arbitration'

What is the longest server time when the call is about the issue of arbitration ?

O O O O B-COLUMN I-COLUMN O O O O O O B-COLUMN O B-VALUE O


Question: How many airlines operate out of each country in descending order?

SELECT country ,  count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC

How many airlines operate out of each country in descending order ?


Question: Please list all the years that Silverstone Circuit was used in a Formula_1 race.

SELECT DISTINCT T2.year FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Silverstone Circuit'

Please list all the years that Silverstone Circuit was used in a Formula_1 race .

O O O O B-COLUMN O B-VALUE B-TABLE O O O O O B-TABLE O


Question: How many reviews does 'LifeAfter/The Message' have which were rated below 3?

SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3

How many reviews does ' LifeAfter / The Message ' have which were rated below 3 ?

O O B-TABLE O O B-VALUE I-VALUE I-VALUE I-VALUE O O O O O O B-VALUE O


Question: What is the solution path for the method "IQ.Data.DbQueryProvider.CanBeEvaluatedLocally"?

SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'IQ.Data.DbQueryProvider.CanBeEvaluatedLocally'

What is the solution path for the method " IQ.Data . DbQueryProvider . CanBeEvaluatedLocally " ?

O O O B-TABLE B-COLUMN O O B-TABLE O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O O


Question: How many restricted horror movies were released between 1/1/1990 to 12/31/2015?

SELECT COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'R' AND genre = 'Horror' AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2015

How many restricted horror movies were released between 1/1/1990 to 12/31/2015 ?

O O O B-VALUE B-COLUMN B-COLUMN B-COLUMN O B-VALUE O O O


Question: List the details for all the pairs of teachers and students who are in the same class.

SELECT T1.teacher_details ,  T3.student_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id  =  T2.teacher_id JOIN Students AS T3 ON T2.student_id  =  T3.student_id

List the details for all the pairs of teachers and students who are in the same class .

O B-COLUMN I-COLUMN O O O O O B-TABLE O B-TABLE O O O O O B-TABLE O


Question: List the names of members that are not club leaders.

SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM club_leader)

List the names of members that are not club leaders .

O O B-COLUMN O B-TABLE O O O B-TABLE I-TABLE O


Question: How many recipes include the ingredient "graham cracker crumbs"?

SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs'

How many recipes include the ingredient " graham cracker crumbs " ?

O O O O O B-TABLE O B-VALUE I-VALUE I-VALUE O O


Question: Which venues and years did Mckeown , Kathleen have papers ?

select distinct t1.venue ,  t1.year from paper as t1 join author_list as t2 on t1.paper_id  =  t2.paper_id join author as t3 on t2.author_id  =  t3.author_id where t3.name = "mckeown ,  kathleen"

O B-COLUMN O B-COLUMN O B-COLUMN I-COLUMN I-COLUMN O B-TABLE O


Question: Show ids, status codes, and details for all invoices for clients.

SELECT invoice_id ,  invoice_status ,  invoice_details FROM Invoices

Show ids , status codes , and details for all invoices for clients .


Question: What is the name of the publisher of the book with the most pages?

SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.num_pages DESC LIMIT 1

What is the name of the publisher of the book with the most pages ?

O O O O O O B-TABLE O O B-TABLE O O O B-COLUMN O


Question: What are the users making only one search? List both category and user id.

SELECT T1.user_category_code ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  =  1;

What are the users making only one search ? List both category and user i d.

O O O B-TABLE O O O B-TABLE O O O B-COLUMN O B-COLUMN I-COLUMN I-COLUMN


Question: Find the total amount of loans offered by each bank branch.

SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname

Find the total amount of loans offered by each bank branch .

O O O B-COLUMN O B-TABLE O O O B-TABLE B-COLUMN O


Question: Which order of Logitech G600 MMO Gaming Mouse has the highest total cost?

SELECT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Logitech G600 MMO Gaming Mouse' GROUP BY T1.`Order ID` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1

Which order of Logitech G600 MMO Gaming Mouse has the highest total cost ?

O B-COLUMN O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O O O O O O


Question: Show all allergy types.

SELECT DISTINCT allergytype FROM Allergy_type


Question: How many coaches of the Montreal Canadiens have gotten in the Hall of Fame?

SELECT COUNT(DISTINCT hofID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens'

How many coaches of the Montreal Canadiens have gotten in the Hall of Fame ?

O O B-COLUMN O O B-VALUE I-VALUE O O O O O O B-COLUMN O


Question: What is the description of the film ACADEMY DINOSAUR?

SELECT description FROM film WHERE title = 'ACADEMY DINOSAUR'

What is the description of the film ACADEMY DINOSAUR ?

O O O B-COLUMN O O B-TABLE B-VALUE I-VALUE O


Question: List all patients with their sex and date of birthday, whose AST glutamic oxaloacetic transaminase (GOT) index is within normal range for loboratory examination in 1994.

SELECT DISTINCT T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT < 60 AND STRFTIME('%Y', T2.Date) = '1994'

List all patients with their sex and date of birthday , whose AST glutamic oxaloacetic transaminase ( GOT ) index is within normal range for loboratory examination in 1994 .

O O B-TABLE O O B-COLUMN O B-COLUMN O B-COLUMN O O O O O O O B-COLUMN O O O O O O O B-TABLE O O B-VALUE O


Question: Return the names and ages of pilors who have flown Piper Cub and are older than 35, or have flown the F-14 Fighter and are younger than 30.

SELECT pilot_name ,  age FROM pilotskills WHERE plane_name  =  'Piper Cub' AND age  >  35 UNION SELECT pilot_name ,  age FROM pilotskills WHERE plane_name  =  'F-14 Fighter' AND age  <  30

Return the names and ages of pilors who have flown Piper Cub and are older than 35 , or have flown the F-14 Fighter and are younger than 30 .

O O O O B-COLUMN O B-TABLE O O O B-VALUE I-VALUE O O O O B-VALUE O O O O O B-VALUE I-VALUE O O O O B-VALUE O


Question: How many types of music does Yelp business No."1141" have?

SELECT COUNT(T1.attribute_name) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 1141

How many types of music does Yelp business No . "1141 " have ?

O O O O O O O B-COLUMN O O B-VALUE O O O


Question: Find the city that hosted some events in the most recent year. What is the id of this city?

SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1

Find the city that hosted some events in the most recent year . What is the i d of this city ?

O O O O O O O O O O O B-COLUMN O O O O O O B-TABLE B-COLUMN I-COLUMN O


Question: Find the accreditation level that more than 3 phones use.

SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*)  >  3

Find the accreditation level that more than 3 phones use .

O O B-COLUMN I-COLUMN O O O B-VALUE B-TABLE O O


Question: How many shipments were ordered by a customer in Florida?

SELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state = 'FL'

How many shipments were ordered by a customer in Florida ?


Question: Which clubs have one or more members from the city with code "HOU"? Give me the names of the clubs.

SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t3.city_code  =  "HOU"

Which clubs have one or more members from the city with code " HOU " ? Give me the names of the clubs .

O B-TABLE B-COLUMN O O O O O O B-COLUMN I-COLUMN I-COLUMN O B-COLUMN O O O O O O O O O O


Question: Show all destinations and the number of flights to each destination.

SELECT destination ,  count(*) FROM Flight GROUP BY destination

Show all destinations and the number of flights to each destination .


Question: Calculate the percentage of bronze medals won by men's basketball players.

SELECT CAST(COUNT(CASE WHEN T4.medal_name = 'Bronze' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id INNER JOIN medal AS T4 ON T1.medal_id = T4.id WHERE T3.event_name LIKE 'Basketball Men%s Basketball'

Calculate the percentage of bronze medals won by men 's basketball players .

O O B-COLUMN O B-VALUE B-TABLE O B-VALUE I-VALUE I-VALUE I-VALUE O O


Question: How many clients who choose statement of weekly issuance are Owner?

SELECT COUNT(T2.account_id) FROM account AS T1 INNER JOIN disp AS T2 ON T2.account_id = T1.account_id WHERE T1.frequency = 'POPLATEK TYDNE' AND T2.type = 'OWNER'

How many clients who choose statement of weekly issuance are Owner ?


Question: Write down the award ID, award name and winner for character named "Homer simpson 20".

SELECT T1.award_id, T1.award, T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer Simpson' AND T1.result = 'Winner';

Write down the award ID , award name and winner for character named " Homer simpson 20 " .

O O O B-TABLE B-COLUMN O O O O B-VALUE O B-COLUMN O O B-VALUE B-COLUMN O O O


Question: How many students at the university earned a score of 90 in 2011?

SELECT COUNT(*) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 90 AND T1.year = 2011

How many students at the university earned a score of 90 in 2011 ?

O O O O O B-COLUMN B-COLUMN B-TABLE B-COLUMN O B-VALUE O B-VALUE O


Question: How many solutions are there whose respositories received the number of stars more than one third of the number of forks?

SELECT COUNT(DISTINCT T1.Id) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars > CAST(T1.Forks AS REAL) / 3

How many solutions are there whose respositories received the number of stars more than one third of the number of forks ?

O O B-TABLE O O O O O O O O B-COLUMN O O O O O O O O B-COLUMN O


Question: Among all the rivers finally flows to the sea of 540m in depth, which one has the longest length?

SELECT T2.Name FROM sea AS T1 INNER JOIN river AS T2 ON T2.Sea = T1.Name WHERE T1.Depth = 540 ORDER BY T2.Length DESC LIMIT 1

Among all the rivers finally flows to the sea of 540 m in depth , which one has the longest length ?

O O O B-TABLE O O O O B-COLUMN O B-VALUE O O B-COLUMN O O O O O O B-COLUMN O


Question: How many times did Boston Red Stockings lose in 2009 postseason?

SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year = 2009;

How many times did Boston Red Stockings lose in 2009 postseason ?

O O O O B-VALUE I-VALUE I-VALUE O O B-VALUE B-TABLE O


Question: How many girl students who are younger than 25?

SELECT count(*) FROM student WHERE sex  =  'F' AND age  <  25

How many girl students who are younger than 25 ?


Question: What are the names of all instructors with names that include "dar"?

SELECT name FROM instructor WHERE name LIKE '%dar%'

What are the names of all instructors with names that include " dar " ?

O O O B-COLUMN O O B-TABLE O O O O O B-VALUE O O


Question: What are the names of instructors who earn more than at least one instructor from the Biology department?

SELECT name FROM instructor WHERE salary  >  (SELECT min(salary) FROM instructor WHERE dept_name  =  'Biology')

What are the names of instructors who earn more than at least one instructor from the Biology department ?

O O O B-COLUMN O O O O O O O O O B-TABLE O O B-VALUE B-COLUMN O


Question: What are the dates of publications in descending order of price?

SELECT Publication_Date FROM publication ORDER BY Price DESC

What are the dates of publications in descending order of price ?


Question: What are the addresses of the inactive customers?

SELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0

What are the addresses of the inactive customers ?


Question: Give the full name of the divison that had the most 0-0 games.

SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1

Give the full name of the divison that had the most 0 - 0 games .

O O O B-COLUMN B-COLUMN I-COLUMN B-COLUMN O O O O B-VALUE O O O O


Question: Mention the status of payment of student 299.

SELECT bool FROM no_payment_due WHERE name = 'student299'

Mention the status of payment of student 299 .


Question: Return the total number of deaths and total damange in millions for storms that had 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)

Return the total number of deaths and total damange in millions for storms that had a max speed greater than the average .

O O O B-COLUMN I-COLUMN I-COLUMN O O B-COLUMN I-COLUMN I-COLUMN O B-TABLE O O O B-COLUMN I-COLUMN O O O O O


Question: Find all details for each swimmer.


Question: What are the names of the countries, ordered descending by overall score?

SELECT name FROM countries ORDER BY overall_score DESC

What are the names of the countries , ordered descending by overall score ?

O O O B-COLUMN O O B-TABLE O O O O B-COLUMN I-COLUMN O


Question: What are the invoice status, invoice details, and corresponding client ids and details and agency id and details?

SELECT T1.invoice_status ,  T1.invoice_details ,  T2.client_id ,  T2.client_details ,  T3.agency_id ,  T3.agency_details FROM Invoices AS T1 JOIN Clients AS T2 ON T1.client_id  =  T2.client_id JOIN Agencies AS T3 ON T2.agency_id  =  T3.agency_id

What are the invoice status , invoice details , and corresponding client ids and details and agency i d and details ?

O O O B-COLUMN I-COLUMN O B-TABLE B-COLUMN O O O B-TABLE B-COLUMN B-COLUMN I-COLUMN O B-TABLE I-TABLE B-COLUMN B-COLUMN I-COLUMN O


Question: How many of the non-sales employees are married?

SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'EM' AND T1.MaritalStatus = 'M'

How many of the non - sales employees are married ?


Question: For each building, return the address of the building and the name of the region it belongs to.

SELECT T1.Address ,  T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID

For each building , return the address of the building and the name of the region it belongs to .

O O B-TABLE O O O B-COLUMN O O O O O O O O B-TABLE O O O O


Question: For how many times had the dish "Chicken gumbo" appeared on a menu page?

SELECT SUM(CASE WHEN T1.name = 'Chicken gumbo' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id

For how many times had the dish " Chicken gumbo " appeared on a menu page ?

O O O O O O B-TABLE O B-VALUE I-VALUE O O B-COLUMN I-COLUMN I-COLUMN O O


Question: Show the phone number of the sanitarian who was responsible for inspection no.634597.

SELECT T2.phone FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 634597 AND T2.title = 'Sanitarian'

Show the phone number of the sanitarian who was responsible for inspection no.634597 .

O O B-COLUMN O O O B-VALUE O O O O B-TABLE B-VALUE O


Question: What are the titles and average ratings for all movies that have the lowest average rating?

SELECT T2.title ,  avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID GROUP BY T1.mID ORDER BY avg(T1.stars) LIMIT 1

What are the titles and average ratings for all movies that have the lowest average rating ?

O O O B-COLUMN O O O O O B-TABLE O O O O O B-TABLE O


Question: Give the number of students who have payment due.

SELECT COUNT(name) FROM no_payment_due WHERE bool = 'pos'

Give the number of students who have payment due .


Question: Among the players with finishing rate of 1, pick the eldest player and state the player's name.

SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.finishing = 1 ORDER BY t1.birthday ASC LIMIT 1

Among the players with finishing rate of 1 , pick the eldest player and state the player 's name .

O O O O B-COLUMN O O B-VALUE O O O O B-TABLE B-COLUMN B-TABLE O B-COLUMN I-COLUMN I-COLUMN O


Question: What is the number of the credit card that Frank-Paul Santangelo used to purchase root beers on 2014/7/7?

SELECT DISTINCT T2.CreditCardNumber FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07'

What is the number of the credit card that Frank - Paul Santangelo used to purchase root beers on 2014/7/7 ?

O O O O O O B-COLUMN I-COLUMN O B-VALUE I-VALUE I-VALUE B-VALUE O O O O O O B-VALUE O


Question: Show the date and venue of each workshop in ascending alphabetical order of the venue.

SELECT Date ,  Venue FROM workshop ORDER BY Venue

Show the date and venue of each workshop in ascending alphabetical order of the venue .

O O B-COLUMN O B-COLUMN O O B-TABLE O O O O O O O O


Question: Under the category name of "Coffee & Tea", mention any 5 business ID , their state and city.

SELECT T2.business_id, T3.state, T3.city FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Coffee & Tea' LIMIT 5

Under the category name of " Coffee & Tea " , mention any 5 business ID , their state and city .

O O B-TABLE B-COLUMN O O B-VALUE I-VALUE I-VALUE O O O O O B-TABLE B-COLUMN O O B-COLUMN O B-COLUMN O


Question: When was the oldest mythic card released and what are its legal play formats?

SELECT T1.originalReleaseDate, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal' ORDER BY T1.originalReleaseDate LIMIT 1

When was the oldest mythic card released and what are its legal play formats ?

O O O O B-VALUE B-TABLE B-COLUMN O O B-COLUMN I-COLUMN B-VALUE O B-COLUMN O


Question: How many cities are there in the country with the largest surface area?

SELECT T2.ID FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.SurfaceArea = ( SELECT MAX(SurfaceArea) FROM Country )

How many cities are there in the country with the largest surface area ?

O O B-TABLE O O O O B-TABLE O O O B-COLUMN I-COLUMN O


Question: How many students are in each department?

SELECT count(*) ,  dept_code FROM student GROUP BY dept_code

How many students are in each department ?


Question: Count the number of orders made from the store in city with population of 3000000 to 4000000.

SELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.Population BETWEEN 3000000 AND 4000000

Count the number of orders made from the store in city with population of 3000000 to 4000000 .

O O B-COLUMN B-TABLE I-TABLE O O O B-COLUMN B-TABLE O O B-COLUMN O B-VALUE O B-VALUE O


Question: Under the attribute name of "music_playlist", describe the attribute ID, business ID, city and inactive status.

SELECT T1.attribute_id, T2.business_id, T3.city FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'music_playlist' AND T3.active = 'false'

Under the attribute name of " music_playlist " , describe the attribute ID , business ID , city and inactive status .

O O B-TABLE B-COLUMN O O B-VALUE O O O O B-COLUMN I-COLUMN O B-TABLE B-COLUMN O B-COLUMN O B-COLUMN O O


Question: Find and list the names of districts which has below-average stars for Eagle Capital.

SELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id )

Find and list the names of districts which has below - average stars for Eagle Capital .

O O O O O O B-TABLE O O O O O B-COLUMN O B-VALUE I-VALUE O


Question: What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?

SELECT DISTINCT driverid ,  STOP FROM pitstops WHERE duration  <  (SELECT max(duration) FROM pitstops WHERE raceid  =  841)

What is the i d and stop number for each driver that has a shorter pit stop than the driver in the race with i d 841 ?

O O O O O O O O O O B-COLUMN O O O O B-TABLE B-COLUMN O O O O O B-COLUMN O O O B-VALUE O


Question: List the long name of countries with indicator name in 1980.

SELECT DISTINCT T1.LongName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Year = 1980 AND T2.IndicatorName IS NOT NULL

List the long name of countries with indicator name in 1980 .

O O B-COLUMN I-COLUMN O B-TABLE O B-TABLE B-COLUMN O B-VALUE O


Question: Among the members, how many of them have an extra large t-shirt size?

SELECT COUNT(member_id) FROM member WHERE position = 'Member' AND t_shirt_size = 'X-Large'

Among the members , how many of them have an extra large t - shirt size ?

O O B-VALUE O O O O O O O O B-VALUE B-COLUMN I-COLUMN I-COLUMN I-COLUMN O


Question: Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library?

SELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name IN ('Deering', 'Near West') AND T2.location_description = 'LIBRARY' GROUP BY T1.district_name ORDER BY COUNT(T2.district_no) DESC LIMIT 1

Between Deering and Near West districts , which district reported the most number of crime incidents that happened in a library ?

O B-VALUE O B-VALUE I-VALUE O O O B-TABLE O O O O O B-TABLE O O O O O B-VALUE O


Question: List all the products with lower than average cost.

SELECT DISTINCT T2.ProductID FROM ProductCostHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.StandardCost < ( SELECT SUM(StandardCost) / COUNT(ProductID) FROM Product )

List all the products with lower than average cost .

O O O B-TABLE B-TABLE O B-COLUMN I-COLUMN I-COLUMN O


Question: What is the difference in the number of bad alias between Aguada city and Aguadilla city?

SELECT COUNT(CASE WHEN T2.city = 'Aguada' THEN T1.bad_alias ELSE NULL END) - COUNT(CASE WHEN T2.city = 'Aguadilla' THEN T1.bad_alias ELSE NULL END) AS DIFFERENCE FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code

What is the difference in the number of bad alias between Aguada city and Aguadilla city ?

O O O O O O O O B-COLUMN I-COLUMN O B-VALUE O O B-VALUE B-COLUMN O


Question: List each donator name and the amount of endowment in descending order of the amount of endowment.

SELECT donator_name ,  sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC

List each donator name and the amount of endowment in descending order of the amount of endowment .

O O B-COLUMN I-COLUMN O O O O O O O O O O B-COLUMN O B-TABLE O


Question: How many artists have designed a card with a black border color and is available in both "arena" and "mtgo" printing type?

SELECT COUNT(CASE WHEN availability LIKE '%arena,mtgo%' AND borderColor = 'black' THEN 1 ELSE NULL END) FROM cards

How many artists have designed a card with a black border color and is available in both " arena " and " mtgo " printing type ?

O O O O O O B-TABLE O O B-VALUE B-COLUMN I-COLUMN O O B-COLUMN O O O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O O O O


Question: What year had the fewest conferences?

SELECT YEAR FROM conference GROUP BY YEAR ORDER BY count(*) LIMIT 1


Question: How many documents are with document type code BK for each product id?

SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_id

How many documents are with document type code BK for each product i d ?

O O B-TABLE O O B-COLUMN I-COLUMN I-COLUMN B-COLUMN O O B-COLUMN I-COLUMN I-COLUMN O


Question: How many credit cards does customer Blanche Huels have?

SELECT count(*) FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Blanche" AND T2.customer_last_name  =  "Huels" AND T1.card_type_code  =  "Credit"

How many credit cards does customer Blanche Huels have ?

O O B-COLUMN O O B-TABLE B-COLUMN B-COLUMN O O


Question: How many different engines are used by drivers with age older than 30 or younger than 20?

SELECT count(DISTINCT Engine) FROM driver WHERE Age  >  30 OR Age  <  20

How many different engines are used by drivers with age older than 30 or younger than 20 ?

O O O B-COLUMN O O O B-TABLE O B-COLUMN O O B-VALUE O O O B-VALUE O


Question: Show the church names for the weddings of all people older than 30.

SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id JOIN church AS T4 ON T4.church_id  =  T1.church_id WHERE T2.age  >  30 OR T3.age  >  30

Show the church names for the weddings of all people older than 30 .

O O B-TABLE B-COLUMN O O B-TABLE O O B-TABLE O O B-VALUE O


Question: How many bikes does each cyclist own? Order by cyclist id.

SELECT cyclist_id ,  count(*) FROM cyclists_own_bikes GROUP BY cyclist_id ORDER BY cyclist_id

How many bikes does each cyclist own ? Order by cyclist i d.

O O O O O B-TABLE I-TABLE O O O B-COLUMN I-COLUMN I-COLUMN


Question: Under what classification do the papers that cited word1163 belong?

SELECT DISTINCT T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1163'

Under what classification do the papers that cited word1163 belong ?


Question: Find the names of sailors whose rating is larger than the rating of all sailors who booked a red boat.

SELECT name FROM Sailors WHERE rating  >  (SELECT max(T1.rating) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid  =  T2.sid JOIN Boats AS T3 ON T3.bid  =  T2.bid WHERE T3.color  =  'red')

Find the names of sailors whose rating is larger than the rating of all sailors who booked a red boat .

O O B-COLUMN O B-TABLE O O O O O O B-COLUMN O O O O O O B-VALUE B-TABLE O


Question: Among all the current legislators born after the year 1960, how many of them are not google entities?

SELECT COUNT(*) FROM current WHERE strftime('%Y', birthday_bio) > '1960' AND google_entity_id_id IS NULL

Among all the current legislators born after the year 1960 , how many of them are not google entities ?

O O O B-TABLE O O O O O B-VALUE O O O O O O O B-COLUMN I-COLUMN O


Question: For the word "grec", what is the percentage of the appearances in the "Art" Wikipedia page have among all the appearances?

SELECT CAST(SUM(CASE WHEN T3.title = 'Art' THEN T2.occurrences ELSE 0 END) AS REAL) * 100 / SUM(T2.occurrences) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec'

For the word " grec " , what is the percentage of the appearances in the " Art " Wikipedia page have among all the appearances ?

O O B-COLUMN O B-VALUE O O O O O O O O O O O O B-VALUE O O B-TABLE O O O O O O


Question: How many businesses in Glendale city that are still running is opened from 8AM to 6PM?

SELECT COUNT(T1.category_name) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Glendale' AND T4.opening_time LIKE '8AM' AND T4.closing_time LIKE '6PM'

How many businesses in Glendale city that are still running is opened from 8AM to 6PM ?

O O B-TABLE O B-VALUE B-COLUMN O O O O O O O B-VALUE O B-VALUE O


Question: How many distinct president votes are recorded?

SELECT count(DISTINCT President_Vote) FROM VOTING_RECORD

How many distinct president votes are recorded ?

O O O B-COLUMN B-TABLE I-TABLE I-TABLE O


Question: Provide the related post title of "How to tell if something happened in a data set which monitors a value over time".

SELECT T3.Title FROM postLinks AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id INNER JOIN posts AS T3 ON T1.RelatedPostId = T3.Id WHERE T2.Title = 'How to tell if something happened in a data set which monitors a value over time'

Provide the related post title of " How to tell if something happened in a data set which monitors a value over time " .

O O B-COLUMN B-TABLE B-COLUMN O O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O O


Question: Who is the crime against criminal sexual abuse?

SELECT crime_against FROM FBI_Code WHERE title = 'Criminal Sexual Abuse'

Who is the crime against criminal sexual abuse ?

O O O B-COLUMN I-COLUMN B-VALUE I-VALUE I-VALUE O


Question: Find the number of distinct stages in claim processing.

SELECT count(*) FROM claims_processing_stages

Find the number of distinct stages in claim processing .


Question: How many members of club "Bootup Baltimore" are younger than 18?

SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Bootup Baltimore" AND t3.age  <  18

How many members of club " Bootup Baltimore " are younger than 18 ?

O O B-TABLE I-TABLE B-TABLE O B-COLUMN I-COLUMN O B-COLUMN O O B-VALUE O


Question: Provide the movie titles and the estimated inflation rate of the highest total grossed movie.

SELECT movie_title, CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) / CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) FROM movies_total_gross ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1

Provide the movie titles and the estimated inflation rate of the highest total grossed movie .

O O B-COLUMN I-COLUMN O O O B-COLUMN I-COLUMN I-COLUMN O B-TABLE B-COLUMN I-COLUMN O O


Question: Which dish has the longest history?

SELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1


Question: Return the channel code and contact number of the customer contact channel whose active duration was the longest.

SELECT channel_code ,  contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date  =  (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)

Return the channel code and contact number of the customer contact channel whose active duration was the longest .

O O B-COLUMN I-COLUMN O B-COLUMN I-COLUMN O O B-TABLE I-TABLE I-TABLE O B-COLUMN I-COLUMN O O O O


Question: Return the sum and average of all settlement amounts.

SELECT sum(settlement_amount) ,  avg(settlement_amount) FROM settlements

Return the sum and average of all settlement amounts .


Question: How many shipments were delivered by the oldest truck model?

SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id GROUP BY T1.model_year ORDER BY T1.model_year ASC LIMIT 1

How many shipments were delivered by the oldest truck model ?

O O B-TABLE O O O O O B-TABLE B-COLUMN O


Question: List out top 10 Spanish drivers who were born before 1982 and have the latest lap time.

SELECT T2.driverId FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'Spanish' AND STRFTIME('%Y', T2.dob) < '1982' ORDER BY T1.time DESC LIMIT 10

List out top 10 Spanish drivers who were born before 1982 and have the latest lap time .

O O O O B-VALUE B-TABLE O O O O B-VALUE O O O O O B-COLUMN O


Question: What is the name of the artist who joined latest?

SELECT name FROM artist ORDER BY year_join DESC LIMIT 1

What is the name of the artist who joined latest ?


Question: Give the annual revenue of the customer of ship ID 1047.

SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1047'

Give the annual revenue of the customer of ship ID 1047 .

O O B-COLUMN I-COLUMN O O B-TABLE O B-COLUMN I-COLUMN B-VALUE O


Question: Find the name and id of the top 3 expensive rooms.

SELECT RoomId ,  roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;

Find the name and i d of the top 3 expensive rooms .


Question: Find the product names that are colored 'white' but do not have unit of measurement "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"

Find the product names that are colored ' white ' but do not have unit of measurement " Handful " .

O O B-TABLE B-COLUMN O B-TABLE B-COLUMN O B-COLUMN O O O O O B-COLUMN I-COLUMN I-COLUMN O B-COLUMN O O


Question: In 1997, how many orders were shipped via mail?

SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL'

In 1997 , how many orders were shipped via mail ?

O B-VALUE O O O B-COLUMN O B-COLUMN O B-VALUE O


Question: How many of the unemployed students are disabled?

SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name

How many of the unemployed students are disabled ?


Question: What's the name of the second biggest desert?

SELECT Name FROM desert ORDER BY Area DESC LIMIT 1, 1

What 's the name of the second biggest desert ?


Question: What are the details for the projects which were launched by the organization with the most projects?

SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY count(*) DESC LIMIT 1 )

What are the details for the projects which were launched by the organization with the most projects ?

O O O O O O B-TABLE O O O O O B-COLUMN O O O B-COLUMN O


Question: What are the names of regions in which there are no buildings?

SELECT Name FROM region WHERE Region_ID NOT IN (SELECT Region_ID FROM building)

What are the names of regions in which there are no buildings ?

O O O B-COLUMN O B-TABLE O O O O O B-TABLE O


Question: How many times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode?

SELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id

How many times is the number of keywords in " Refuge : Part 1 " episode than " Shield " episode ?

O O B-COLUMN O O O O B-TABLE O O B-VALUE I-VALUE I-VALUE B-VALUE O O O O B-VALUE O B-TABLE O


Question: What are the names of gymnasts?

SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID


Question: Among the orders made by Aimee Bixby, how many of them included at least one kind of product under the category "Furniture"?

SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.Category = 'Furniture' AND T1.`Customer Name` = 'Aimee Bixby'

Among the orders made by Aimee Bixby , how many of them included at least one kind of product under the category " Furniture " ?

O O B-COLUMN I-COLUMN O B-VALUE I-VALUE O O O O O O O O O O O B-TABLE O O B-COLUMN O B-VALUE O O


Question: Provide the ward number with the highest population.

SELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1

Provide the ward number with the highest population .


Question: When did Mrs. Ira Deckow have the standard pregnancy test?

SELECT T2.date FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Ira' AND T1.last = 'Deckow' AND T2.description = 'Standard pregnancy test'

When did Mrs. Ira Deckow have the standard pregnancy test ?

O O B-VALUE B-VALUE B-VALUE O O B-VALUE I-VALUE I-VALUE O


Question: Find the names of the companies whose headquarters are not located in "USA".

SELECT name FROM Companies WHERE Headquarters != 'USA'

Find the names of the companies whose headquarters are not located in " USA " .

O O B-COLUMN O O B-TABLE O B-COLUMN O O O O O B-VALUE O O


Question: For the rides that started at Market at 10th station and ended at South Van Ness at Market station in August of 2013, which day had the coldest temperature?

SELECT T1.start_date FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' AND T2.min_temperature_f = ( SELECT MIN(T2.min_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' )

For the rides that started at Market at 10th station and ended at South Van Ness at Market station in August of 2013 , which day had the coldest temperature ?

O O O O B-COLUMN B-COLUMN B-VALUE I-VALUE I-VALUE O O O O B-VALUE I-VALUE I-VALUE I-VALUE B-COLUMN B-COLUMN I-COLUMN O O B-VALUE O O O O B-TABLE O B-COLUMN O


Question: How long was the longest minute delay caused by a weather problem in airport id 12264?

SELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1

How long was the longest minute delay caused by a weather problem in airport i d 12264 ?

O O O O O O O O O O B-COLUMN O B-COLUMN I-COLUMN I-COLUMN I-COLUMN B-VALUE O


Question: how many female dependents are there?

SELECT count(*) FROM dependent WHERE sex  =  'F'


Question: In what years were the clients who demanded more problems with Certificate of deposit born?

SELECT T1.year FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Sub-product` = '(CD) Certificate of deposit' GROUP BY T1.year ORDER BY COUNT(T1.year) DESC LIMIT 1

In what years were the clients who demanded more problems with Certificate of deposit born ?

O O B-COLUMN O O B-TABLE O O O O O B-VALUE I-VALUE I-VALUE O O


Question: What is the short description of the crime committed the most by criminals in the least populated community?

SELECT T3.title FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no GROUP BY T3.title ORDER BY T1.population ASC, T3.fbi_code_no DESC LIMIT 1

What is the short description of the crime committed the most by criminals in the least populated community ?

O O O O O O O B-TABLE O O O O O O O O B-COLUMN B-TABLE O


Question: Find the headphone models that are not in stock in any store.

SELECT model FROM headphone WHERE headphone_id NOT IN (SELECT headphone_id FROM stock)

Find the headphone models that are not in stock in any store .

O O B-TABLE B-COLUMN O O O O B-TABLE O O O O


Question: Please list the categories of the Yelp_Business that closes at 12PM on Sundays.

SELECT T4.category_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T4.category_id = T4.category_id WHERE T1.closing_time = '12PM' AND T2.day_of_week = 'Sunday' GROUP BY T4.category_name

Please list the categories of the Yelp_Business that closes at 12PM on Sundays .

O O O B-TABLE O O B-COLUMN O O O B-VALUE O B-TABLE O


Question: What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?

SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin ?

O O O O O O O O O O O O O B-COLUMN O O B-TABLE O B-VALUE O


Question: What are the names and number of hours spent training for each player who trains for less than 1500 hours?

SELECT pName ,  HS FROM Player WHERE HS  <  1500

What are the names and number of hours spent training for each player who trains for less than 1500 hours ?

O O O B-COLUMN O O O O O O O O B-TABLE O O O O O B-VALUE O O


Question: Which artist has id "16"? Provide her or his tag genre.

SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id = 16

Which artist has i d " 16 " ? Provide her or his tag genre .

O O O B-COLUMN I-COLUMN O B-VALUE O O O O O O B-COLUMN O O


Question: Count the number of students the teacher LORIA ONDERSMA teaches.

SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA"

Count the number of students the teacher LORIA ONDERSMA teaches .

O O O O O O O B-COLUMN B-COLUMN B-TABLE O


Question: Find the total number of employees.


Question: List the distinct carriers of phones with memories bigger than 32.

SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G  >  32

List the distinct carriers of phones with memories bigger than 32 .

O O O B-COLUMN O B-TABLE O B-COLUMN O O B-VALUE O


Question: How many boats are red?

SELECT count(*) FROM Boats WHERE color  =  'red'


Question: What are the movie names sorted by rating?

SELECT title FROM movies ORDER BY rating

What are the movie names sorted by rating ?


Question: Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country.

SELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1

Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961 ? Indicate how much is its land area in square kilometers in those years and the income group of the country .

O B-TABLE O O O O O O O O O B-VALUE O O O O B-COLUMN B-VALUE O B-TABLE O O O O B-VALUE I-VALUE I-VALUE O O O O O O O B-COLUMN I-COLUMN O O B-COLUMN O


Question: Please list the coach IDs who received the award twice from 1970 to 1990.

SELECT coachID FROM awards_coaches WHERE year BETWEEN 1970 AND 1990 GROUP BY coachID, award HAVING COUNT(award) = 2

Please list the coach IDs who received the award twice from 1970 to 1990 .

O O O B-COLUMN I-COLUMN O O O B-COLUMN O O B-VALUE O B-VALUE O


Question: Which free app has the most Negative comments?

SELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Type = 'Free' AND T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY COUNT(T2.Sentiment) DESC LIMIT 1

Which free app has the most Negative comments ?


Question: For all authors from CA who are not on contract, which title of his/hers has the most year to date sales.

SELECT T1.title FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0 AND T3.state = 'CA' ORDER BY T1.ytd_sales DESC LIMIT 1

For all authors from CA who are not on contract , which title of his / hers has the most year to date sales .

O O B-TABLE O B-VALUE O O O O B-COLUMN O O B-COLUMN O O O O O O O O O B-COLUMN B-COLUMN O


Question: Find details of the services that no customer has ever used . Return the service details .

select service_details from services except select t2.service_details from customers_and_services as t1 join services as t2 on t1.service_id  =  t2.service_id

O O O O B-TABLE O O B-TABLE I-TABLE I-TABLE O O O O B-COLUMN B-COLUMN O


Question: What is the 12th business's first line address?

SELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T2.BusinessEntityID = 12

What is the 12th business 's first line address ?

O O O B-VALUE B-COLUMN B-TABLE I-TABLE I-TABLE B-TABLE O


Question: What are the most popular confections product and calculate the total sales generated by this product?

SELECT COUNT(T1.UnitPrice * T3.Quantity) FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID INNER JOIN `Order Details` AS T3 ON T1.ProductID = T3.ProductID WHERE T2.CategoryName = 'Confections' GROUP BY T3.Quantity ORDER BY T3.Quantity DESC LIMIT 1

What are the most popular confections product and calculate the total sales generated by this product ?

O O O O O B-VALUE B-COLUMN O O O O O O O O B-TABLE O


Question: Give the object number of the sample which has the relationship of "lying on" with object sample no.1 from image no.2345524.

SELECT T2.OBJ1_SAMPLE_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345524 AND T1.PRED_CLASS = 'lying on' AND T2.OBJ2_SAMPLE_ID = 1

Give the object number of the sample which has the relationship of " lying on " with object sample no.1 from image no.2345524 .

O O O O O O O O O O O O O B-VALUE I-VALUE O O B-COLUMN I-COLUMN O O B-TABLE B-VALUE O


Question: Find all the distinct district names ordered by city area in descending.

SELECT DISTINCT District_name FROM district ORDER BY city_area DESC

Find all the distinct district names ordered by city area in descending .

O O O O B-TABLE B-COLUMN O O B-COLUMN I-COLUMN O O O


Question: Give me the biggest and average areas of all districts.

SELECT max(area_km) ,  avg(area_km) FROM district

Give me the biggest and average areas of all districts .


Question: What is the ratio of good to bad business star for a businesses that are opened all the time?

SELECT CAST(SUM(CASE WHEN T1.stars BETWEEN 3.5 AND 5 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.stars BETWEEN 1 AND 2.5 THEN 1 ELSE 0 END) AS ratio FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id

What is the ratio of good to bad business star for a businesses that are opened all the time ?

O O O O O O O O B-TABLE B-COLUMN O O B-TABLE O O O O O O O


Question: Provide the products list which were ordered in 1996 by the company in Norway.

SELECT T4.ProductName FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID INNER JOIN Products AS T4 ON T3.ProductID = T4.ProductID WHERE T1.Country = 'Norway' AND STRFTIME('%Y', T2.OrderDate) = '1996'

Provide the products list which were ordered in 1996 by the company in Norway .

O O B-TABLE O O O B-TABLE B-TABLE B-VALUE O O O O B-VALUE O


Question: What was the cost for the "Posters" on 2019/9/4?

SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'

What was the cost for the " Posters " on 2019/9/4 ?

O O O B-COLUMN O O O B-VALUE O O B-VALUE O


Question: List all different headphone models in the alphabetical order.

SELECT DISTINCT model FROM headphone ORDER BY model

List all different headphone models in the alphabetical order .


Question: What is the title and id of the film that has the greatest number of copies in inventory?

SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1

What is the title and i d of the film that has the greatest number of copies in inventory ?

O O O B-COLUMN O O O O O B-TABLE O O O O O O O O B-TABLE O


Question: What is the event sponsored by the Republican House?

SELECT event FROM Menu WHERE sponsor = 'REPUBLICAN HOUSE'

What is the event sponsored by the Republican House ?

O O O B-COLUMN B-COLUMN O O B-VALUE I-VALUE O


Question: Please indicate the names of customers whose orders are eligible for 10% discount with order dates between 1/1/1994 and 1/1/1995.

SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey WHERE T2.l_discount = 0.1 AND STRFTIME('%Y', T1.o_orderdate) BETWEEN 1994 AND 1995

Please indicate the names of customers whose orders are eligible for 10 % discount with order dates between 1/1/1994 and 1/1/1995 .

O B-TABLE O B-COLUMN O B-TABLE O B-TABLE O O O O B-VALUE B-COLUMN O B-COLUMN B-COLUMN O B-VALUE O B-VALUE O


Question: Give the name and phone number of the customers who have more than 9000 account balance.

SELECT c_name, c_phone FROM customer WHERE c_acctbal > 9000

Give the name and phone number of the customers who have more than 9000 account balance .

O O B-COLUMN O B-COLUMN O O O B-TABLE O O O O B-VALUE B-COLUMN I-COLUMN O


Question: Calculate the difference between the number of root beers sold that use cane sugar and corn syrup.

SELECT COUNT(CASE WHEN T3.CaneSugar = 'TRUE' THEN T1.BrandID ELSE NULL END) - COUNT(CASE WHEN T3.CornSyrup = 'TRUE' THEN T1.BrandID ELSE NULL END) AS DIFFERENCE FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID

Calculate the difference between the number of root beers sold that use cane sugar and corn syrup .

O O O O O O O B-TABLE I-TABLE O O O B-COLUMN I-COLUMN B-COLUMN B-COLUMN I-COLUMN O


Question: What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo?

SELECT T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.villian = 'Turbo'

What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo ?

O O O O O O O O B-COLUMN O O B-COLUMN O O B-COLUMN O B-VALUE O


Question: What are the products that people who were born after 2005 complain about?

SELECT DISTINCT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year > 2005

What are the products that people who were born after 2005 complain about ?

O O O B-COLUMN O O O O O O B-VALUE O O O


Question: What is the location of business number 1?

SELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 USING (AddressID) WHERE T2.BusinessEntityID = 1

What is the location of business number 1 ?


Question: According to all the observations of Elly Koss, what was her average weight?

SELECT AVG(T2.VALUE), T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Weight'

According to all the observations of Elly Koss , what was her average weight ?

O O O O B-TABLE O B-VALUE B-VALUE O O O O O B-VALUE O


Question: Give the category description of the age category 'Over 60'.

SELECT age_category_description FROM Ref_Age_Categories WHERE age_category_code  =  'Over 60';

Give the category description of the age category ' Over 60 ' .

O O B-COLUMN I-COLUMN O O B-COLUMN I-COLUMN O B-VALUE I-VALUE O O


Question: Which press has the largest monthly profit? Give me the press name.

SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1

Which press has the largest monthly profit ? Give me the press name .

O B-TABLE O O O B-COLUMN I-COLUMN O O O O O B-COLUMN O


Question: List the order for all in-store sales along with the products sold.

SELECT DISTINCT T1.OrderNumber, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Sales Channel` = 'In-Store'

List the order for all in - store sales along with the products sold .

O B-TABLE B-COLUMN O O B-VALUE I-VALUE I-VALUE B-COLUMN I-COLUMN O O B-TABLE O O


Question: Which station did the user who started at Market at 4th station ended their trip at the time of 12:45:00 PM and the date of 8/29/2013 and what is the location coordinates of the ending station?

SELECT T1.name, T1.lat, T1.long FROM station AS T1 INNER JOIN trip AS T2 ON T2.end_station_name = T1.name WHERE T2.start_station_name = 'Market at 4th' AND T2.end_date = '8/29/2013 12:45'

Which station did the user who started at Market at 4th station ended their trip at the time of 12:45:00 PM and the date of 8/29/2013 and what is the location coordinates of the ending station ?

O O O O O O O O B-VALUE I-VALUE I-VALUE B-TABLE B-COLUMN O B-TABLE B-COLUMN O O O O O O O B-COLUMN O B-VALUE O O O O O O O O B-COLUMN I-COLUMN O


Question: Which Zaire region is home to the country's deepest lake's Name it and list its depth.

SELECT T3.Name, T1.Name, T1.Depth FROM lake AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T4.Name = 'Zaire'

Which Zaire region is home to the country 's deepest lake 's Name it and list its depth .

O B-VALUE O O O O O B-COLUMN O O B-COLUMN O B-COLUMN O O O O B-COLUMN O


Question: What are the life spans of representatives from New York state or Indiana state?

SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"

What are the life spans of representatives from New York state or Indiana state ?

O O O B-COLUMN I-COLUMN O B-TABLE O B-COLUMN I-COLUMN O O B-COLUMN B-COLUMN O


Question: What are the delegate and name of the county they belong to, for each county?

SELECT T2.Delegate ,  T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District

What are the delegate and name of the county they belong to , for each county ?

O O O B-COLUMN O O O O B-TABLE O O O O O O O O


Question: What is the first year a game is released?

SELECT MIN(T.release_year) FROM game_platform t

What is the first year a game is released ?


Question: Count the good female superheroes.

SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN alignment AS T2 ON T1.alignment_id = T2.id INNER JOIN gender AS T3 ON T1.gender_id = T3.id WHERE T2.alignment = 'Good' AND T3.gender = 'Female'


Question: What is the total number of customers with an age below 30?

SELECT COUNT(ID) FROM Customers WHERE age < 30

What is the total number of customers with an age below 30 ?

O O O O O O B-TABLE O O B-COLUMN O B-VALUE O


Question: Find the names of all stores in Khanewal District.

SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t3.district_name  =  "Khanewal District"

Find the names of all stores in Khanewal District .

O B-COLUMN I-COLUMN O O B-TABLE B-COLUMN B-COLUMN B-TABLE O


Question: Provide hockey's sport id.

SELECT id FROM sport WHERE sport_name = 'Hockey'


Question: What are the types of video games and how many are in each type?

SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype

What are the types of video games and how many are in each type ?

O O O O O B-TABLE I-TABLE O O O O O O B-COLUMN O


Question: Give me the detention start date for all the detention records.

SELECT datetime_detention_start FROM Detention

Give me the detention start date for all the detention records .

O O B-COLUMN I-COLUMN I-COLUMN O O O O B-TABLE O O


Question: Among the students with a gpa of 3.1 to 3.7, how many of them are undergraduate students?

SELECT COUNT(student_id) FROM student WHERE gpa BETWEEN 3.1 AND 3.7 AND type = 'UG'

Among the students with a gpa of 3.1 to 3.7 , how many of them are undergraduate students ?

O O B-COLUMN O O B-COLUMN O B-VALUE O B-VALUE O O O O O O O B-TABLE O


Question: How many complaints have the client Diesel Galloway filed?

SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Diesel' AND T1.last = 'Galloway'

How many complaints have the client Diesel Galloway filed ?


Question: List all the information about course authors and tutors in alphabetical order of the personal name.

SELECT * FROM Course_Authors_and_Tutors ORDER BY personal_name

List all the information about course authors and tutors in alphabetical order of the personal name .

O O O O O B-TABLE I-TABLE I-TABLE I-TABLE O O O O O B-COLUMN I-COLUMN O


Question: What is the price for the AWC Logo Cap?

SELECT T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'AWC Logo Cap'

What is the price for the AWC Logo Cap ?

O B-COLUMN I-COLUMN I-COLUMN O O B-VALUE I-VALUE I-VALUE O


Question: List out dates when haze is recorded in store 35.

SELECT T1.`date` FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 35 AND T1.codesum LIKE '%' OR 'HZ' OR '%'

List out dates when haze is recorded in store 35 .

O O B-COLUMN O B-VALUE O O O B-COLUMN B-VALUE O


Question: Sum the total price of the orders for The Prophet book.

SELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id WHERE T2.title = 'The Prophet'

Sum the total price of the orders for The Prophet book .

O O B-COLUMN B-COLUMN O O B-TABLE O B-VALUE I-VALUE B-TABLE O


Question: What is the total units of products sold on the day with the highest max temperature in store no.3 in 2012?

SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.`date` LIKE '%2012%' GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1

What is the total units of products sold on the day with the highest max temperature in store no.3 in 2012 ?

O O O O B-COLUMN O O O O B-TABLE O O O O B-COLUMN O O B-COLUMN O O B-VALUE O


Question: How many quantities of Advantus plastic paper clips were ordered overall?

SELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Advantus Plastic Paper Clips'

How many quantities of Advantus plastic paper clips were ordered overall ?

O O B-COLUMN O B-VALUE I-VALUE I-VALUE I-VALUE O O O O


Question: Which cities have higher temperature in Feb than in Jun or have once served as host cities?

SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city

Which cities have higher temperature in Feb than in Jun or have once served as host cities ?

O B-TABLE O O B-TABLE O B-COLUMN O O B-COLUMN O O O O O B-COLUMN B-COLUMN O


Question: For the 1998 movie which got the highest popularity, how many "4" rating did the movie get?

SELECT COUNT(T2.movie_title) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 4 AND T2.movie_release_year = 1998 ORDER BY T2.movie_popularity DESC LIMIT 1

For the 1998 movie which got the highest popularity , how many " 4 " rating did the movie get ?

O O B-VALUE B-TABLE O O O O B-COLUMN O O O O B-VALUE O B-TABLE O O O O O


Question: What is the ratio of the number of app users that belong to the Securities category to the number of app users that belong to the Finance category?

SELECT SUM(IIF(T2.category = 'Securities', 1, 0)) / SUM(IIF(T2.category = 'Finance', 1, 0)) AS per FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id

What is the ratio of the number of app users that belong to the Securities category to the number of app users that belong to the Finance category ?

O O O O O O O O O O O O O O B-VALUE O O O O O O O O O O O B-VALUE B-COLUMN O


Question: Find the number of investors in total.


Question: What is the difference between the number of votes for 1-star vs. 10-star for the episode "The Burns and the Bees"?

SELECT SUM(CASE WHEN T2.stars = 10 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T2.stars = 1 THEN T2.votes ELSE 0 END) AS Difference FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'The Burns and the Bees';

What is the difference between the number of votes for 1 - star vs. 10 - star for the episode " The Burns and the Bees " ?

O O O O O O O O B-TABLE O B-VALUE O B-COLUMN O B-VALUE O O O O B-TABLE O B-VALUE I-VALUE I-VALUE I-VALUE I-VALUE O O


Question: How many books did A.R. Braunmuller write?

SELECT COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id WHERE T1.author_name = 'A.R. Braunmuller'

How many books did A.R. Braunmuller write ?


Question: what is the GDP of the city with the largest population.

SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1

what is the GDP of the city with the largest population .

O O O B-COLUMN O O B-TABLE O O O B-COLUMN O


Question: How many white bordered cards are powerful?

SELECT COUNT(id) FROM cards WHERE borderColor = 'white' AND cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL

How many white bordered cards are powerful ?


Question: List the names of hosts who did not serve as a host of any party in our record.

SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host)

List the names of hosts who did not serve as a host of any party in our record .

O O B-COLUMN O O O O O O O O B-TABLE O O B-TABLE O O O O


Question: Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.

SELECT T2.name ,  T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project  =  T2.code JOIN scientists AS T3 ON T1.scientist  =  T3.SSN WHERE T2.hours  =  (SELECT min(hours) FROM projects)

Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it .

O O O O B-COLUMN O O O O O O O O O O O B-COLUMN O B-COLUMN O O O O O


Question: From which cities are the customers who gave 5 stars in their reviews in November 2012?

SELECT DISTINCT T1.City FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 5 AND T2.ReviewDate BETWEEN '2012-11-01' AND '2012-11-30'

From which cities are the customers who gave 5 stars in their reviews in November 2012 ?

O O B-COLUMN O O B-TABLE O O B-VALUE B-COLUMN I-COLUMN B-TABLE B-COLUMN O O O O


Question: Calculate the difference in view count from post posted by Mornington and view count from posts posted by Amos.

SELECT SUM(IIF(T1.DisplayName = 'Mornington', T3.ViewCount, 0)) - SUM(IIF(T1.DisplayName = 'Amos', T3.ViewCount, 0)) AS diff FROM users AS T1 INNER JOIN postHistory AS T2 ON T1.Id = T2.UserId INNER JOIN posts AS T3 ON T3.Id = T2.PostId

Calculate the difference in view count from post posted by Mornington and view count from posts posted by Amos .

O O O O O O O O B-COLUMN O B-VALUE O B-COLUMN I-COLUMN O B-TABLE O O B-VALUE O


Question: Among the patients with a normal Ig G level, how many of them have symptoms?

SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL

Among the patients with a normal Ig G level , how many of them have symptoms ?

O O B-TABLE O O O B-COLUMN I-COLUMN O O O O O O O B-COLUMN O


Question: Which tourist attractions does the visitor with detail 'Vincent' visit?

SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID  =  T3.Tourist_ID WHERE T3.Tourist_Details  =  "Vincent"

Which tourist attractions does the visitor with detail ' Vincent ' visit ?

O B-COLUMN B-TABLE O O B-TABLE B-COLUMN I-COLUMN O B-COLUMN O B-TABLE O


Question: For each user, return the name and the average rating of reviews given by them.

SELECT T1.name ,  avg(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id  =  T2.u_id GROUP BY T2.u_id

For each user , return the name and the average rating of reviews given by them .

O O B-TABLE O O O B-COLUMN O O O B-COLUMN O B-TABLE O O O O


Question: Find the average price for each headphone construction.

SELECT construction ,  avg(price) FROM headphone GROUP BY construction

Find the average price for each headphone construction .


Question: How many games are played for all football games by students on scholarship?

SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y'

How many games are played for all football games by students on scholarship ?

O O B-COLUMN I-COLUMN I-COLUMN O O B-COLUMN O B-VALUE O B-COLUMN I-COLUMN O


Question: On average, how many community areas are there in a side?

SELECT CAST(COUNT(T1.ward_no) AS REAL) / COUNT(DISTINCT T3.side) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no

On average , how many community areas are there in a side ?

O O O O O B-TABLE I-TABLE O O O O B-COLUMN O


Question: List down the labels' IDs and categories of the app ID "5758400314709850000".

SELECT T1.label_id, T2.category FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T1.app_id = 5758400314709850000

List down the labels ' IDs and categories of the app ID " 5758400314709850000 " .

O O O B-COLUMN I-COLUMN I-COLUMN O B-COLUMN O O B-COLUMN I-COLUMN O B-VALUE O O


Question: Return name and age for sailors who are younger than 30.

SELECT name ,  age FROM Sailors WHERE age  <  30

Return name and age for sailors who are younger than 30 .

O B-COLUMN O B-COLUMN O B-TABLE O O O O B-VALUE O


Question: Please list the location coordinates of the US circuits.

SELECT lat, lng FROM circuits WHERE country = 'USA'

Please list the location coordinates of the US circuits .


Question: List the names of drivers that do not participate in any race.

SELECT Driver_Name FROM driver WHERE Driver_ID NOT IN (SELECT Driver_ID FROM race)

List the names of drivers that do not participate in any race .


Question: 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

How many services has each resident requested ? List the resident i d , details , and the count in descending order of the count .

O O O O O O O O O O B-TABLE B-COLUMN I-COLUMN O B-COLUMN O O O O O O O O O O O


Question: Indicate the name of the product that is close to being sold out and that has the lowest cost price.

SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty < 10 ORDER BY T2.ps_supplycost LIMIT 1

Indicate the name of the product that is close to being sold out and that has the lowest cost price .

O O B-COLUMN O O O O O O O O O O O O O O O O O O


Question: How many orders has Cordy Dumbarton made?

SELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Cordy' AND T1.last_name = 'Dumbarton'

How many orders has Cordy Dumbarton made ?


Question: Find the capacity and gender type of the dorm whose name has substring ‘Donor’.

SELECT student_capacity ,  gender FROM dorm WHERE dorm_name LIKE '%Donor%'

Find the capacity and gender type of the dorm whose name has substring ‘ Donor ’ .

O B-COLUMN I-COLUMN O B-COLUMN O O O B-TABLE B-COLUMN I-COLUMN O O O B-VALUE O O


Question: Which status code is the most common of all the bookings?

SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1

Which status code is the most common of all the bookings ?

O B-COLUMN I-COLUMN O O O O O O O B-TABLE O


Question: List the nominees that have been nominated more than two musicals.

SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2

List the nominees that have been nominated more than two musicals .


Question: List the players' names who were born in 1971.

SELECT Player_name FROM Player WHERE DOB LIKE '1971%'

List the players ' names who were born in 1971 .

O O B-TABLE B-COLUMN I-COLUMN O O O O B-VALUE O


Question: What is the name and job title of the staff who was assigned the latest?

SELECT T1.staff_name ,  T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1

What is the name and job title of the staff who was assigned the latest ?

O O O O O B-COLUMN I-COLUMN O O B-TABLE O O B-COLUMN O O O


Question: Calculate the average age of clients from the Midwest region.

SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T3.Region) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest'

Calculate the average age of clients from the Midwest region .

O O O B-COLUMN O B-TABLE O O B-VALUE B-COLUMN O


Question: Show the member name and hometown who registered a branch in 2016.

SELECT T2.name ,  T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id  =  T2.member_id WHERE T1.register_year  =  2016

Show the member name and hometown who registered a branch in 2016 .

O O B-TABLE B-COLUMN O B-COLUMN O B-COLUMN I-COLUMN B-TABLE O B-VALUE O


Question: List by order number the 3 items with the lowest price after applying the discount.

SELECT l_orderkey FROM lineitem ORDER BY l_extendedprice * (1 - l_discount) LIMIT 3

List by order number the 3 items with the lowest price after applying the discount .

O O B-COLUMN O O O B-TABLE O O B-COLUMN I-COLUMN O O O B-COLUMN O


Question: Return the average age across all artists.

Return the average age across all artists .


Question: What are the names of artist who have the letter 'a' in their names?

SELECT Name FROM ARTIST WHERE Name LIKE "%a%"

What are the names of artist who have the letter ' a ' in their names ?

O O O B-COLUMN O B-TABLE O O O O O O O O O O O


Question: Among the players out in match ID 392187, calculate the percentage of players out by bowl.

SELECT CAST(SUM(CASE WHEN T2.Out_Name = 'bowled' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T1.Match_Id = 392187

Among the players out in match ID 392187 , calculate the percentage of players out by bowl .

O O O O O B-COLUMN I-COLUMN B-VALUE O O O O O B-COLUMN B-COLUMN O B-VALUE O


Question: Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.

SELECT T1.car_name, T1.model, T1.displacement / T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1

Provide the name , model , sweep volume , and introduced year of the car with the best crash protection .

O O B-COLUMN O B-COLUMN O O O O O O O O O O B-COLUMN O O O B-TABLE O


Question: Point out the greater one between the number of actual responding and not responding to mailing.

SELECT RESPONSE FROM Mailings1_2 GROUP BY RESPONSE ORDER BY COUNT(RESPONSE) DESC LIMIT 1

Point out the greater one between the number of actual responding and not responding to mailing .

O O O O O O O O O O B-COLUMN O O O O B-TABLE O


Question: What role does the tallest person play?

SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id ORDER BY T1.height_meters DESC LIMIT 1

What role does the tallest person play ?


Question: Name the river of which Lorraine is on. Please name the mountains where to source flow from?

SELECT T1.SourceLongitude, T1.SourceLatitude, T1.SourceAltitude FROM river AS T1 INNER JOIN geo_river AS T2 ON T2.River = T1.Name WHERE T2.Province = 'Lorraine'

Name the river of which Lorraine is on . Please name the mountains where to source flow from ?

B-COLUMN O B-COLUMN O O B-VALUE O O O O O O O O O B-COLUMN B-COLUMN O O


Question: Find the subject ID, subject name, and the corresponding number of available courses for each subject.

SELECT T1.subject_id ,  T2.subject_name ,  COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id  =  T2.subject_id GROUP BY T1.subject_id

Find the subject ID , subject name , and the corresponding number of available courses for each subject .

O O B-COLUMN I-COLUMN O B-COLUMN I-COLUMN O O O O O O O B-TABLE O O B-TABLE O


Question: List all the platform games.

SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'


Question: What is the difference in salary of the top 2 employees with the highest number of territories in charge?

SELECT MAX(Salary) - MIN(Salary) FROM ( SELECT T1.Salary FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.EmployeeID, T1.Salary ORDER BY COUNT(T2.TerritoryID) DESC LIMIT 2 ) T1

What is the difference in salary of the top 2 employees with the highest number of territories in charge ?

O O O O O B-COLUMN O O O O B-TABLE O O O O B-TABLE B-COLUMN O O O


Question: Which nurses are in charge of patients undergoing treatments?

SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID

Which nurses are in charge of patients undergoing treatments ?


Question: Which author has written the most papers? Find his or her last name.

SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid  =  t2.authid JOIN papers AS t3 ON t2.paperid  =  t3.paperid GROUP BY t1.fname ,  t1.lname ORDER BY count(*) DESC LIMIT 1

Which author has written the most papers ? Find his or her last name .

O B-COLUMN O O O O B-TABLE O O O O O O B-COLUMN O


Question: What is the life expectancy of the countries that uses Japanese as their language?

SELECT AVG(T2.LifeExpectancy) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Japanese'

What is the life expectancy of the countries that uses Japanese as their language ?

O O O B-COLUMN I-COLUMN O O B-TABLE O O B-VALUE O O B-COLUMN O


Question: What is the forename and surname of the driver with the shortest laptime?

SELECT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1

What is the forename and surname of the driver with the shortest laptime ?

O O O B-COLUMN O B-COLUMN O O B-TABLE O O O B-TABLE O


Question: Among undergraduate students, list the name of the course with the highest student satisfaction.

SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.type = 'UG' ORDER BY T2.sat DESC LIMIT 1

Among undergraduate students , list the name of the course with the highest student satisfaction .

O O O O O O B-COLUMN O O B-TABLE O O O B-TABLE B-TABLE O


Question: Give the id and name of the cheapest Hardware product.

SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1

Give the i d and name of the cheapest Hardware product .


Question: How many cars are there on train no.1?

SELECT COUNT(id) FROM cars WHERE train_id = 1


Question: List the description of all the colors.

SELECT color_description FROM ref_colors

List the description of all the colors .


Question: Find the number of students for each department.

SELECT count(*) ,  dept_code FROM student GROUP BY dept_code

Find the number of students for each department .


Question: What is the difference in the average number of players out by lbw and runout in the matches?

SELECT AVG(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T2.Out_Name = 'lbw'

What is the difference in the average number of players out by lbw and runout in the matches ?

O O O O O O O O O B-COLUMN B-COLUMN O B-VALUE O O O O O O


Question: What is the average duration of trips which are started at Adobe on Almaden station to Ryland Park?

SELECT AVG(duration) FROM trip WHERE start_station_name = 'Adobe on Almaden' AND end_station_name = 'Ryland Park'

What is the average duration of trips which are started at Adobe on Almaden station to Ryland Park ?

O O O O B-COLUMN O B-TABLE O O O O B-VALUE I-VALUE I-VALUE B-COLUMN O B-VALUE I-VALUE O


Question: What are the ids and first names of customers who do not hold a credit card?

SELECT customer_id ,  customer_first_name FROM Customers EXCEPT SELECT T1.customer_id ,  T2.customer_first_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE card_type_code  =  "Credit"

What are the ids and first names of customers who do not hold a credit card ?

O O O O O O O O B-TABLE O O O O O B-COLUMN O O


Question: Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.

SELECT TYPE FROM ship WHERE Tonnage  >  6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage  <  4000

Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000 .

O O B-COLUMN O O O O O B-TABLE O B-COLUMN O O B-VALUE O O O O O O B-VALUE O


Question: List the power of superheroes with height greater than 80% of the average height of all superheroes.

SELECT T3.power_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T1.height_cm * 100 > ( SELECT AVG(height_cm) FROM superhero ) * 80

List the power of superheroes with height greater than 80 % of the average height of all superheroes .

O B-TABLE B-COLUMN O B-TABLE O O O O B-VALUE O O O O B-COLUMN O O O O


Question: which year has least number of conferences?

SELECT YEAR FROM conference GROUP BY YEAR ORDER BY count(*) LIMIT 1

which year has least number of conferences ?


Question: Show the maximum points of the drivers from countries with capital "Dublin"

SELECT max(T2.Points) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Capital  =  "Dublin"

Show the maximum points of the drivers from countries with capital " Dublin "

O O O B-COLUMN O O B-TABLE O B-COLUMN O B-COLUMN O B-COLUMN O