Question: Show me the distance between Boston and Newark.

SELECT distance FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" AND T3.city_name  =  "Newark"

Show me the distance between Boston and Newark .


Question: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.

SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10

Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10 .

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


Question: How many days was the fastest shipping of Berglunds snabbkp's order?

SELECT datediff(T2.ShippedDate, T2.OrderDate) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'Berglunds snabbkp' ORDER BY datediff(T2.ShippedDate, T2.OrderDate) LIMIT 1

How many days was the fastest shipping of Berglunds snabbkp 's order ?

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


Question: Does the length of the tip influence the number of likes for hotel and travel business category?

SELECT T3.tip_length, SUM(T3.likes) AS likes FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Tips AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Hotels & Travel' GROUP BY T3.tip_length

Does the length of the tip influence the number of likes for hotel and travel business category ?

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


Question: What is the average number of test takers from Fresno schools that opened between 1/1/1980 and 12/31/1980?

SELECT AVG(T1.NumTstTakr) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE strftime('%Y', T2.OpenDate) = '1980' AND T2.County = 'Fresno'

What is the average number of test takers from Fresno schools that opened between 1/1/1980 and 12/31/1980 ?

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


Question: What are the titles of games not played by any players who play the Guard position?

SELECT Title FROM game EXCEPT SELECT T1.Title 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"

What are the titles of games not played by any players who play the Guard position ?

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


Question: Find the id and city of the student address with the highest average monthly rental.

SELECT T2.address_id ,  T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1

Find the i d and city of the student address with the highest average monthly rental .

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


Question: What are the names of festivals held in year 2007?

SELECT Festival_Name FROM festival_detail WHERE YEAR  =  2007

What are the names of festivals held in year 2007 ?

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


Question: Show name, city, and state for all universities in  alphabetical order of university name.

SELECT university_name ,  city ,  state FROM University ORDER BY university_name

Show name , city , and state for all universities in alphabetical order of university name .

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


Question: Name the food businesses that passed the inspection in 2010.

SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T2.results = 'Pass' AND T1.facility_type = 'Liquor'

Name the food businesses that passed the inspection in 2010 .

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


Question: In California, how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles?

SELECT COUNT(*) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'CA' AND T2.type LIKE '%Community Post Office%' AND T1.name = 'California' AND T2.state = 'CA'

In California , how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles ?

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


Question: How many businesses with the category are open from Monday to Thursday?

SELECT COUNT(T2.business_id) 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 INNER JOIN Days AS T5 ON T4.day_id = T5.day_id WHERE T5.day_of_week LIKE 'Monday' OR T5.day_of_week LIKE 'Tuesday' OR T5.day_of_week LIKE 'Wednesday' OR T5.day_of_week LIKE 'Thursday'

How many businesses with the category are open from Monday to Thursday ?

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


Question: Show the ids of all employees who don't destroy any document.

SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed

Show the ids of all employees who do n't destroy any document .

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


Question: Which Dodge car is the cheapest?

SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name LIKE 'dodge%' ORDER BY T2.price ASC LIMIT 1


Question: List the number of customers that did not have any payment history.

SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );

List the number of customers that did not have any payment history .


Question: What is the average fastest lap time of the top 10 drivers in the 2006 United States Grand Prix?

SELECT AVG(T1.fastestLapTime) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.rank < 11 AND T2.year = 2006 AND T2.name = 'United States Grand Prix'

What is the average fastest lap time of the top 10 drivers in the 2006 United States Grand Prix ?

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


Question: Which state did Veronica Grace Boland represent and which party is she affiliated?

SELECT T2.state, T2.party FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name OR T1.middle_name OR T1.last_name = 'VeronicaGraceBoland'

Which state did Veronica Grace Boland represent and which party is she affiliated ?

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


Question: Please list the positions of the circuits built by the constructor Renault.

SELECT DISTINCT T1.position FROM constructorStandings AS T1 INNER JOIN constructors AS T2 ON T2.constructorId = T1.constructorId WHERE T2.name = 'Renault'

Please list the positions of the circuits built by the constructor Renault .

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


Question: What are the details and opening hours of the museums?

SELECT T1.Museum_Details ,  T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID  =  T2.Tourist_Attraction_ID

What are the details and opening hours of the museums ?

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


Question: Name the products where the suppliers come from Finland.

SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Finland'

Name the products where the suppliers come from Finland .


Question: Which city is Townsend at 7th Station located and how many bikes could it hold?

SELECT city, SUM(dock_count) FROM station WHERE name = 'Townsend at 7th'

Which city is Townsend at 7th Station located and how many bikes could it hold ?

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


Question: What are the last names and ids of users who have searched two or fewer times, and own two or more properties?

SELECT T1.last_name ,  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(*)  <=  2 INTERSECT SELECT T3.last_name ,  T3.user_id FROM Users AS T3 JOIN Properties AS T4 ON T3.user_id  =  T4.owner_user_id GROUP BY T3.user_id HAVING count(*)  >=  2;

What are the last names and ids of users who have searched two or fewer times , and own two or more properties ?

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


Question: Which trip id had the longest duration and the start station is in Redwood City?

SELECT T1.id FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' AND T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' )

Which trip i d had the longest duration and the start station is in Redwood City ?

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


Question: List the name of the author that affiliated with University of Illinois Chicago?

SELECT Name FROM Author WHERE Affiliation = 'University of Illinois Chicago'

List the name of the author that affiliated with University of Illinois Chicago ?

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


Question: How many more students in total graduated from Central Alabama Community College in 2012 than in 2011?

SELECT SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END) - SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'

How many more students in total graduated from Central Alabama Community College in 2012 than in 2011 ?

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


Question: What is the average age of the users who use model device of R7?

SELECT SUM(T1.age) / COUNT(T1.device_id) AS avg FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'R7'

What is the average age of the users who use model device of R7 ?

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


Question: How many of the work orders didn’t meet the due date?

SELECT COUNT(WorkOrderID) FROM WorkOrder WHERE EndDate > DueDate

How many of the work orders did n’t meet the due date ?

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


Question: What is the address of each course author or tutor?

SELECT address_line_1 FROM Course_Authors_and_Tutors

What is the address of each course author or tutor ?

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


Question: Give the details of the project with the document name 'King Book'.

SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id WHERE T2.document_name  =  "King Book"

Give the details of the project with the document name ' King Book ' .

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


Question: Find the last names of all the teachers that teach GELL TAMI.

SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI"

Find the last names of all the teachers that teach GELL TAMI .

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


Question: For each zip code, what is the average mean temperature for all dates that start with '8'?

SELECT zip_code  ,  avg(mean_temperature_f) FROM weather WHERE date LIKE "8/%" GROUP BY zip_code

For each zip code , what is the average mean temperature for all dates that start with ' 8 ' ?

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


Question: On February 8, 2014, what is the minimum temperature in the station where store 29 belongs?

SELECT tmin FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.store_nbr = 29 AND T2.`date` = '2014-02-08'

On February 8 , 2014 , what is the minimum temperature in the station where store 29 belongs ?

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


Question: What is the most popular payment method?

SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY count(*) DESC LIMIT 1

What is the most popular payment method ?


