Question: What is the average price before discount of the top 10 orders with the highest total price?

SELECT SUM(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 10

What is the average price before discount of the top 10 orders with the highest total price ?

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


Question: Name both the alias and the bad alias of zip code 38015.

SELECT T1.alias, T2.bad_alias FROM alias AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 38015

Name both the alias and the bad alias of zip code 38015 .

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


Question: How many menus with the name "Waldorf Astoria" have 4 pages?

SELECT COUNT(*) FROM Menu WHERE name = 'Waldorf Astoria' AND page_count = 4

How many menus with the name " Waldorf Astoria " have 4 pages ?

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


Question: Which cities have lower temperature in March than in Dec and have never served as host cities?

SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city

Which cities have lower temperature in March than in Dec and have never served as host cities ?

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


Question: Among the shipments for Downey, how many shipments were shipped to California in 2016?

SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'

Among the shipments for Downey , how many shipments were shipped to California in 2016 ?

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


Question: Among the current legislators who have served for more than 6 terms, how many of them were born after 1960?

SELECT COUNT(CID) FROM ( SELECT T1.bioguide_id AS CID FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio >= '1960-01-01' GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 6 )

Among the current legislators who have served for more than 6 terms , how many of them were born after 1960 ?

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


Question: What are the names of device shops, and what are the carriers that they carry devices in stock for?

SELECT T3.Shop_Name ,  T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID  =  T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID  =  T3.Shop_ID

What are the names of device shops , and what are the carriers that they carry devices in stock for ?

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


Question: What was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012?

SELECT dewpoint 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 SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 ORDER BY units DESC LIMIT 1

What was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012 ?

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


Question: Find the number of voting records in total.

Find the number of voting records in total .


Question: What are the names and ages of all sailors sorted by decreasing rating?

SELECT name ,  age FROM Sailors ORDER BY rating DESC

What are the names and ages of all sailors sorted by decreasing rating ?

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


Question: Give the section titles of the document with the name "David CV".

SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code  =  t2.document_code WHERE t1.document_name  =  "David CV"

Give the section titles of the document with the name " David CV " .

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


Question: What are the names of the five cities with the greatest proportion of white people?

SELECT Name FROM city ORDER BY White DESC LIMIT 5

What are the names of the five cities with the greatest proportion of white people ?

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


Question: What is the indicator code for Mobile Cellular Subscriptions of Brazil?

SELECT DISTINCT IndicatorCode FROM Indicators WHERE CountryName = 'Brazil' AND IndicatorName = 'Mobile cellular subscriptions'

What is the indicator code for Mobile Cellular Subscriptions of Brazil ?

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


Question: How many paintings are exhibited at gallery 240?

SELECT count(*) FROM paintings WHERE LOCATION  =  "Gallery 240"

How many paintings are exhibited at gallery 240 ?


Question: What is the zip code of staff with first name as Janessa and last name as Sawayn lived?

SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";

What is the zip code of staff with first name as Janessa and last name as Sawayn lived ?

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


Question: List all of the credit cards that had expired by 2007.

SELECT CardNumber FROM CreditCard WHERE ExpYear < 2007

List all of the credit cards that had expired by 2007 .

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


Question: Find the distinct unit prices for tracks.

Find the distinct unit prices for tracks .


Question: How many artists are male and how many are female?

SELECT count(*) ,  gender FROM artist GROUP BY gender

How many artists are male and how many are female ?


Question: What are the average height and width of paintings that are oil medium in the place of gallery 241?

SELECT avg(height_mm) ,  avg(width_mm) FROM paintings WHERE medium  =  "oil" AND LOCATION  =  "Gallery 241"

What are the average height and width of paintings that are oil medium in the place of gallery 241 ?

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


Question: What are the grapes, wineries and years for wines with price higher than 100, sorted by year?

SELECT Grape ,  Winery ,  YEAR FROM WINE WHERE Price  >   100 ORDER BY YEAR

What are the grapes , wineries and years for wines with price higher than 100 , sorted by year ?

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


Question: Calculate the average age of the male patients that have hypertension.

SELECT SUM(CASE WHEN T2.deathdate IS NULL THEN ROUND((strftime('%J', date('now')) - strftime('%J', T2.birthdate)) / 365) ELSE ROUND((strftime('%J', T2.deathdate) - strftime('%J', T2.birthdate)) / 365) END) / COUNT(T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Hypertension' AND T2.gender = 'M'

Calculate the average age of the male patients that have hypertension .

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


Question: What is the total of professional courses available at the university? List out all the course id.

SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_500'

What is the total of professional courses available at the university ? List out all the course i d.

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


Question: Among all students, calculate the percentage of disabled students.

SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name

Among all students , calculate the percentage of disabled students .


Question: What type of credit card does the client with the id 13539 own?

SELECT T3.type FROM disp AS T1 INNER JOIN client AS T2 ON T1.client_id = T2.client_id INNER JOIN card AS T3 ON T1.disp_id = T3.disp_id WHERE T2.client_id = 13539

What type of credit card does the client with the i d 13539 own ?

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


Question: How many students whose are playing the role of goalie?

SELECT count(*) FROM tryout WHERE pPos  =  'goalie'

How many students whose are playing the role of goalie ?


Question: List all book titles in the order of their release date from the most recent to the past.

SELECT title FROM book ORDER BY release_date DESC

List all book titles in the order of their release date from the most recent to the past .

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


Question: In the history of team id NJD, which goalie saved the most goal attempts? Give his full name.

SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'NJD' GROUP BY T2.playerID ORDER BY SUM(T2.SA - T2.GA) DESC LIMIT 1

In the history of team i d NJD , which goalie saved the most goal attempts ? Give his full name .

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


Question: What are the first and last name of the president of the club "Bootup Baltimore"?

SELECT t3.fname ,  t3.lname 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 t2.position  =  "President"

What are the first and last name of the president of the club " Bootup Baltimore " ?

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


Question: In rated PG movies, how many of them released in June 1990?

SELECT COUNT(*) FROM movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'

In rated PG movies , how many of them released in June 1990 ?

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


Question: Find the names and populations of the districts whose area is greater than the average area.

SELECT name ,  population FROM district WHERE area_km  >  (SELECT avg(area_km) FROM district)

Find the names and populations of the districts whose area is greater than the average area .

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


Question: What is the ID of actors that acted in the movies most viewed by audience with occupation 5?

SELECT T3.actorid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies2actors AS T3 ON T2.movieid = T3.movieid WHERE T1.occupation = 5 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1

What is the ID of actors that acted in the movies most viewed by audience with occupation 5 ?

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


Question: List the id of male users who gave ratings of less than 3 to French movies with running time of 2.

SELECT T1.userid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T1.userid = T3.userid WHERE T2.country = 'France' AND T2.runningtime = 2 AND T1.rating < 3 AND T3.u_gender = 'M'

List the i d of male users who gave ratings of less than 3 to French movies with running time of 2 .

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


Question: What is the favourite movie genre for audiences of age 18?

SELECT T1.genre FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T3.age = 18 GROUP BY T1.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1

What is the favourite movie genre for audiences of age 18 ?

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


Question: Which user made a critic for the film "When Will I Be Loved" and got 2 comments for the critic?

SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.critic_comments = 2

Which user made a critic for the film " When Will I Be Loved " and got 2 comments for the critic ?

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


Question: List all the username and passwords of users with the most popular role.

SELECT user_name ,  password FROM users GROUP BY role_code ORDER BY count(*) DESC LIMIT 1

List all the username and passwords of users with the most popular role .

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


Question: How many restaurants are on Irving Street?

SELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving'

How many restaurants are on Irving Street ?


Question: Which services type had both successful and failure event details?

SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id  =  T2.service_id WHERE T2.event_details  =  'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id  =  T2.service_id WHERE T2.event_details  =  'Fail'

Which services type had both successful and failure event details ?

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


Question: Find the rooms of faculties with rank professor who live in building NEB.

SELECT Room FROM FACULTY WHERE Rank  =  "Professor" AND Building  =  "NEB"

Find the rooms of faculties with rank professor who live in building NEB .

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


Question: List all students in the air force and which school they were enrolled at.

SELECT T1.name, T1.school FROM enrolled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'air_force'

List all students in the air force and which school they were enrolled at .

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


Question: How many countries from the USA have an In Process order status?

SELECT COUNT(t2.orderNumber) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'On Hold' AND t1.country = 'USA'

How many countries from the USA have an In Process order status ?

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


Question: Please list all the critics made by the user rating the movie "A Way of Life".

SELECT T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life'

Please list all the critics made by the user rating the movie " A Way of Life " .

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


Question: Which customers made orders between 2009-01-01 and 2010-01-01? Find their names.

SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"

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


Question: Among the users who have posted more than 10 reviews, how many users are elite users?

SELECT COUNT(T4.user_id) FROM ( SELECT T1.user_id FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.user_id IS NOT NULL GROUP BY T3.user_id HAVING COUNT(T3.user_id) > 10 ) T4

Among the users who have posted more than 10 reviews , how many users are elite users ?

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


Question: What are the top 3 states with the highest Asian population? List the full names of all the representatives in the said states.

SELECT t.state, T1.first_name, T1.last_name FROM zip_data AS T INNER JOIN congress AS T1 ON t.state = T1.abbreviation GROUP BY t.state ORDER BY SUM(t.asian_population) DESC LIMIT 3

What are the top 3 states with the highest Asian population ? List the full names of all the representatives in the said states .

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


Question: Show names and seatings, ordered by seating for all tracks opened after 2000.

SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating

Show names and seatings , ordered by seating for all tracks opened after 2000 .

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


Question: What is the proportion of the papers that have the keyword "cancer"? Please provide a list of authors and their affiliations.

SELECT CAST(SUM(CASE WHEN T1.Keyword = 'cancer' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id), T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId

What is the proportion of the papers that have the keyword " cancer " ? Please provide a list of authors and their affiliations .

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


Question: What are the first and last name of the faculty who has the most students?

SELECT T1.fname ,  T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1

What are the first and last name of the faculty who has the most students ?

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


Question: Count the number of books.


Question: What is the maximum difference between the sale price and purchase price?

SELECT max(saleprice - purchaseprice) FROM Book

What is the maximum difference between the sale price and purchase price ?

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


Question: How many chainring bolts were sold under sales ID 551971?

SELECT T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Chainring Bolts' AND T1.SalesID = 551971

How many chainring bolts were sold under sales ID 551971 ?

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


Question: What is the percentage of the female patient whose uric acid (UA) beyond the normal range?

SELECT CAST(SUM(CASE WHEN T2.UA > 6.5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.SEX = 'F'

What is the percentage of the female patient whose uric acid ( UA ) beyond the normal range ?

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


Question: Count the number of different software platforms.

SELECT count(DISTINCT Software_Platform) FROM device

Count the number of different software platforms .


Question: Calculate the total products that are supplied by Japan suppliers.

SELECT COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'

Calculate the total products that are supplied by Japan suppliers .

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


Question: Find the first and last name of students whose age is younger than the average age.

SELECT fname ,  lname FROM student WHERE age  <  (SELECT avg(age) FROM student)

Find the first and last name of students whose age is younger than the average age .

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


Question: How much is the processed time of downloading the most popular repository?

SELECT ProcessedTime FROM Repo WHERE Watchers = ( SELECT MAX(Watchers) FROM Repo )

How much is the processed time of downloading the most popular repository ?

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


Question: Among all the male officers, what is the percentage of them are White?

SELECT CAST(SUM(IIF(race = 'W', 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'

Among all the male officers , what is the percentage of them are White ?

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


Question: Return the names of people, ordered alphabetically.

SELECT Name FROM People ORDER BY Name ASC

Return the names of people , ordered alphabetically .


Question: When did the company hired its first Accountant?

SELECT MIN(HireDate) FROM Employee WHERE JobTitle = 'Accountant'

When did the company hired its first Accountant ?


Question: How many discount are of the type "Excess Inventory"?

SELECT COUNT(SpecialOfferID) FROM SpecialOffer WHERE Type = 'Excess Inventory'

How many discount are of the type " Excess Inventory " ?


Question: Show names of clubs that have players with more than 2 win counts.

SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Wins_count  >  2

Show names of clubs that have players with more than 2 win counts .

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


Question: What instruments does the the song "Le Pop" use?

SELECT instrument FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop"

What instruments does the the song " Le Pop " use ?

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


Question: What are the names of the university with an Accounting major ranked 3 or higher?

SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id  =  T2.university_id AND T1.major_id  =  T3.major_id WHERE T1.rank  <=  3 AND T3.major_name  =  "Accounting"

What are the names of the university with an Accounting major ranked 3 or higher ?


Question: Which problems are reported before 1978-06-26? Give me the ids of the problems.

SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26"

Which problems are reported before 1978 - 06 - 26 ? Give me the ids of the problems .

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


Question: What is the average value of the sales order?

SELECT SUM(UnitPrice * Quantity * (1 - Discount)) / COUNT(OrderID) FROM `Order Details`

What is the average value of the sales order ?

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


Question: Please provide the ids of top three powerful pairs of Kingdom Foil and Kingdom Cards sorted by Kingdom Foil id in alphabetical order.

SELECT cardKingdomFoilId, cardKingdomId FROM cards WHERE cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL ORDER BY cardKingdomFoilId LIMIT 3

Please provide the ids of top three powerful pairs of Kingdom Foil and Kingdom Cards sorted by Kingdom Foil i d in alphabetical order .

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


Question: Show the completed years of buildings in descending order of the number of stories.

SELECT Completed_Year FROM building ORDER BY Number_of_Stories DESC

Show the completed years of buildings in descending order of the number of stories .

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


Question: Chlorine is in what type of bond?

SELECT DISTINCT T1.bond_type FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id INNER JOIN atom AS T3 ON T2.atom_id = T3.atom_id WHERE T3.element = 'cl'


Question: What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?

SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  2 AND T2.product_price  >  (SELECT avg(product_price) FROM products)

What are the ids of products from the supplier with i d 2 , which are more expensive than the average price across all products ?

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


Question: Which driver created the fastest lap speed in a Formula_1 race? Please give both his forename and surname.

SELECT T1.forename, T1.surname FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapSpeed DESC LIMIT 1

Which driver created the fastest lap speed in a Formula_1 race ? Please give both his forename and surname .

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


Question: Return the lot details of lots that belong to investors with details "l"?

SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON  T1.investor_id  =  T2.investor_id WHERE T1.Investor_details  =  "l"

Return the lot details of lots that belong to investors with details " l " ?

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


Question: What are the names of the artists that are from the UK and sang songs in English?

SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_name FROM song WHERE languages  =  "english"

What are the names of the artists that are from the UK and sang songs in English ?

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


Question: What are the ids of all students along with how many sports and games did they play?

SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID

What are the ids of all students along with how many sports and games did they play ?

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


Question: What is the salary rate per hour that the company paid to the first 5 employees that they hired?

SELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID ORDER BY T2.HireDate ASC LIMIT 0, 5

What is the salary rate per hour that the company paid to the first 5 employees that they hired ?

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


Question: Show the attendances of the performances at location "TD Garden" or "Bell Centre"

SELECT Attendance FROM performance WHERE LOCATION  =  "TD Garden" OR LOCATION  =  "Bell Centre"

Show the attendances of the performances at location " TD Garden " or " Bell Centre "

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


Question: Please list all the links to the ratings on the movie "A Way of Life" with a critic.

SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.critic IS NOT NULL

Please list all the links to the ratings on the movie " A Way of Life " with a critic .

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


Question: Give the number of research postgraduate students.

SELECT COUNT(student_id) FROM student WHERE type = 'RPG'

Give the number of research postgraduate students .


Question: List the names of all the umpires from England.

SELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T2.Country_Name = 'England'

List the names of all the umpires from England .

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


Question: What is the title with the most ordered quantity in year 1992?

SELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1

What is the title with the most ordered quantity in year 1992 ?

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


Question: What is the average time span of contact channels in the database?

SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels

What is the average time span of contact channels in the database ?


Question: Among the players born in 1977, what is the percentage of the players with a role as a captain?

SELECT CAST(SUM(CASE WHEN T1.Role_Desc = 'Captain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Role_Id) FROM Rolee AS T1 INNER JOIN Player_Match AS T2 ON T2.Role_Id = T1.Role_Id INNER JOIN Player AS T3 ON T3.Player_Id = T2.Player_Id WHERE T3.DOB LIKE '1977%'

Among the players born in 1977 , what is the percentage of the players with a role as a captain ?

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


Question: How many services are there?


Question: How many different types of rooms are there?

SELECT count(DISTINCT roomtype) FROM room

How many different types of rooms are there ?


Question: How many department stores does the store chain South have?

SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id  =  T2.dept_store_chain_id WHERE T2.dept_store_chain_name  =  "South"

How many department stores does the store chain South have ?

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


Question: When did Natalie Dorris buy her first root beer?

SELECT T2.TransactionDate FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Natalie' AND T1.Last = 'Dorris' ORDER BY T2.TransactionDate LIMIT 1

When did Natalie Dorris buy her first root beer ?


Question: Find the total number of scientists.


Question: Find the average and maximum yearly profit for each press.

SELECT avg(Year_Profits_billion) ,  max(Year_Profits_billion) FROM press

Find the average and maximum yearly profit for each press .

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


Question: What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?

SELECT T2.preparation FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry-Pear Couscous Cake' AND T3.name = 'apple juice'

What kind of preparation is needed for apple juice to make a raspberry - pear couscous cake ?

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


Question: Find the average and maximum rating of all reviews.

SELECT avg(rating) ,  max(rating) FROM review

Find the average and maximum rating of all reviews .


Question: What are the distinct years in which the competitions type is not "Tournament"?

SELECT DISTINCT YEAR FROM competition WHERE Competition_type != "Tournament"

What are the distinct years in which the competitions type is not " Tournament " ?

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


Question: Find each student's first name.


Question:
Among the solutions that contain files within the repository needing the longest processed time to download, how many of them doesn't need to be
compiled if user wants to implement it?

SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo ) AND T2.WasCompiled = 1

Among the solutions that contain files within the repository needing the longest processed time to download , how many of them does n't need to be compiled if user wants to implement it ?

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


Question: Show the number of documents.


Question: What is the total number of businesses with a tax code H25?

SELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25'

What is the total number of businesses with a tax code H25 ?

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


Question: Consider the average difference between K-12 enrollment and 15-17 enrollment of schools that are locally funded, list the names and DOC type of schools which has a difference above this average.

SELECT T2.School, T2.DOC FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1.`Enrollment (K-12)` - T1.`Enrollment (Ages 5-17)`) > (SELECT AVG(T3.`Enrollment (K-12)` - T3.`Enrollment (Ages 5-17)`) FROM frpm AS T3 INNER JOIN schools AS T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')

Consider the average difference between K-12 enrollment and 15 - 17 enrollment of schools that are locally funded , list the names and DOC type of schools which has a difference above this average .

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


Question: How many dorms are in the database?


Question: How many shipments were shipped to the least populated city in California?

SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1

How many shipments were shipped to the least populated city in California ?

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


Question: Count the number of drivers whose points are below 150.

SELECT count(*) FROM driver WHERE Points  <  150

Count the number of drivers whose points are below 150 .

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


Question: List the names of aircrafts and that won matches at least twice.

SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID  =  T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft HAVING COUNT(*)  >=  2

List the names of aircrafts and that won matches at least twice .

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


Question: Among the universities with a score in teaching of over 90 in 2011, what is the percentage of those in the United States of America?

SELECT CAST(SUM(CASE WHEN T4.country_name = 'United States of America' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score > 90

Among the universities with a score in teaching of over 90 in 2011 , what is the percentage of those in the United States of America ?

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


Question: How many awards did simpson 20 won in 2009?

SELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009' AND result = 'Winner';

How many awards did simpson 20 won in 2009 ?

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


Question: Which coach has serviced in NBA for more than 10 years.

SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING MAX(year) - MIN(year) > 10

Which coach has serviced in NBA for more than 10 years .

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


Question: How many orders in total are made by customers in Germany?

SELECT COUNT(T2.c_custkey) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'

How many orders in total are made by customers in Germany ?

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


Question: Find the busiest destination airport that runs most number of routes in China.

SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid  =  T2.dst_apid WHERE T1.country  =  'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1

Find the busiest destination airport that runs most number of routes in China .

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


Question: Provide the name and model of the car with the highest price.

SELECT T1.car_name, T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1

Provide the name and model of the car with the highest price .

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


Question: What are the unit measure codes for product ID No.762?

SELECT T2.UnitMeasureCode FROM Product AS T1 INNER JOIN UnitMeasure AS T2 ON T1.SizeUnitMeasureCode = T2.UnitMeasureCode OR T1.WeightUnitMeasureCode = T2.UnitMeasureCode WHERE T1.ProductID = 762 GROUP BY T1.ProductID, T2.UnitMeasureCode

What are the unit measure codes for product ID No.762 ?

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


Question: Find the name of all customers whose name contains "Alex".

SELECT customer_name FROM customers WHERE customer_name LIKE "%Alex%"

Find the name of all customers whose name contains " Alex " .

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


Question: What is the average money requested by all entrepreneurs?

SELECT avg(Money_Requested) FROM entrepreneur

What is the average money requested by all entrepreneurs ?


Question: Show the names of countries and the average speed of roller coasters from each country.

SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name

Show the names of countries and the average speed of roller coasters from each country .

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


Question: Among the transactions made in July, 2014, how many of them were made by a male customer?

SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Gender = 'M' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'

Among the transactions made in July , 2014 , how many of them were made by a male customer ?

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


Question: In which country do most players have the 'slow left-arm chinaman' bowling style?

SELECT T3.Country_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Bowling_skill = 'Slow left-arm chinaman'

In which country do most players have the ' slow left - arm chinaman ' bowling style ?

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


Question: Count all of the living patients that had a stroke.

SELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.description = 'Stroke' AND T2.deathdate IS NULL

Count all of the living patients that had a stroke .


Question: Trains that run in which direction have more rectangle-shaped cars in total?

SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC

Trains that run in which direction have more rectangle - shaped cars in total ?

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


Question: Calculate the production volume of the dairy product 'Mascarpone Fabioli'.

SELECT SUM(UnitsInStock + UnitsOnOrder) FROM Products WHERE ProductName = 'Mascarpone Fabioli'

Calculate the production volume of the dairy product ' Mascarpone Fabioli ' .

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


Question: Among the films that are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?

SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND release_year = 2006

Among the films that are released in 2006 , how many of them are rated Adults Only in the Motion Picture Association Film Rating ?

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


Question: Give the name of the university with the most number of students in 2015.

SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students DESC LIMIT 1

Give the name of the university with the most number of students in 2015 .

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


Question: Find the name of students who took any class in the years of 2009 and 2010.

SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id  =  T2.id WHERE YEAR  =  2009 OR YEAR  =  2010

Find the name of students who took any class in the years of 2009 and 2010 .

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


Question: What is the Shift start time for Shift ID No.2?

SELECT StartTime FROM Shift WHERE ShiftID = '2'

What is the Shift start time for Shift ID No.2 ?

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


Question: List all the work orders that is related to the Down Tube.

SELECT T2.WorkOrderID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Down Tube'

List all the work orders that is related to the Down Tube .


Question: What percentage of patients who were born in 1980 and were diagnosed with RA are women?

SELECT CAST(SUM(CASE WHEN SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE Diagnosis = 'RA' AND STRFTIME('%Y', Birthday) = '1980'

What percentage of patients who were born in 1980 and were diagnosed with RA are women ?

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


Question: What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?

SELECT CAST(SUM(CASE  WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 12

What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview ?

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


Question: What are the chip model and screen mode of the phone with hardware model name "LG-P760"?

SELECT chip_model ,  screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760";

What are the chip model and screen mode of the phone with hardware model name " LG - P760 " ?

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


Question: How many games in the database belong to the genre of sports?

SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'

How many games in the database belong to the genre of sports ?

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


Question: For all the drivers who finished the game in race No. 592, who is the oldest?

SELECT T1.forename, T1.surname FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T2.raceId = 592 AND T2.time IS NOT NULL AND T1.dob IS NOT NULL ORDER BY T1.dob ASC LIMIT 1

For all the drivers who finished the game in race No . 592 , who is the oldest ?

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


Question: Which citizenship do the vast majority of the drivers hold?

SELECT nationality FROM drivers GROUP BY nationality ORDER BY COUNT(driverId) DESC LIMIT 1

Which citizenship do the vast majority of the drivers hold ?


Question: Identify the name of the most popular dairy product in terms of reorder quantity.

SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )

Identify the name of the most popular dairy product in terms of reorder quantity .

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


Question:
List all the tokenized name of the solution path "jurney_P4Backup\P4Backup\P4Backup.sln
".

SELECT DISTINCT T2.NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'jurney_P4BackupP4BackupP4Backup.sln'

List all the tokenized name of the solution path " jurney_P4Backup\P4Backup\P4Backup.sln " .

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


Question: How many papers are published by the institution "Tokohu University"?

SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid  =  t2.paperid JOIN inst AS t3 ON t2.instid  =  t3.instid WHERE t3.name  =  "Tokohu University"

How many papers are published by the institution " Tokohu University " ?

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


Question: Find the average and total values of all boxes.

SELECT avg(value) ,  sum(value) FROM boxes

Find the average and total values of all boxes .


Question: State the name of the optional ingredient of no.1397 recipe.

SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.recipe_id = 1397 AND T2.optional = 'TRUE'

State the name of the optional ingredient of no.1397 recipe .

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


Question: What age of the competitors is the most numerous?

SELECT age FROM games_competitor GROUP BY age ORDER BY COUNT(person_id) DESC LIMIT 1

What age of the competitors is the most numerous ?


Question: What is the average age of the male patient with high cholesterol?

SELECT AVG(STRFTIME('%Y', date('NOW')) - STRFTIME('%Y', T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.`T-CHO` >= 250 AND T1.SEX = 'M'

What is the average age of the male patient with high cholesterol ?

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


Question: Provide the complete name of the venue, city and country where the last match was held.

SELECT T1.Venue_Name, T2.City_Name, T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id INNER JOIN Match AS T4 ON T1.Venue_Id = T4.Venue_Id ORDER BY T4.Match_Date DESC LIMIT 1

Provide the complete name of the venue , city and country where the last match was held .

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


Question: How many events in total have happened on the devices in 2016?

SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016'

How many events in total have happened on the devices in 2016 ?


Question: Find the total number of students and total number of instructors for each department.

SELECT count(DISTINCT T2.id) ,  count(DISTINCT T3.id) ,  T3.dept_name FROM department AS T1 JOIN student AS T2 ON T1.dept_name  =  T2.dept_name JOIN instructor AS T3 ON T1.dept_name  =  T3.dept_name GROUP BY T3.dept_name

Find the total number of students and total number of instructors for each department .

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


Question: How many times was Elly Koss given a care plan between 1/11/2009 and 10/23/2010?

SELECT COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.START BETWEEN '2009-01-11' AND '2010-10-23'

How many times was Elly Koss given a care plan between 1/11/2009 and 10/23/2010 ?

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


Question: Who has got the most number of "funny" type of compliments? Give the user ID.

SELECT user_id FROM Users_Compliments WHERE compliment_id IN ( SELECT compliment_id FROM Compliments WHERE compliment_type LIKE 'funny' )

Who has got the most number of " funny " type of compliments ? Give the user ID .

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


Question: How much is the discount applied to the order with the highest unit price?

SELECT `Discount Applied` FROM `Sales Orders` WHERE REPLACE(`Unit Price`, ',', '') = ( SELECT REPLACE(`Unit Price`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1

How much is the discount applied to the order with the highest unit price ?

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


Question: In which year was the film with the highest replacement cost released?

SELECT DISTINCT release_year FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film )

In which year was the film with the highest replacement cost released ?

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


Question: How many sales values have been created by sales representative and which sales representative have the highest sales?

SELECT SUM(T3.UnitPrice * T3.Quantity) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.Title = 'Sales Representative' ORDER BY SUM(T3.UnitPrice * T3.Quantity)

How many sales values have been created by sales representative and which sales representative have the highest sales ?

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


Question: Mention the user ID and their year of joining Yelp who had great experience on business ID 143.

SELECT T2.user_id, T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.business_id = 143 AND T1.review_stars = 5

Mention the user ID and their year of joining Yelp who had great experience on business ID 143 .

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


Question: What are the codes of boxes stored in warehouses in either Chicago or New York?

SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'

What are the codes of boxes stored in warehouses in either Chicago or New York ?

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


Question: Return the titles of any movies with an R rating.

SELECT title FROM film WHERE rating  =  'R'

Return the titles of any movies with an R rating .

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


Question: How many horror movies are there?

SELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror'


Question: What is the installation date for each ending station on all the trips?

SELECT T1.id ,  T2.installation_date FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id  =  T2.id

What is the installation date for each ending station on all the trips ?

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


Question: How many driver participated in race ID number 18?

SELECT COUNT(driverId) FROM driverStandings WHERE raceId = 18

How many driver participated in race ID number 18 ?

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


Question: What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating?

SELECT CAST(SUM(IIF(T2.review > 4, 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 RIGHT JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area'

What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating ?

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


Question: Is the oldest device user male or female?

SELECT gender FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age )

Is the oldest device user male or female ?


Question: Find the maximum and average capacity among rooms in each building.

SELECT max(capacity) ,  avg(capacity) ,  building FROM classroom GROUP BY building

Find the maximum and average capacity among rooms in each building .

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


Question: Return all details of sailors who are older than 30.

Return all details of sailors who are older than 30 .

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


Question: How many unemployed students are enlisted in the Army organization?

SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.organ = 'army'

How many unemployed students are enlisted in the Army organization ?


Question: Find the average age of the drivers from the countries that use "English" as official native language.

SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID  =  T2.Country WHERE T1.Official_native_language  =  "English"

Find the average age of the drivers from the countries that use " English " as official native language .

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


Question: From which post is the tag "bayesian" excerpted from? Please give the body of the post.

SELECT T2.Body FROM tags AS T1 INNER JOIN posts AS T2 ON T2.Id = T1.ExcerptPostId WHERE T1.TagName = 'bayesian'

From which post is the tag " bayesian " excerpted from ? Please give the body of the post .

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


Question: On which platform was Panzer Tactics released in 2007?

SELECT T5.platform_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T4.release_year = 2007

On which platform was Panzer Tactics released in 2007 ?

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


Question: Find out which business ID are opened all the time.

SELECT DISTINCT business_id FROM Business_Hours WHERE day_id >= 1 AND day_id < 8 AND opening_time = closing_time

Find out which business ID are opened all the time .

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


Question: What was the total number of the games that player Id "rutlewa01" played in 1967?

SELECT GP FROM Goalies WHERE playerID = 'rutlewa01' AND year = 1967

What was the total number of the games that player I d " rutlewa01 " played in 1967 ?

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


Question: What is the maximum, average, and minimum enrollment for all universities?

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

What is the maximum , average , and minimum enrollment for all universities ?

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


Question: What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?

SELECT SUM(CASE WHEN T3.Role_Id = 1 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.Role_Id > 1 THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'SC Ganguly'

What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles ?

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


Question: Please name the coin that ranked first among the coins traded on April 29, 2013.

SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T2.cmc_rank = 1

Please name the coin that ranked first among the coins traded on April 29 , 2013 .

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


Question: Provide the episode number, title and rating of which were aired in October, 2008.

SELECT episode, title, rating FROM Episode WHERE SUBSTR(air_date, 1, 7) LIKE '2008-10%';

Provide the episode number , title and rating of which were aired in October , 2008 .

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


Question: What is the total cost of the pizzas for all the events?

SELECT SUM(cost) FROM expense WHERE expense_description = 'Pizza'

What is the total cost of the pizzas for all the events ?

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


Question: What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?

SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id  =  T2.organization_id WHERE T2.organization_details  =  'Denesik and Sons Party'

What is the distinct service types that are provided by the organization which has detail ' Denesik and Sons Party ' ?

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


Question: How many employees are living in Hoffman Estates, IL?

SELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates'

How many employees are living in Hoffman Estates , IL ?

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


Question: What are the names, locations, and founding years for all institutions?

SELECT institution_name ,  LOCATION ,  founded FROM institution

What are the names , locations , and founding years for all institutions ?

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


Question: Find the starting date and ending data in location for the document named "Robin CV".

SELECT T1.date_in_location_from ,  T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.document_name  =  "Robin CV"

Find the starting date and ending data in location for the document named " Robin CV " .

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


Question: How many more "Chinese" than "Filipino" Yelp businesses?

SELECT SUM(CASE WHEN T1.category_name LIKE 'Chinese' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name LIKE 'Filipino' THEN 1 ELSE 0 END) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id

How many more " Chinese " than " Filipino " Yelp businesses ?


Question: What is the name of the district with the highest number of domestic violence cases?

SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.domestic = 'TRUE' GROUP BY T2.district_name ORDER BY COUNT(T1.district_no) DESC LIMIT 1

What is the name of the district with the highest number of domestic violence cases ?

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


Question: In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently?

SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID  =  T2.mID WHERE T2.stars  >=  4 ORDER BY T1.year

In what years did a movie receive a 4 or 5 star rating , and list the years from oldest to most recently ?

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


Question: Give the title of the film starred by Liza Bergman with the highest replacement cost.

SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Liza' AND T1.last_name = 'Bergman' ORDER BY replacement_cost DESC LIMIT 1

Give the title of the film starred by Liza Bergman with the highest replacement cost .

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


Question: How many meetings are there for each client id?

SELECT client_id ,  count(*) FROM Meetings GROUP BY client_id

How many meetings are there for each client i d ?

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


Question: What are the vehicle ids and models which have been driven by more than 2 drivers or been driven by the driver named 'Jeff Gordon'?

SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id JOIN driver AS T3 ON T2.driver_id  =  T3.driver_id WHERE T3.name  =  'Jeff Gordon' UNION SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T2.vehicle_id HAVING count(*)  >  2

What are the vehicle ids and models which have been driven by more than 2 drivers or been driven by the driver named ' Jeff Gordon ' ?

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


Question: What is the title of the first ever work of William Shakespeare?

SELECT Title FROM works WHERE Date = ( SELECT MIN(Date) FROM works )

What is the title of the first ever work of William Shakespeare ?


Question: Name the villain of the movie with Scott Weinger and Brad Kane as voice actors.

SELECT T1.villian FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Scott Weinger Brad Kane'

Name the villain of the movie with Scott Weinger and Brad Kane as voice actors .

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


Question: How many faculty members participate in an activity?

SELECT count(DISTINCT FacID) FROM Faculty_participates_in

How many faculty members participate in an activity ?

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


Question: List the names of climbers whose country is not Switzerland.

SELECT Name FROM climber WHERE Country != "Switzerland"

List the names of climbers whose country is not Switzerland .

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


Question: Among the organizations where headquarters are in the 'USA', what is the percentage of the them are in 'Washington'?

SELECT CAST(SUM(CASE WHEN T2.City = 'Washington' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.City) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T2.Country = 'USA'

Among the organizations where headquarters are in the ' USA ' , what is the percentage of the them are in ' Washington ' ?

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


Question: What is the religion of current legislator Sherrod Brown?

SELECT religion_bio FROM current WHERE official_full_name = 'Sherrod Brown'

What is the religion of current legislator Sherrod Brown ?

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


Question: What are the names and locations of the universities that did not have any staff participating in any conferences in 2004?

SELECT T1.Institution_Name ,  T1.location FROM institution AS T1 JOIN staff AS T2 ON T1.institution_id  =  T2.institution_id WHERE T2.staff_id NOT IN (SELECT T4.staff_id FROM Conference AS T3 JOIN Conference_participation AS T4 ON T3.conference_id  =  T4.conference_id WHERE T3.year  =  2004)

What are the names and locations of the universities that did not have any staff participating in any conferences in 2004 ?

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


Question: Return the dates of ceremony and the results of all music festivals

SELECT Date_of_ceremony ,  RESULT FROM music_festival

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


Question: How many episodes are credited to Jerry Orbach?

SELECT COUNT(T2.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Jerry Orbach'

How many episodes are credited to Jerry Orbach ?

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


Question: How many people wrote comments for the question "Any additional notes or comments."?

SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Any additional notes or comments' AND T1.AnswerText IS NOT NULL

How many people wrote comments for the question " Any additional notes or comments . " ?

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


Question: Show the ids and names of all documents.

SELECT document_id ,  document_name FROM Documents

Show the ids and names of all documents .


Question: Calculate number of male students in Emory University in 2011.

SELECT CAST((T1.num_students - (T1.num_students * T1.pct_female_students)) AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Emory University' AND T1.year = 2011

Calculate number of male students in Emory University in 2011 .

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


Question: Count the number of credit cards that the customer with first name Blanche and last name Huels has.

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"

Count the number of credit cards that the customer with first name Blanche and last name Huels has .

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


Question: What is the location code for the country "Canada"?

SELECT location_code FROM Ref_locations WHERE location_name  =  "Canada"

What is the location code for the country " Canada " ?

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


Question: Show all information on students.


Question: What are the name and code of the location with the smallest number of documents?

SELECT T2.location_name ,  T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code  =  T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1

What are the name and code of the location with the smallest number of documents ?

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


Question: Name the bad alias of Geneva, AL.

SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Geneva' AND T2.state = 'AL'


Question: How many drivers are there?


Question: What is the id of the youngest user?

SELECT Id FROM users WHERE Age = ( SELECT MIN(Age) FROM users )


Question: Calculate the total beat of the crimes reported in a community area in the central side with population of 50,000 and above.

SELECT 1.0 * SUM(CASE WHEN T1.population > 50000 THEN T2.beat ELSE 0 END) AS sum FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.side = 'Central'

Calculate the total beat of the crimes reported in a community area in the central side with population of 50,000 and above .

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


Question: What is the percentage of employees are in Paris office?

SELECT CAST(COUNT(CASE WHEN t1.city = 'Paris' THEN t2.employeeNumber ELSE NULL END) AS REAL) * 100 / COUNT(t2.employeeNumber) FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode

What is the percentage of employees are in Paris office ?


Question: When is the modified date of the phone number "1500 555-0143"?

SELECT ModifiedDate FROM PersonPhone WHERE PhoneNumber = '1 (11) 500 555-0143'

When is the modified date of the phone number " 1500 555 - 0143 " ?


Question: What is the role of W Jaffer in season year 2012?

SELECT T4.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id INNER JOIN Season AS T5 ON T3.Season_Id = T5.Season_Id WHERE T1.Player_name = 'W Jaffer' AND T5.Season_Year = 2012

What is the role of W Jaffer in season year 2012 ?

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


Question: What are the roles with three or more employees? Give me the role codes.

SELECT role_code FROM Employees GROUP BY role_code HAVING count(*)  >=  3

What are the roles with three or more employees ? Give me the role codes .

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


Question: For each position, what is the average number of points for players in that position?

SELECT POSITION ,  avg(Points) FROM player GROUP BY POSITION

For each position , what is the average number of points for players in that position ?

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


Question: Show all publishers which do not have a book in 1989.

SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR  =  1989

Show all publishers which do not have a book in 1989 .


Question: What are all info of students who registered courses but not attended courses?

SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)

What are all info of students who registered courses but not attended courses ?

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


Question: How many counties are there in Alabama?

SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'

How many counties are there in Alabama ?


Question: What are the ID and description of the condiments category?

SELECT CategoryID, Description FROM Categories WHERE CategoryName = 'Condiments'

What are the ID and description of the condiments category ?

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


Question: What is the average height of male athletes playing basketball sport?

SELECT AVG(T5.height) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T1.sport_name = 'Basketball' AND T5.gender = 'M'

What is the average height of male athletes playing basketball sport ?

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


Question: What are the titles of courses that are in the Statistics department but not the Psychology department?

SELECT title FROM course WHERE dept_name  =  'Statistics' EXCEPT SELECT title FROM course WHERE dept_name  =  'Psychology'

What are the titles of courses that are in the Statistics department but not the Psychology department ?

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


Question: List the names of disabled students enlisted in the navy.

SELECT T1.name FROM enlist AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.organ = 'navy'

List the names of disabled students enlisted in the navy .

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


Question: State the names and full communication address of high schools in Monterey which has more than 800 free or reduced price meals for ages 15-17?

SELECT T1.`School Name`, T2.Street, T2.City, T2.State, T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Monterey' AND T1.`Free Meal Count (Ages 5-17)` > 800 AND T1.`School Type` = 'High Schools (Public)'

State the names and full communication address of high schools in Monterey which has more than 800 free or reduced price meals for ages 15 - 17 ?

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


Question: Return the first name of the user who owns the most properties.

SELECT T1.first_name FROM Users AS T1 JOIN Properties AS T2 ON T2.owner_user_id  =  T1.User_id GROUP BY T1.User_id ORDER BY count(*) DESC LIMIT 1;

Return the first name of the user who owns the most properties .

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


Question: How many "Mountain-500 Black 42" were sold in total?

SELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Mountain-500 Black, 42'

How many " Mountain-500 Black 42 " were sold in total ?

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


Question: Give the distinct ids for goods that cost less than any Tart.

SELECT DISTINCT id FROM goods WHERE price  <  (SELECT max(price) FROM goods WHERE food  =  "Tart")

Give the distinct ids for goods that cost less than any Tart .

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


Question: Show the names of club leaders and the names of clubs they joined.

SELECT T3.Name ,  T2.Club_Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID  =  T2.Club_ID JOIN member AS T3 ON T1.Member_ID  =  T3.Member_ID

Show the names of club leaders and the names of clubs they joined .

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


Question: How many unmarried women were checked for normal pregnancy?

SELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Normal pregnancy' AND T2.gender = 'F' AND T2.marital = 'S'

How many unmarried women were checked for normal pregnancy ?


Question: Give the code of the payment method that is most commonly used.

SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1

Give the code of the payment method that is most commonly used .


Question: Who published the book "The Secret Garden"?

SELECT DISTINCT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Secret Garden'

Who published the book " The Secret Garden " ?

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


Question: State the vendor for product number WB-H098.

SELECT T3.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.ProductNumber = 'WB-H098'

State the vendor for product number WB - H098 .

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


Question: Of the 4 root beers that Frank-Paul Santangelo purchased on 2014/7/7, how many of them were in cans?

SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07' AND T3.ContainerType = 'Can'

Of the 4 root beers that Frank - Paul Santangelo purchased on 2014/7/7 , how many of them were in cans ?

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