Question: Which state does the student whose first name is Linda live in?

SELECT state FROM Student AS T1 JOIN City AS T2 ON T1.city_code  =  T2.city_code WHERE T1.Fname  =  "Linda"

Which state does the student whose first name is Linda live in ?

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


Question: Give me a list of all the distinct items bought by the customer number 15.

SELECT DISTINCT T1.item FROM items AS T1 JOIN receipts AS T2 ON T1.receipt  =  T2.ReceiptNumber WHERE T2.CustomerId  =  15

Give me a list of all the distinct items bought by the customer number 15 .

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


Question: What is the stock value of every condiments?

SELECT T1.UnitPrice * T1.UnitsInStock FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID

What is the stock value of every condiments ?


Question: Please list any two parts that come with the wrap bag container and have a supply cost of under 10.

SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_supplycost < 10 AND T1.p_container = 'WRAP BAG' LIMIT 2

Please list any two parts that come with the wrap bag container and have a supply cost of under 10 .

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


Question: List out the Id number of races which were hold in 2009.

SELECT raceId FROM races WHERE year = 2009

List out the I d number of races which were hold in 2009 .


Question: What is the average of fastest lap speed in the 2009 Spanish Grand Prix race?

SELECT AVG(T1.fastestLapSpeed) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix'

What is the average of fastest lap speed in the 2009 Spanish Grand Prix race ?

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


Question: What is Abomination's eye colour?

SELECT T2.colour FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.eye_colour_id = T2.id WHERE T1.superhero_name = 'Abomination'


Question: What are the hosts of competitions whose theme is not "Aliens"?

SELECT Hosts FROM farm_competition WHERE Theme !=  'Aliens'

What are the hosts of competitions whose theme is not " Aliens " ?

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


Question: What are the bonds that have phosphorus and nitrogen as their atom elements?

SELECT T2.bond_id FROM atom AS T1 INNER JOIN connected AS T2 ON T1.atom_id = T2.atom_id WHERE T2.bond_id IN ( SELECT T3.bond_id FROM connected AS T3 INNER JOIN atom AS T4 ON T3.atom_id = T4.atom_id WHERE T4.element = 'p' ) AND T1.element = 'n'

What are the bonds that have phosphorus and nitrogen as their atom elements ?

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


Question: List the names of coins that cannot be traded in 2014.

SELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked'

List the names of coins that can not be traded in 2014 .

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


Question: What are the names of the instructors in the Comp. Sci. department who earn more than 80000?

SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'  AND salary  >  80000

What are the names of the instructors in the Comp . Sci . department who earn more than 80000 ?

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


Question: In which city can you find the school in the state of California with the lowest latitude coordinates and what is its lowest grade? Indicate the school name.

SELECT T2.City, T1.`Low Grade`, T1.`School Name` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.State = 'CA' ORDER BY T2.Latitude ASC LIMIT 1

In which city can you find the school in the state of California with the lowest latitude coordinates and what is its lowest grade ? Indicate the school name .

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


Question: What are the names of the top 5 airlines with the highest number of aircraft?

SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5

What are the names of the top 5 airlines with the highest number of aircraft ?


Question: Who is the shortest player and state the team ID of that player from 1925 to 1936.

SELECT T2.playerID, T2.tmID FROM ( SELECT playerID FROM Master WHERE height IS NOT NULL ORDER BY height ASC LIMIT 1 ) AS T1 INNER JOIN ( SELECT DISTINCT playerID, tmID FROM Scoring WHERE year BETWEEN 1925 AND 1936 ) AS T2 ON T1.playerID = T2.playerID

Who is the shortest player and state the team ID of that player from 1925 to 1936 .

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


Question: How many tracks do we have?


Question: What is the difference in the average number of films rented each day in Australia and Canada?

SELECT AVG(IIF(T4.country = 'Australia', 1, 0)) - AVG(IIF(T4.country = 'Canada', 1, 0)) AS diff FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T2.city_id = T3.city_id INNER JOIN country AS T4 ON T3.country_id = T4.country_id

What is the difference in the average number of films rented each day in Australia and Canada ?

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


Question: In how many cases where the subject was a female was the subject's status listed as Deceased?

SELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F' AND T1.subject_statuses = 'Deceased'

In how many cases where the subject was a female was the subject 's status listed as Deceased ?

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


Question: How many airports are there per country? Order the countries by decreasing number of airports.

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

How many airports are there per country ? Order the countries by decreasing number of airports .

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


Question: Return the nickname of the institution with the lowest enrollment.

SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID ORDER BY T2.Enrollment ASC LIMIT 1

Return the nickname of the institution with the lowest enrollment .

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


Question: Find all information about student addresses, and sort by monthly rental in descending order.

SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC

Find all information about student addresses , and sort by monthly rental in descending order .

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


Question: What is the number of routes operated by the airline American Airlines whose destinations are in Italy?

SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid  =  T2.apid JOIN airlines AS T3 ON T1.alid  =  T3.alid WHERE T2.country  =  'Italy' AND T3.name  =  'American Airlines'

What is the number of routes operated by the airline American Airlines whose destinations are in Italy ?

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


Question: What are the types of powertrains that have vehicles that were made in both 2013 and 2014?

SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2014 INTERSECT SELECT type_of_powertrain FROM vehicles WHERE model_year  =  2013

What are the types of powertrains that have vehicles that were made in both 2013 and 2014 ?

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


Question: Give the name of venue for the game with a win margin of 138 points.

SELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Win_Margin = 138

Give the name of venue for the game with a win margin of 138 points .

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


Question: List the last name of the members of the club that attended the women's soccer event.

SELECT T3.last_name FROM attendance AS T1 INNER JOIN event AS T2 ON T2.event_id = T1.link_to_event INNER JOIN member AS T3 ON T1.link_to_member = T3.member_id WHERE T2.event_name = 'Women''s Soccer' AND T3.position = 'Member'

List the last name of the members of the club that attended the women 's soccer event .

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


Question: What is the clearance level of a physician?

SELECT T1.Level FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID WHERE T2.position  =  "Physician";

What is the clearance level of a physician ?


Question: Among the active employees, how many of them have a courtesy title of "Mr"?

SELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.CurrentFlag = 1 AND T2.Title = 'Mr.'

Among the active employees , how many of them have a courtesy title of " Mr " ?

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


Question: How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?

SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-05-18' AND T1.sex = 'Male' AND T1.first = 'Brantley' AND T1.middle = 'Julian' AND T1.last = 'Stanley'

How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18 ?

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


Question: What is the first name of the user who owns the greatest number of 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;

What is the first name of the user who owns the greatest number of properties ?

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


Question: What are the names of all instructors who advise students in the math depart sorted by total credits of the student.

SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'Math' ORDER BY T3.tot_cred

What are the names of all instructors who advise students in the math depart sorted by total credits of the student .

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


Question: What are the ids, full names, and phones of each customer?

SELECT customer_id ,  customer_first_name ,  customer_last_name ,  customer_phone FROM Customers

What are the ids , full names , and phones of each customer ?


Question: What are the full names of faculties with sex M and who live in building NEB?

SELECT Fname ,  Lname FROM FACULTY WHERE sex  =  "M" AND Building  =  "NEB"

What are the full names of faculties with sex M and who live in building NEB ?

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


Question: List the name for storms and the number of affected regions for each storm.

SELECT T1.name ,  count(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id

List the name for storms and the number of affected regions for each storm .

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


Question: List out full name of employees who are working in Tokyo?

SELECT T1.firstName, T1.lastName FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Tokyo'

List out full name of employees who are working in Tokyo ?

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


Question: What is the title of a course that is listed in both the Statistics and Psychology departments?

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

What is the title of a course that is listed in both the Statistics and Psychology departments ?

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


Question: What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?

SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id  =  T2.master_customer_id WHERE T3.cmi_details != 'Schmidt ,  Kertzmann and Lubowitz'

What are the renting arrears tax ids related to the customer master index whose detail is not ' Schmidt , Kertzmann and Lubowitz ' ?

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


Question: Return the last name, id and phone number of the customer who has made the greatest number of orders.

SELECT T2.customer_last_name ,  T1.customer_id ,  T2.phone_number FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1

Return the last name , i d and phone number of the customer who has made the greatest number of orders .

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


Question: In 2006, how many restricted films were released?

SELECT COUNT(film_id) FROM film WHERE rating = 'R' AND release_year = 2006

In 2006 , how many restricted films were released ?


Question: What are the ids of stations that are located in San Francisco and have average bike availability above 10.

SELECT id FROM station WHERE city  =  "San Francisco" INTERSECT SELECT station_id FROM status GROUP BY station_id HAVING avg(bikes_available)  >  10

What are the ids of stations that are located in San Francisco and have average bike availability above 10 .

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


Question: find the number of authors who are older than 30 for each gender.

SELECT count(*) ,  gender FROM author WHERE age  >  30 GROUP BY gender

find the number of authors who are older than 30 for each gender .

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


Question: What are the ids and names of accounts with 4 or more transactions?

SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4

What are the ids and names of accounts with 4 or more transactions ?

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


Question: For how long did Elly Koss's cystitis last?

SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Cystitis'

For how long did Elly Koss 's cystitis last ?

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


Question: Calculate the swept volume of the $34538.97449 car.

SELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449

Calculate the swept volume of the $ 34538.97449 car .


Question: What are the id of the games held in London?

SELECT T1.games_id FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'

What are the i d of the games held in London ?

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


Question: Count the total number of games the team Boston Red Stockings attended from 1990 to 2000.

SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;

Count the total number of games the team Boston Red Stockings attended from 1990 to 2000 .

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


Question: What is first names of the top 5 staff who have handled the greatest number of complaints?

SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5

What is first names of the top 5 staff who have handled the greatest number of complaints ?

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


Question: Which post has the highest score? Please give its id and title's name.

SELECT T1.Id, T2.Title FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId ORDER BY T2.Score DESC LIMIT 1

Which post has the highest score ? Please give its i d and title 's name .

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


Question: For how long can you rent the movie 'Dirty Ace'?

SELECT rental_duration FROM film WHERE title = 'DIRTY ACE'

For how long can you rent the movie ' Dirty Ace ' ?


Question: Show the most common nationality for journalists.

SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1

Show the most common nationality for journalists .


Question: What are the amenities in alphabetical order that Anonymous Donor Hall has?

SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid  =  T1.amenid JOIN dorm AS T3 ON T2.dormid  =  T3.dormid WHERE T3.dorm_name  =  'Anonymous Donor Hall' ORDER BY T1.amenity_name

What are the amenities in alphabetical order that Anonymous Donor Hall has ?

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


Question: What are project ids of projects that have 2 or more corresponding documents?

SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2

What are project ids of projects that have 2 or more corresponding documents ?

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


Question: List the customer event id and the corresponding move in date and property id.

SELECT customer_event_id ,  date_moved_in ,  property_id FROM customer_events

List the customer event i d and the corresponding move in date and property i d.

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


Question: Find the department with the most employees.

SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;

Find the department with the most employees .


Question: Find the details of the services that have been used by more than 3 times .

select t1.service_details from services as t1 join customers_and_services as t2 on t1.service_id  =  t2.service_id group by t1.service_details having count(*)  >  3

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


Question: Give the student staff ratio of university ID 35.

SELECT student_staff_ratio FROM university_year WHERE university_id = 35

Give the student staff ratio of university ID 35 .

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


Question: List the driver's name of the shipment shipped on February 22, 2016.

SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22'

List the driver 's name of the shipment shipped on February 22 , 2016 .

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


Question: What type of employee is David Bradley?

SELECT PersonType FROM Person WHERE FirstName = 'David' AND LastName = 'Bradley'

What type of employee is David Bradley ?


Question: Return the name and id of the furniture with the highest market rate.

SELECT name ,  furniture_id FROM furniture ORDER BY market_rate DESC LIMIT 1

Return the name and i d of the furniture with the highest market rate .

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


Question: What is the average GPA of students taking ACCT-211?

SELECT avg(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T1.class_code  =  T3.class_code WHERE T3.crs_code  =  'ACCT-211'

What is the average GPA of students taking ACCT-211 ?


Question: How many books were published in 2017?

SELECT COUNT(*) FROM book WHERE STRFTIME('%Y', publication_date) = '2017'


Question: Find the number of users in each role.

SELECT count(*) ,  role_code FROM users GROUP BY role_code


Question: Count the number of male students who had class senator votes in the fall election cycle.

SELECT count(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  Class_Senator_Vote WHERE T1.Sex  =  "M" AND T2.Election_Cycle  =  "Fall"

Count the number of male students who had class senator votes in the fall election cycle .

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


Question: What are the names and salaries of instructors who advise students in the Math department?

SELECT T2.name ,  T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'Math'

What are the names and salaries of instructors who advise students in the Math department ?

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


Question: How many tasks are there in total?


Question: Find the claim that has the largest total settlement amount. Return the effective date of the claim.

SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id  =  t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1

Find the claim that has the largest total settlement amount . Return the effective date of the claim .

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


Question: How many inspections did All Style Buffet Restaurant have?

SELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.facility_type = 'Restaurant' AND T1.dba_name = 'All Style Buffet'

How many inspections did All Style Buffet Restaurant have ?

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


Question: What is the most laps f1 races had? Name the race, year and circuit location where the races with most laps was hosted.

SELECT T3.lap, T2.name, T2.year, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId INNER JOIN lapTimes AS T3 ON T3.raceId = T2.raceId ORDER BY T3.lap DESC LIMIT 1

What is the most laps f1 races had ? Name the race , year and circuit location where the races with most laps was hosted .

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


Question: Calculate the number of female patients who accepted "HPV quadrivalent" immunization.

SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'HPV  quadrivalent' AND T1.gender = 'F'

Calculate the number of female patients who accepted " HPV quadrivalent " immunization .

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


Question: Which word has the most repetitions in the Catalan language?

SELECT T2.word FROM langs_words AS T1 INNER JOIN words AS T2 ON T1.wid = T2.wid WHERE T1.occurrences = ( SELECT MAX(occurrences) FROM langs_words )

Which word has the most repetitions in the Catalan language ?


Question: How many actors have acted in both US or UK films?

SELECT COUNT(T1.actorid) FROM movies2actors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' OR T2.country = 'UK'

How many actors have acted in both US or UK films ?

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


Question: Find the name and salary of the instructors who are advisors of any student from History department?

SELECT T2.name ,  T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id  =  T2.id JOIN student AS T3 ON T1.s_id  =  T3.id WHERE T3.dept_name  =  'History'

Find the name and salary of the instructors who are advisors of any student from History department ?

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


Question: List the food type of the restaurant located in 22779 6th St., Hayward City.

SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_num = 22779 AND T1.street_name = '6th St' AND T2.city = 'hayward'

List the food type of the restaurant located in 22779 6th St. , Hayward City .

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


Question: What are the locations of warehouses in which boxes that contain Rocks and Scissors are kept?

SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'

What are the locations of warehouses in which boxes that contain Rocks and Scissors are kept ?

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


Question: What is the city location of the high school level school with Lunch Provision 2 whose lowest grade is 9 and the highest grade is 12 in the county of Merced?

SELECT T2.City FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`NSLP Provision Status` = 'Lunch Provision 2' AND T2.County = 'Merced' AND T1.`Low Grade` = 9 AND T1.`High Grade` = 12 AND T2.EILCode = 'HS'

What is the city location of the high school level school with Lunch Provision 2 whose lowest grade is 9 and the highest grade is 12 in the county of Merced ?

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


Question: What is the starting year for the oldest technician?

SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1

What is the starting year for the oldest technician ?


Question: Name the reason Walter Bahringer visited medical professionals in July 2009.

SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Walter' AND T1.last = 'Bahringer' AND T2.DATE LIKE '2009-07%'

Name the reason Walter Bahringer visited medical professionals in July 2009 .

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


Question: Give the alphanumeric ID of the Catholic legislators in Nebraska.

SELECT T1.bioguide FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.religion_bio = 'Catholic' AND T1.state = 'NE'

Give the alphanumeric ID of the Catholic legislators in Nebraska .


Question: Find the exams whose subject code is not "Database". What are the exam dates and exam names?

SELECT Exam_Date ,  Exam_Name FROM Exams WHERE Subject_Code != 'Database'

Find the exams whose subject code is not " Database " . What are the exam dates and exam names ?

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


Question: List the votes of elections in descending order.

SELECT Votes FROM election ORDER BY Votes DESC

List the votes of elections in descending order .


Question: Show the draft pick numbers and draft classes of players whose positions are defenders.

SELECT Draft_Pick_Number ,  Draft_Class FROM match_season WHERE POSITION  =  "Defender"

Show the draft pick numbers and draft classes of players whose positions are defenders .

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


Question: List out the seasons that Niklas Eckerblom played.

SELECT DISTINCT T1.SEASON FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Niklas Eckerblom'

List out the seasons that Niklas Eckerblom played .

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


Question: For the order paying the highest freight, how many kinds of products does it contain?

SELECT COUNT(T2.ProductID) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.Freight = ( SELECT MAX(Freight) FROM Orders ) GROUP BY T1.OrderID

For the order paying the highest freight , how many kinds of products does it contain ?

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


Question: State the object class of the image with tallest bounding box.

SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID ORDER BY T1.H DESC LIMIT 1

State the object class of the image with tallest bounding box .


Question: What are the first names and offices of history professors who don't have Ph.D.s?

SELECT T2.emp_fname ,  T1.prof_office FROM professor AS T1 JOIN employee AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T1.dept_code  =  T3.dept_code WHERE T3.dept_name  =  'History' AND T1.prof_high_degree != 'Ph.D.'

What are the first names and offices of history professors who do n't have Ph . D.s ?

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


Question: What are the names of paintings whose width is less than 600 or height is larger than 800?

SELECT title FROM paintings WHERE width_mm  <  600 OR height_mm  >  800

What are the names of paintings whose width is less than 600 or height is larger than 800 ?

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


Question: Who is the voice actor of the character "Binkie Muddlefoot"?

SELECT `voice-actor` FROM `voice-actors` WHERE character = 'Binkie Muddlefoot'

Who is the voice actor of the character " Binkie Muddlefoot " ?

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


Question: How many female superheroes have a strength value of 100?

SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id INNER JOIN gender AS T4 ON T1.gender_id = T4.id WHERE T3.attribute_name = 'Strength' AND T2.attribute_value = 100 AND T4.gender = 'Female'

How many female superheroes have a strength value of 100 ?

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


Question: Provide the ID and age of patient with lactate dehydrogenase (LDH) between 100-300 index above the normal range.

SELECT DISTINCT T1.ID, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH > 600 AND T2.LDH < 800

Provide the ID and age of patient with lactate dehydrogenase ( LDH ) between 100 - 300 index above the normal range .

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


Question: Which patient is undergoing the most recent treatment?

SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1

Which patient is undergoing the most recent treatment ?


Question: Calculate total weight of package shipped on Mars.

SELECT sum(T1.Weight) FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID WHERE T3.Name = "Mars";

Calculate total weight of package shipped on Mars .

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


Question: How many 2003 Harley-Davidson Eagle Drag Bikes were ordered?

SELECT SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productName = '2003 Harley-Davidson Eagle Drag Bike'

How many 2003 Harley - Davidson Eagle Drag Bikes were ordered ?

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


Question: What is the name of the team with the highest home lost rate?

SELECT name FROM teams ORDER BY CAST(homeWon AS REAL) / (homeWon + homeLost) DESC LIMIT 1

What is the name of the team with the highest home lost rate ?

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


Question: Among customers named Kate, who has the highest quantity?

SELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Kate' ORDER BY T1.Quantity DESC LIMIT 1

Among customers named Kate , who has the highest quantity ?

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


Question: Which year recorded the most number of goals by a player and how old was the player at the time the most number of goals was achieved by him?

SELECT T1.year, T1.year - T2.birthYear FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID GROUP BY T1.year, T1.year - T2.birthYear ORDER BY SUM(T1.G) DESC LIMIT 1

Which year recorded the most number of goals by a player and how old was the player at the time the most number of goals was achieved by him ?

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


Question: Which country have conducted population census from 2010 until 2012 and have completed vital registration?

SELECT ShortName, LongName FROM Country WHERE LatestPopulationCensus >= 2010 AND LatestPopulationCensus < 2013 AND VitalRegistrationComplete = 'Yes'

Which country have conducted population census from 2010 until 2012 and have completed vital registration ?

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


Question: Which physicians are trained in procedures that are more expensive than 5000?

SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000

Which physicians are trained in procedures that are more expensive than 5000 ?

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


Question: Give the id of "Center for World University Rankings".

SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'

Give the i d of " Center for World University Rankings " .

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


Question: Find the number of reservations for each boat.

SELECT bid ,  count(*) FROM Reserves GROUP BY bid

Find the number of reservations for each boat .


Question: State the player ID and coach ID of person who have become coach after retirement.

SELECT playerID, coachID FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL

State the player ID and coach ID of person who have become coach after retirement .

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


Question: What is the id and name of the staff who has been assigned for the least amount of time?

SELECT T1.staff_id ,  T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1

What is the i d and name of the staff who has been assigned for the least amount of time ?

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


Question: What is the average age for all managers?

What is the average age for all managers ?


Question: List the winning drivers and winning teams of races in ascending alphabetical order of winning team.

SELECT Winning_driver ,  Winning_team FROM race ORDER BY Winning_team ASC

List the winning drivers and winning teams of races in ascending alphabetical order of winning team .

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


Question: What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510?

SELECT T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.address = '317 Russell Senate Office Building Washington DC 20510'

What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510 ?

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


Question: Which European countries had the highest private expenditure on health in 2005? List the top ten countries in descending order and find the source of the data.

SELECT DISTINCT T1.CountryCode, T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T1.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Out-of-pocket health expenditure (% of private expenditure on health)' AND T2.Value > 0 AND T2.year = 2005 ORDER BY T2.Value DESC LIMIT 10

Which European countries had the highest private expenditure on health in 2005 ? List the top ten countries in descending order and find the source of the data .

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


Question: What is the total number of customers who use banks in New York City?

SELECT sum(no_of_customers) FROM bank WHERE city  =  'New York City'

What is the total number of customers who use banks in New York City ?

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


Question: Calculate the average crime rate per month in the highest populous area.

SELECT CAST(COUNT(T2.report_no) AS REAL) / 12 FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no GROUP BY T1.community_area_no HAVING COUNT(T1.population) ORDER BY COUNT(T1.population) LIMIT 1

Calculate the average crime rate per month in the highest populous area .


Question: Find the professor ID and position in faculty who taught high-level undergraduate course of less than 10 in ID.

SELECT T1.p_id, T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.courseLevel = 'Level_400' AND T2.course_id < 10

Find the professor ID and position in faculty who taught high - level undergraduate course of less than 10 in ID .

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


Question: How many colleges in total?


Question: Which artists have released singles with the tag 1970s?

SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' AND T2.tag LIKE '1970s'

Which artists have released singles with the tag 1970s ?

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


Question: Who are the professors who gave advice to students in the 12th years of program?

SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_12'

Who are the professors who gave advice to students in the 12th years of program ?

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


Question: How many countries are there in the No.2 region?

SELECT COUNT(n_nationkey) FROM nation WHERE n_regionkey = 2

How many countries are there in the No.2 region ?


Question: What are the phone numbers of all customers and suppliers.

SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers

What are the phone numbers of all customers and suppliers .


Question: Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.

SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T1.balance + T2.balance

Find the total checking and saving balance of all accounts sorted by the total balance in ascending order .

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


Question: List down the open secrets and thomas ID of the democrat senators of New Jersey.

SELECT T1.opensecrets_id, T1.thomas_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NJ' GROUP BY T1.opensecrets_id, T1.thomas_id

List down the open secrets and thomas ID of the democrat senators of New Jersey .

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


Question: Return the model and build year of cars that include "DJ" in their model names.

SELECT model ,  build_year FROM vehicle WHERE model LIKE '%DJ%'

Return the model and build year of cars that include " DJ " in their model names .

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


Question: What are all the phone numbers?

SELECT customer_phone FROM available_policies


Question: What is the total number of game played for players from USA?

SELECT COUNT(T2.GP) FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA'

What is the total number of game played for players from USA ?


Question: How many keywords are there for season 9, episode 23 of law_and_order?

SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23

How many keywords are there for season 9 , episode 23 of law_and_order ?

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


Question: Please list the names of the cards that have a text box.

SELECT DISTINCT name FROM cards WHERE isTextless = 0

Please list the names of the cards that have a text box .


Question: Which artist has released the most singles with the tag "soul"?

SELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.releaseType = 'single' GROUP BY T1.artist ORDER BY COUNT(T1.releaseType) DESC LIMIT 1

Which artist has released the most singles with the tag " soul " ?

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


Question: What are the duration of the longest and shortest pop tracks in milliseconds?

SELECT max(Milliseconds) ,  min(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Pop"

What are the duration of the longest and shortest pop tracks in milliseconds ?

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


Question: Show the transaction types and the total amount of transactions.

SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type

Show the transaction types and the total amount of transactions .

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


Question: Show all distinct region names ordered by their labels.

SELECT DISTINCT region_name FROM region ORDER BY Label

Show all distinct region names ordered by their labels .


Question: What ingredients does the longest cooking time recipe have?

SELECT T3.name 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 ORDER BY T1.cook_min DESC LIMIT 1

What ingredients does the longest cooking time recipe have ?


Question: What is the average total donations received by Fresno County colleges?

SELECT SUM(T2.donation_optional_support + T2.donation_to_project) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_county = 'Fresno'

What is the average total donations received by Fresno County colleges ?

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


Question: List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay.

SELECT T3.f_name, T3.l_name, T2.capability, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Merwyn' AND T1.last_name = 'Conkay'

List the research assistants ' full names , capabilities and GPAs who were under the supervision of Merwyn Conkay .

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


Question: Find the community area where the least number of domestic crimes happened.

SELECT T2.community_area_no FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.domestic = 'TRUE' GROUP BY T2.community_area_no ORDER BY COUNT(T2.community_area_no) ASC LIMIT 1

Find the community area where the least number of domestic crimes happened .

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


Question: How many customers rented for an above-average period?

SELECT COUNT(customer_id) FROM rental WHERE return_date - rental_date > ( SELECT AVG(return_date - rental_date) FROM rental )

How many customers rented for an above - average period ?


Question: Show publishers that have more than one publication.

SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*)  >  1

Show publishers that have more than one publication .


Question: List down the customer company names, addresses, phones and faxes which are located in London.

SELECT CompanyName, Address, Phone, Fax FROM Customers WHERE City = 'London'

List down the customer company names , addresses , phones and faxes which are located in London .

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


Question: Return the models of vehicles that have never been driven.

SELECT model FROM vehicle EXCEPT SELECT T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id

Return the models of vehicles that have never been driven .


Question: List down the territory IDs, descriptions and region description which are under the in-charge of Nancy Davolio,

SELECT T3.RegionID, T3.TerritoryDescription, T4.RegionDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T1.LastName = 'Davolio' AND T1.FirstName = 'Nancy'

List down the territory IDs , descriptions and region description which are under the in - charge of Nancy Davolio ,

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


Question: For every order, how many products does it contain, and what are the orders' statuses and ids?

SELECT T1.order_id ,  T1.order_status_code ,  count(*) FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id

For every order , how many products does it contain , and what are the orders ' statuses and ids ?

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


Question: What percentage of countries became independent during the year 1960?

SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Independence) = '1960' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics

What percentage of countries became independent during the year 1960 ?

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


Question: What are the prices of products that have never gotten a complaint?

SELECT product_price FROM products WHERE product_id NOT IN (SELECT product_id FROM complaints)

What are the prices of products that have never gotten a complaint ?


Question: Who was the alderman of the legislative district where case No. JB103470 took place? Give the full name.

SELECT T1.alderman_first_name, T1.alderman_last_name FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.case_number = 'JB103470'

Who was the alderman of the legislative district where case No . JB103470 took place ? Give the full name .

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


Question: What are the different home conferences from the university table?

SELECT DISTINCT home_conference FROM University

What are the different home conferences from the university table ?

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


Question: What are the biographical data and the date of transcript issuance of each student?

SELECT T1.bio_data ,  T2.date_of_transcript FROM Students AS T1 JOIN Transcripts AS T2 ON T1.student_id  =  T2.student_id

What are the biographical data and the date of transcript issuance of each student ?

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


Question: Please list all songs in volumes in ascending alphabetical order.

Please list all songs in volumes in ascending alphabetical order .


Question: Show the country of players with earnings more than 1400000 and players with earnings less than 1100000.

SELECT Country FROM player WHERE Earnings  >  1400000 INTERSECT SELECT Country FROM player WHERE Earnings  <  1100000

Show the country of players with earnings more than 1400000 and players with earnings less than 1100000 .

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


Question: Provide the ID of the most popular platform in Europe.

SELECT T.game_platform_id FROM ( SELECT T1.game_platform_id, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' GROUP BY T1.game_platform_id ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t

Provide the ID of the most popular platform in Europe .

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


Question: What are the average prices of hotels grouped by their pet policy.

SELECT pets_allowed_yn ,  avg(price_range) FROM HOTELS GROUP BY pets_allowed_yn

What are the average prices of hotels grouped by their pet policy .


Question: What is the total quantity available by all suppliers for the part "hot spring dodger dim light"?

SELECT SUM(T1.ps_availqty) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'

What is the total quantity available by all suppliers for the part " hot spring dodger dim light " ?

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


Question: What is the age of the doctor named Zach?

SELECT age FROM Person WHERE job  =  'doctor' AND name  =  'Zach'

What is the age of the doctor named Zach ?

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


Question: What are the race and alignment of Cameron Hicks?

SELECT T2.race, T3.alignment FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id INNER JOIN alignment AS T3 ON T1.alignment_id = T3.id WHERE T1.superhero_name = 'Cameron Hicks'

What are the race and alignment of Cameron Hicks ?

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


Question: State the nick name of player ID 'aubinje01'. List all the teams and season he played for.

SELECT DISTINCT T1.nameNick, T3.year, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T1.playerID = 'aubinje01'

State the nick name of player ID ' aubinje01 ' . List all the teams and season he played for .

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


Question: How many businesses in Scottsdale are rated as "wonderful experience"?

SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3

How many businesses in Scottsdale are rated as " wonderful experience " ?


Question: Give the number of users who do not show their genders.

SELECT COUNT(UserID) AS user_number FROM user WHERE Gender = 'Unknown'

Give the number of users who do not show their genders .


Question: Which was Lewis Hamilton first race? What was his points recorded for his first race event?

SELECT T1.name, T2.points FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' ORDER BY T1.year ASC LIMIT 1

Which was Lewis Hamilton first race ? What was his points recorded for his first race event ?

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


Question: Which city does the address id 547 belong to?

SELECT city FROM address WHERE address_id = 547

Which city does the address i d 547 belong to ?

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


Question: List out the discount levels applied for all orders from Ole Group.

SELECT T FROM ( SELECT DISTINCT CASE  WHEN T1.`Customer Names` = 'Ole Group' THEN T2.`Discount Applied` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL

List out the discount levels applied for all orders from Ole Group .

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


Question: What are the names and budgets of departments with budgets greater than the average?

SELECT dept_name ,  budget FROM department WHERE budget  >  (SELECT avg(budget) FROM department)

What are the names and budgets of departments with budgets greater than the average ?

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


Question: Provide the full name of all the actors of the film "Ending Crowds".

SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ENDING CROWDS'

Provide the full name of all the actors of the film " Ending Crowds " .

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


Question: Does the KSV Cercle Brugge team have a slow, balanced or fast speed class?

SELECT DISTINCT t1.buildUpPlaySpeedClass FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.team_long_name = 'KSV Cercle Brugge'

Does the KSV Cercle Brugge team have a slow , balanced or fast speed class ?

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


Question: Give me a list of names and years of races that had any driver whose forename is Lewis?

SELECT T2.name ,  T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"

Give me a list of names and years of races that had any driver whose forename is Lewis ?

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


Question: What brands of beer has Peg Winchester consumed?

SELECT T3.BrandName FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Peg' AND T1.Last = 'Winchester'

What brands of beer has Peg Winchester consumed ?


Question: Give the time stamp for event No.887711.

SELECT timestamp FROM events WHERE event_id = '887711'

Give the time stamp for event No.887711 .

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


Question: Who was the director of the movie "Tokyo Eyes"？

SELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes'

Who was the director of the movie " Tokyo Eyes " ？

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


Question: Give the number of students living in either HKG or CHI.

SELECT count(*) FROM Student WHERE city_code  =  "HKG" OR city_code  =  "CHI"

Give the number of students living in either HKG or CHI .

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


Question: What is the project id and detail for the project with at least two documents?

SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2

What is the project i d and detail for the project with at least two documents ?

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


Question: Show the delegate from district 1 in election.

SELECT Delegate FROM election WHERE District  =  1

Show the delegate from district 1 in election .

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


Question: What is detail of the student who registered the most number of courses?

SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1

What is detail of the student who registered the most number of courses ?

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


Question: Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?

SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000

Among the cars with an engine displacement of no less than 400 cubic millimeter , how many cars cost at least 30,000 ?

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


Question: Who are the top 5 actors with the highest number of films? List their full names and calculate the average number of films for each of the actors.

SELECT T.first_name, T.last_name, num FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num 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 GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 5

Who are the top 5 actors with the highest number of films ? List their full names and calculate the average number of films for each of the actors .

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


Question: How many allergies are there?

SELECT count(DISTINCT allergy) FROM Allergy_type


Question: Find the name, account type, and account balance of the customer who has the highest credit score.

SELECT cust_name ,  acc_type ,  acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1

Find the name , account type , and account balance of the customer who has the highest credit score .

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


Question: What are the checking and savings balances in accounts belonging to Brown?

SELECT T2.balance ,  T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T1.name  =  'Brown'

What are the checking and savings balances in accounts belonging to Brown ?

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


Question: Among the budgets for Food, which one has the highest budgeted amount?

SELECT budget_id FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget )

Among the budgets for Food , which one has the highest budgeted amount ?

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


Question: Find the name of the customer who has used the most types of services .

select t1.customer_details from customers as t1 join customers_and_services as t2 on t1.customer_id  =  t2.customer_id group by t1.customer_details order by count(*) desc limit 1


Question: Find the name of the courses that do not have any prerequisite?

SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)

Find the name of the courses that do not have any prerequisite ?


Question: Name the driver with the most winning. Mention his nationality and what is his maximum point scores.

SELECT T1.forename, T1.surname, T1.nationality, MAX(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId WHERE T2.wins >= 1 GROUP BY T1.forename, T1.surname, T1.nationality ORDER BY COUNT(T2.wins) DESC LIMIT 1

Name the driver with the most winning . Mention his nationality and what is his maximum point scores .

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


Question: What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"?

SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"

What are the date of ceremony of music festivals with category " Best Song " and result " Awarded " ?

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


Question: What percentage of AdventureWorks employees are men?

SELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessentityID) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessentityID = T2.BusinessentityID WHERE T1.PersonType = 'EM'

What percentage of AdventureWorks employees are men ?


Question: Show the number of clients.


Question: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010?

SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG";

How many adults stay in the room CONRAD SELBIG checked in on Oct 23 , 2010 ?

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


Question: What is the height in centimeter of the tallest player born in Edmonton, Alberta, Canada?

SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.birthplace = 'Edmonton, AB, CAN' ORDER BY T2.height_in_cm DESC LIMIT 1

What is the height in centimeter of the tallest player born in Edmonton , Alberta , Canada ?

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


Question: How many counties are there in Virginia State?

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

How many counties are there in Virginia State ?


Question: What's the lastest household survey in Angola and when did it take place?

SELECT LatestHouseholdSurvey, PppSurveyYear FROM Country WHERE ShortName = 'Angola'

What 's the lastest household survey in Angola and when did it take place ?

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


Question: How many counties are there in total?


Question: Who is the character that said "This is Illyria, lady."?

SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'This is Illyria, lady.'

Who is the character that said " This is Illyria , lady . " ?

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


Question: How many cards with print rarity have ruling text printed on 01/02/2007?

SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'rare' AND T2.date = '2007-02-01'

How many cards with print rarity have ruling text printed on 01/02/2007 ?

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


Question: How many of the inspections with serious point levels have no fines?

SELECT COUNT(DISTINCT T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.point_level = 'Serious ' AND T2.fine = 0

How many of the inspections with serious point levels have no fines ?

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


Question: How many right-shooted players have a height of 5'7''?

SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch = '5''7"' AND T1.shoots = 'R'

How many right - shooted players have a height of 5'7 '' ?

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


Question: For the home weather station of store no.15, what was the dew point on 2012/2/18?

SELECT T1.dewpoint FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 15 AND T1.`date` = '2012-02-18'

For the home weather station of store no.15 , what was the dew point on 2012/2/18 ?

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


Question: Find the number of different departments in each school whose number of different departments is less than 5.

SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5

Find the number of different departments in each school whose number of different departments is less than 5 .

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


Question: What is the total value of shipped vintage car orders from 2003-2004?

SELECT SUM(T2.priceEach * T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber WHERE T3.status = 'Shipped' AND T3.orderDate BETWEEN '2003-01-01' AND '2004-12-31'

What is the total value of shipped vintage car orders from 2003 - 2004 ?

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


Question: How many legislators are not senator?

SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL


Question: Among the airports whose destination is Logan International, what is the airline id of the carrier operator with the highest delay in minutes due to security?

SELECT T2.OP_CARRIER_AIRLINE_ID FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T1.Description = 'Boston, MA: Logan International' AND T2.DEST = 'BOS' ORDER BY T2.SECURITY_DELAY DESC LIMIT 1

Among the airports whose destination is Logan International , what is the airline i d of the carrier operator with the highest delay in minutes due to security ?

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


Question: What are the names of pilots who own both Piper Cub and the B-52 Bomber?

SELECT pilot_name FROM pilotskills WHERE plane_name  =  'Piper Cub' INTERSECT SELECT pilot_name FROM pilotskills WHERE plane_name  =  'B-52 Bomber'

What are the names of pilots who own both Piper Cub and the B-52 Bomber ?

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


Question: What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin?

SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin')

What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin ?

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


Question: In the year 1958, what is the total number of players that became hall of famers?

SELECT COUNT(hofID) FROM HOF WHERE category = 'Player' AND year = 1958

In the year 1958 , what is the total number of players that became hall of famers ?

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


Question: Which assets did not incur any fault log? List the asset model.

SELECT asset_model FROM Assets WHERE asset_id NOT IN (SELECT asset_id FROM Fault_Log)

Which assets did not incur any fault log ? List the asset model .

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


Question: How to pay the donation of the project that teacher "822b7b8768c17456fdce78b65abcc18e" created?

SELECT T2.payment_method FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'

How to pay the donation of the project that teacher " 822b7b8768c17456fdce78b65abcc18e " created ?

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


Question: What are all the the participant ids, type code and details?

SELECT Participant_ID ,  Participant_Type_Code ,  Participant_Details FROM  Participants

What are all the the participant ids , type code and details ?

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


Question: Write down the times when there is no available bike to borrow in a station. List down the stations name and location coordinate.

SELECT T2.time, T1.name, T1.lat, T1.long FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T2.bikes_available = 0

Write down the times when there is no available bike to borrow in a station . List down the stations name and location coordinate .

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


Question: Name the customer who sent the shipment to Oak Park.

SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Oak Park'

Name the customer who sent the shipment to Oak Park .

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


Question: Find the paper ID, title, published year and journal's full name of the paper which included the most number in author.

SELECT T1.Id, T1.Title, T1.Year, T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id GROUP BY T2.AuthorId ORDER BY COUNT(T2.AuthorId) DESC LIMIT 1

Find the paper ID , title , published year and journal 's full name of the paper which included the most number in author .

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


Question: When did the user with login name ratione register?

SELECT date_registered FROM Users WHERE login_name  =  'ratione';

When did the user with login name ratione register ?

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


Question: How many office supply orders were made by Cindy Stewart in the south superstore?

SELECT COUNT(*) FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.Category = 'Office Supplies' AND T2.`Customer Name` = 'Cindy Stewart'

How many office supply orders were made by Cindy Stewart in the south superstore ?

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


Question: Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.

SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1

Among those engineers who have visited , which engineer makes the least number of visits ? List the engineer i d , first name and last name .

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


Question: For the flight from ATL to PHL on 2018/8/1 that scheduled local departure time as "2040", which air carrier does this flight belong to?

SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/1' AND T1.ORIGIN = 'ATL' AND T1.DEST = 'PHL' AND T1.CRS_DEP_TIME = '2040' GROUP BY T2.Description

For the flight from ATL to PHL on 2018/8/1 that scheduled local departure time as " 2040 " , which air carrier does this flight belong to ?

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


Question: What is the release year of the game that gained 350000 sales in North America?

SELECT T3.release_year FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T2.num_sales * 100000 = 350000 AND T1.region_name = 'North America'

What is the release year of the game that gained 350000 sales in North America ?

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


Question: What are the distinct ages of the heads who are acting?

SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id  =  T2.head_id WHERE T2.temporary_acting  =  'Yes'

What are the distinct ages of the heads who are acting ?

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


Question: Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers.

SELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3

Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers .

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


Question: Which river with its mouth in the Donau River and a length greater than 500 km is located in Slovenia?

SELECT T2.River FROM country AS T1 INNER JOIN geo_river AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Slovenia' AND T2.River IN ( SELECT NAME FROM river WHERE Length > 500 AND River = 'Donau' )

Which river with its mouth in the Donau River and a length greater than 500 km is located in Slovenia ?

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


Question: What is the content with the greatest value across all boxes?

SELECT CONTENTS FROM boxes ORDER BY value DESC LIMIT 1

What is the content with the greatest value across all boxes ?

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


Question: Which rank has the smallest number of faculty members?

SELECT rank FROM Faculty GROUP BY rank ORDER BY count(*) ASC LIMIT 1

Which rank has the smallest number of faculty members ?


Question: What is the prediction relationship class id of the tallest image?

SELECT T1.PRED_CLASS_ID FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID ORDER BY T2.H DESC LIMIT 1

What is the prediction relationship class i d of the tallest image ?

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


Question: Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes.

SELECT CAST(SUM(CASE WHEN T1.cook_min < 20 AND T2.cholestrl = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id

Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes .

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


Question: What are the full names of the top 5 most crowded ward aldermen?

SELECT alderman_first_name, alderman_last_name FROM Ward ORDER BY Population DESC LIMIT 5

What are the full names of the top 5 most crowded ward aldermen ?


Question: What is the most popular first name of the actors?

SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1

What is the most popular first name of the actors ?

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


Question: Give the country id and corresponding count of cities in each country.

SELECT country_id ,  COUNT(*) FROM locations GROUP BY country_id

Give the country i d and corresponding count of cities in each country .

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


Question: Give the full name of driver who transported the items on 3/2/2016.

SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-03-02'

Give the full name of driver who transported the items on 3/2/2016 .


Question: For the movie "Reign of Fire", which department was Marcia Ross in?

SELECT T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T3.person_name = 'Marcia Ross' AND T1.title = 'Reign of Fire'

For the movie " Reign of Fire " , which department was Marcia Ross in ?

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


Question: What is the title of the employee with the highest number of territories in charge?

SELECT T1.Title FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.Title ORDER BY COUNT(T2.TerritoryID) DESC LIMIT 1

What is the title of the employee with the highest number of territories in charge ?

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


Question: State the address of Amy Klobuchar at the term of 4th of January 2001.

SELECT T2.address FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Amy' AND T1.last_name = 'Klobuchar' AND T2.start = '2001-04-01'

State the address of Amy Klobuchar at the term of 4th of January 2001 .

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


Question: For each location, what are the total, average, and maximum capacities of warehouses?

SELECT sum(capacity) ,  avg(capacity) ,  max(capacity) ,  LOCATION FROM warehouses GROUP BY LOCATION

For each location , what are the total , average , and maximum capacities of warehouses ?

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


Question: What is the total amount of all payments?

What is the total amount of all payments ?


Question: Please list the top ten teams with the highest scores in 2000.

SELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10

Please list the top ten teams with the highest scores in 2000 .


Question: What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt?

SELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa'

What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt ?

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


Question: Calculate the average game sales for the PS2 platform.

SELECT SUM(T3.num_sales * 100000) / COUNT(T1.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T2.id = T3.game_platform_id WHERE T1.platform_name = 'PS2'

Calculate the average game sales for the PS2 platform .


Question: What is the title of the most expensive book?

SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id ORDER BY T2.price DESC LIMIT 1

What is the title of the most expensive book ?


Question: Find out the language ID of the movie with the highest popularity.

SELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.popularity DESC LIMIT 1

Find out the language ID of the movie with the highest popularity .

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


Question: How many votes of 5-star did the episode "Lisa the Drama Queen" receive?

SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lisa the Drama Queen' AND T2.stars = 5;

How many votes of 5 - star did the episode " Lisa the Drama Queen " receive ?

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


Question: What are characteristic names used at least twice across all products?

SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id GROUP BY t3.characteristic_name HAVING count(*)  >= 2

What are characteristic names used at least twice across all products ?

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


Question: What are the average height and width of paintings grouped by painters and ordered by name?

SELECT avg(height_mm) ,  avg(width_mm) ,  painterID FROM paintings GROUP BY painterID ORDER BY title

What are the average height and width of paintings grouped by painters and ordered by name ?

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


Question: find all dependent names who have a spouse relation with some employee.

SELECT Dependent_name FROM dependent WHERE relationship  =  'Spouse'

find all dependent names who have a spouse relation with some employee .

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


Question: Who is the president of the club "Bootup Baltimore"? Give me the first and last name.

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"

Who is the president of the club " Bootup Baltimore " ? Give me the first and last name .

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


Question: What is the most common mill type, and how many are there?

SELECT TYPE ,  count(*) FROM mill GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1

What is the most common mill type , and how many are there ?

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


Question: How many neighborhoods can be found in the Forest Glen community area?

SELECT SUM(CASE WHEN T2.community_area_name = 'Forest Glen' THEN 1 ELSE 0 END) FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no

How many neighborhoods can be found in the Forest Glen community area ?

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


Question: Give the full name of the actor who acted in the most number of movies?

SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1

Give the full name of the actor who acted in the most number of movies ?

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


Question: List the name of stations that were installed from 8/5/2013 to 12/31/2013. Indicate their installation date and city name.

SELECT name, installation_date, city FROM station WHERE (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) = '5' AND SUBSTR(CAST(installation_date AS TEXT), INSTR(installation_date, '/') + 1, -6) >= '8' AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') OR (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) IN ( '6', '7', '8', '9', '10', '11', '12' ) AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013')

List the name of stations that were installed from 8/5/2013 to 12/31/2013 . Indicate their installation date and city name .

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


Question: Compute the total payment made by Sarah Lewis for film rentals so far.

SELECT SUM(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'

Compute the total payment made by Sarah Lewis for film rentals so far .

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


Question: What is the average distance and price for all flights from LA?

SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles"

What is the average distance and price for all flights from LA ?

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


Question: What are the names of products with category "Spices"?

SELECT product_name FROM products WHERE product_category_code  =  "Spices"

What are the names of products with category " Spices " ?

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


Question: Find the number of employees of each gender whose salary is lower than 50000.

SELECT count(*) ,  sex FROM employee WHERE salary  <  50000 GROUP BY sex

Find the number of employees of each gender whose salary is lower than 50000 .

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


Question: What are the names of all aicrafts that have never won any match?

SELECT Aircraft FROM aircraft WHERE Aircraft_ID NOT IN (SELECT Winning_Aircraft FROM MATCH)

What are the names of all aicrafts that have never won any match ?

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


Question: Give the hero ID of superhero with the lowest attribute value.

SELECT hero_id FROM hero_attribute WHERE attribute_value = ( SELECT MIN(attribute_value) FROM hero_attribute )

Give the hero ID of superhero with the lowest attribute value .

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


Question: When was the bike station from which the bike was borrowed on trip ID4069 installed?

SELECT T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069

When was the bike station from which the bike was borrowed on trip ID4069 installed ?

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


Question: For the orders of Customer "WHITC", what is the percentage of the orders were fulfilled with shipper company "United Package"?

SELECT CAST(COUNT(CASE WHEN T2.CompanyName = 'United Package' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.CustomerID = 'WHITC'

For the orders of Customer " WHITC " , what is the percentage of the orders were fulfilled with shipper company " United Package " ?

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


Question: List the capability of research postgraduate students with an intellegence level of 4 and above.

SELECT T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.type = 'RPG' AND T2.intelligence >= 4

List the capability of research postgraduate students with an intellegence level of 4 and above .

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


Question: Find the average credit score of the customers who have some loan.

SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)

Find the average credit score of the customers who have some loan .

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


Question: What are the schools that were either founded before 1850 or are public?

SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'

What are the schools that were either founded before 1850 or are public ?

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


Question: Which recipe in the database contains the most total fat? Give its title.

SELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1

Which recipe in the database contains the most total fat ? Give its title .

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