Question: Find the book series that have some book selling more than 1000 and some book less 500.

SELECT book_series FROM book WHERE sale_amount  >  1000 INTERSECT SELECT book_series FROM book WHERE sale_amount  <  500

Find the book series that have some book selling more than 1000 and some book less 500 .

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


Question: List the addresses of all the course authors or tutors.

SELECT address_line_1 FROM Course_Authors_and_Tutors

List the addresses of all the course authors or tutors .

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


Question: What are the departure and arrival dates of all flights from LA to Honolulu?

SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu"

What are the departure and arrival dates of all flights from LA to Honolulu ?

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


Question: What is the average number of pages of David Coward's books?

SELECT AVG(T1.num_pages) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'David Coward'

What is the average number of pages of David Coward 's books ?

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


Question: In which city is the store with the highest sales order unit price located?

SELECT T2.`City Name` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1

In which city is the store with the highest sales order unit price located ?

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


Question: What are the start and end dates for incidents with incident type code "NOISE"?

SELECT date_incident_start ,  date_incident_end FROM Behavior_Incident WHERE incident_type_code  =  "NOISE"

What are the start and end dates for incidents with incident type code " NOISE " ?

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


Question: Show name and distance for all aircrafts.

Show name and distance for all aircrafts .


Question: Provide the ranking criteria and scores in 2005 that were received by Harvard University.

SELECT T1.criteria_name, T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Harvard University' AND T2.year = 2005

Provide the ranking criteria and scores in 2005 that were received by Harvard University .

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


Question: How old is each gender, on average?

SELECT avg(age) ,  gender FROM Person GROUP BY gender


Question: Which podcast was reviewed the latest? State the date of creation, podcast tile and rating.

SELECT T1.podcast_id, T2.created_at, T2.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id ORDER BY T2.created_at DESC LIMIT 1

Which podcast was reviewed the latest ? State the date of creation , podcast tile and rating .

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


Question: What are the login names used both by some course authors and some students?

SELECT login_name FROM Course_Authors_and_Tutors INTERSECT SELECT login_name FROM Students

What are the login names used both by some course authors and some students ?

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


Question: Which authors did not submit to any workshop?

SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)

Which authors did not submit to any workshop ?


Question: How many patients with a normal level of complement 3 have a P pattern observed in the sheet of ANA examination?

SELECT COUNT(DISTINCT T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C3 > 35 AND T1.`ANA Pattern` = 'P'

How many patients with a normal level of complement 3 have a P pattern observed in the sheet of ANA examination ?

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


Question: What is the publisher's information of New Moon Books?

SELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books'

What is the publisher 's information of New Moon Books ?

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


Question: How many male students have no due payments?

SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'

How many male students have no due payments ?


Question: Display the first name, and department number for all employees whose last name is "McEwen".

SELECT first_name ,  department_id FROM employees WHERE last_name  =  'McEwen'

Display the first name , and department number for all employees whose last name is " McEwen " .

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


Question: How many adventure movies are there that were released in 2000?

SELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Adventure' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2000

How many adventure movies are there that were released in 2000 ?

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


Question: Find all the male members of club "Hopkins Student Enterprises". Show the first name 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  =  "Hopkins Student Enterprises" AND t3.sex  =  "M"

Find all the male members of club " Hopkins Student Enterprises " . Show the first name and last name .

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


Question: What is the first name of clients who have the highest priority?

SELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs )

What is the first name of clients who have the highest priority ?

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


Question: Find the name of the most popular party form.

SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1

Find the name of the most popular party form .


Question: What is the average score of Lewis Hamilton among all the Turkish Grand Prix?

SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' AND T3.name = 'Turkish Grand Prix'

What is the average score of Lewis Hamilton among all the Turkish Grand Prix ?

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


Question: Which county has the largest population? Give me the name of the county.

SELECT County_name FROM county ORDER BY Population DESC LIMIT 1

Which county has the largest population ? Give me the name of the county .

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


Question: List down all the roles of Matt Groening on the episode titled 'In the Name of the Grandfather' along with the episode number and series number.

SELECT T2.role, T1.episode, T1.number_in_series FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Matt Groening' AND T1.title = 'In the Name of the Grandfather';

List down all the roles of Matt Groening on the episode titled ' In the Name of the Grandfather ' along with the episode number and series number .

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


Question: Which country's indicator for Adolescent fertility rate is the highest in 1960, please give its special notes.

SELECT DISTINCT T1.CountryCode, T1.SpecialNotes FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Value = ( SELECT Value FROM Indicators WHERE IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND Year = 1960 ORDER BY Value DESC LIMIT 1 )

Which country 's indicator for Adolescent fertility rate is the highest in 1960 , please give its special notes .

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


Question: Calculate the percentage of object samples that are related to street lights.

SELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'street lights' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_SAMPLE_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID

Calculate the percentage of object samples that are related to street lights .

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


Question: What is the assumed name of the business that has the highest total fine in 2014?

SELECT T.dba_name FROM ( SELECT T1.dba_name, SUM(T3.fine) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE strftime('%Y', T2.inspection_date) = '2014' GROUP BY T1.dba_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) AS T

What is the assumed name of the business that has the highest total fine in 2014 ?

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


Question: How many flights from American Airlines were cancelled due to a type A cancellation code?

SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLATION_CODE = 'A' AND T2.Description = 'American Airlines Inc.: AA' AND T1.CANCELLED = 1

How many flights from American Airlines were cancelled due to a type A cancellation code ?

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


Question: What is the average processed time of the solution paths inside the "https://github.com/zphingphong/DiscardCustomerApp.git"?

SELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/zphingphong/DiscardCustomerApp.git'

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


Question: List out the series code and country code of the poor countries that located in Latin American & Carribbean.

SELECT T2.SeriesCode, T2.CountryCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Region = 'Latin America & Caribbean' AND t1.incomegroup = 'Low income'

List out the series code and country code of the poor countries that located in Latin American & Carribbean .

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


Question: List down the molecule id for non carcinogenic molecules.

SELECT T.molecule_id FROM molecule AS T WHERE T.label = '-'

List down the molecule i d for non carcinogenic molecules .

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


Question: How many bottles of beer have been bought by Jim Breech?

SELECT COUNT(T3.ContainerType) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T2.CustomerID = T1.CustomerID INNER JOIN rootbeer AS T3 ON T3.RootBeerID = T2.RootBeerID WHERE T3.ContainerType = 'Bottle' AND T1.First = 'Jim' AND T1.Last = 'Breech'

How many bottles of beer have been bought by Jim Breech ?

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


Question: What are total salaries and department id for each department that has more than 2 employees?

SELECT department_id ,  SUM(salary) FROM employees GROUP BY department_id HAVING count(*)  >=  2

What are total salaries and department i d for each department that has more than 2 employees ?

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


Question: How many players are from Australia?

SELECT COUNT(CASE WHEN T2.Country_Name = 'Australia' THEN T1.Player_Id ELSE NULL END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id


Question: Compare the graduate cohort for Auburn University from 2011 to 2013?

SELECT SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2013 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'B' AND T2.race = 'X' AND T1.chronname = 'Auburn University'

Compare the graduate cohort for Auburn University from 2011 to 2013 ?

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


Question: How many different neighborhoods are there in Roseland community?

SELECT SUM(CASE WHEN T1.community_area_name = 'Roseland' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no

How many different neighborhoods are there in Roseland community ?


Question: State the country where the most positive sentiment tweets were posted.

SELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Sentiment) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Sentiment > 0 GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1

State the country where the most positive sentiment tweets were posted .


Question: List the titles of the films starred by Elvis Marx.

SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.length BETWEEN 110 AND 150 AND T1.first_name = 'Russell' AND T1.last_name = 'Close'

List the titles of the films starred by Elvis Marx .


Question: Among the bike trips started on the days with a fog in 2013, how many of those trips started from the station "2nd at Townsend"?

SELECT COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' AND T1.start_station_name = '2nd at Townsend' AND T2.zip_code = 94107

Among the bike trips started on the days with a fog in 2013 , how many of those trips started from the station " 2nd at Townsend " ?

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


Question: Which locations are shared by more than two wrestlers?

SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2

Which locations are shared by more than two wrestlers ?


Question: Return the average, minimum, maximum, and total transaction amounts.

SELECT avg(transaction_amount) ,  min(transaction_amount) ,  max(transaction_amount) ,   sum(transaction_amount) FROM Financial_transactions

Return the average , minimum , maximum , and total transaction amounts .

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


Question: What is the total amount of Community College District closure in 1989 in the city of San Francisco?

SELECT COUNT(School) FROM schools WHERE strftime('%Y', ClosedDate) = '1989' AND City = 'San Francisco' AND DOCType = 'Community College District'

What is the total amount of Community College District closure in 1989 in the city of San Francisco ?

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


Question: List the details of the teachers who teach some class whose detail has the substring 'data' but do not teach a class whose detail contains the prefix 'net'

SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.class_details LIKE '%data%' EXCEPT SELECT T1.teacher_details FROM Teachers AS T1 JOIN Classes AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.class_details LIKE 'net%'

List the details of the teachers who teach some class whose detail has the substring ' data ' but do not teach a class whose detail contains the prefix ' net '

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


Question: What is the id and last name of the driver who participated in the most races after 2010?

SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1

What is the i d and last name of the driver who participated in the most races after 2010 ?

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


Question: Write down the date received of complaints sent via Fax.

SELECT T1.`Date received` FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Fax'

Write down the date received of complaints sent via Fax .

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


Question: What is Vijay Singh Chauhan's region name?

SELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Vijay Singh Chauhan'

What is Vijay Singh Chauhan 's region name ?

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


Question: Find the total student enrollment for different affiliation type schools.

SELECT sum(enrollment) ,  affiliation FROM university GROUP BY affiliation

Find the total student enrollment for different affiliation type schools .


Question: Name the sales person for store Area Bike Accessories. Which territory is he / she in?

SELECT T4.Name FROM Store AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN SalesTerritory AS T4 ON T2.TerritoryID = T4.TerritoryID WHERE T1.Name = 'Area Bike Accessories'

Name the sales person for store Area Bike Accessories . Which territory is he / she in ?

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


Question: List by their ID number the 3 longest complaints.

SELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3

List by their ID number the 3 longest complaints .


Question: Show the names of journalists that have reported more than one event.

SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID  =  T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID  =  T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*)  >  1

Show the names of journalists that have reported more than one event .

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


Question: How much is the total quantity of items from the East region shipped on 3/25/2015? Name the products.

SELECT SUM(T1.Quantity), T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2015-03-25' AND T2.Region = 'East'

How much is the total quantity of items from the East region shipped on 3/25/2015 ? Name the products .

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


Question: How many products are there in the records?

How many products are there in the records ?


Question: Show the book title corresponding to the book with the most number of orders.

SELECT T2.title FROM Books_Order AS T1 JOIN Book AS T2 ON T1.isbn  =  T2.isbn GROUP BY T1.isbn ORDER BY count(*) DESC LIMIT 1

Show the book title corresponding to the book with the most number of orders .

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


Question: What are the top three universities with the most international students?

SELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id GROUP BY T2.university_name ORDER BY SUM(T1.num_students * T1.pct_international_students / 100) DESC LIMIT 3

What are the top three universities with the most international students ?

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


Question: What is the total number of households in Arecibo county?

SELECT SUM(T1.households) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'

What is the total number of households in Arecibo county ?

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


Question: What are the titles of books that have a sale price equal to the lowest sale price across all books ?

select title from book order by saleprice asc limit 1

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


Question: Which catalog publishers have substring "Murray" in their names?

SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"

Which catalog publishers have substring " Murray " in their names ?

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


Question: How many total occurrences are there in the three-letter words?

SELECT SUM(occurrences) FROM words WHERE LENGTH(word) = 3

How many total occurrences are there in the three - letter words ?


Question: Which district commander was responsible for more incidents in January, 2018, Robert A. Rubio or Glenn White?

SELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander IN ('Robert A. Rubio', 'Glenn White') AND SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.commander

Which district commander was responsible for more incidents in January , 2018 , Robert A. Rubio or Glenn White ?

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


Question: What is the receipt number and date of the receipt in which the most expensive item was bought?

SELECT T1.ReceiptNumber ,  T1.Date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber  =  T2.receipt JOIN goods AS T3 ON T2.item  =  T3.id ORDER BY T3.price DESC LIMIT 1

What is the receipt number and date of the receipt in which the most expensive item was bought ?

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


Question: In which country is the city of Grozny? Give the full name of the country.

SELECT T1.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Grozny'

In which country is the city of Grozny ? Give the full name of the country .

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


Question: What is the id of every song that has a resolution higher than that of a song with a rating below 8?

SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8)

What is the i d of every song that has a resolution higher than that of a song with a rating below 8 ?

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


Question:
How many teams did the team with the most victories in 1915 play against?
Indicate the name of the team who won the most games in 1915, as well as the names of the opposing team.

SELECT COUNT(DISTINCT oppID), T2.tmID, T2.oppID FROM Teams AS T1 INNER JOIN TeamVsTeam AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.year = 1915 GROUP BY T2.tmID, T2.oppID ORDER BY SUM(T2.W) DESC LIMIT 1

How many teams did the team with the most victories in 1915 play against ? Indicate the name of the team who won the most games in 1915 , as well as the names of the opposing team .

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


Question: List the name, address, and phone number of companies that supply products for more than thirty dollars per unit.

SELECT T2.CompanyName, T2.Address, T2.Phone FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice > 30

List the name , address , and phone number of companies that supply products for more than thirty dollars per unit .

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


Question: What are the names of all the clients, and the total amount of books ordered by each?

SELECT T2.name ,  sum(T3.amount) FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient JOIN Books_Order AS T3 ON T3.idOrder  =  T1.idOrder GROUP BY T1.idClient

What are the names of all the clients , and the total amount of books ordered by each ?

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


Question: Has Alex purchased product with id 498?

SELECT IIF(T1.ProductID = 498, 'YES', 'NO') FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Alex'

Has Alex purchased product with i d 498 ?


Question: What are the minimum, average, and maximum quantities ordered? Check all the invoices.

SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES

What are the minimum , average , and maximum quantities ordered ? Check all the invoices .

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


Question: How many female students have enlisted for the Army?

SELECT SUM(IIF(T3.name IS NULL, 1, 0)) AS "result" FROM enlist AS T1 INNER JOIN person AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T1.organ = 'army'

How many female students have enlisted for the Army ?


Question: Find the names of the customers who have an deputy policy.

SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id WHERE t1.policy_type_code  =  "Deputy"

Find the names of the customers who have an deputy policy .

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


Question: Among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes?

SELECT COUNT(SalesTaxRateID) FROM SalesTaxRate WHERE Name LIKE '%+%'

Among the sales with a tax applied to retail transaction , how many of them are charged by multiple types of taxes ?

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


Question: Please list all the predicted relation classes of object sample no.14 in image no.1.

SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID = 14 AND T2.OBJ2_SAMPLE_ID = 14

Please list all the predicted relation classes of object sample no.14 in image no.1 .

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


Question: What is the customer id, name, phone, and email for the customer with most orders?

SELECT T1.customer_id ,  T2.customer_name ,  T2.customer_phone ,  T2.customer_email FROM Customer_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

What is the customer i d , name , phone , and email for the customer with most orders ?

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


Question: Among all the customers, what is the percentage of the customer's nation being Germany?

SELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey

Among all the customers , what is the percentage of the customer 's nation being Germany ?

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


Question: Give the full name and phone of the customer who has the account name 162.

SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "162"

Give the full name and phone of the customer who has the account name 162 .

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


Question: What is the job title of the oldest employee in the company? In which department is he in?

SELECT T2.JobTitle, T4.Name FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN Department AS T4 ON T3.DepartmentID = T4.DepartmentID ORDER BY T2.HireDate LIMIT 1

What is the job title of the oldest employee in the company ? In which department is he in ?

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


Question: What is the publisher for Hawkman, Karate Kid and Speedy?

SELECT T2.publisher_name FROM superhero AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.superhero_name IN ('Hawkman', 'Karate Kid', 'Speedy')

What is the publisher for Hawkman , Karate Kid and Speedy ?

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


Question: In 1996, how many orders were from customers in the UK?

SELECT COUNT(T1.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' AND T1.Country = 'UK'

In 1996 , how many orders were from customers in the UK ?

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


Question: How many Henry Weinhard's were bought by Nicholas Sparks?

SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Nicholas' AND T1.Last = 'Sparks' AND T4.BrandName LIKE 'Henry Weinhard%s'

How many Henry Weinhard 's were bought by Nicholas Sparks ?

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


Question: Find the number of characteristics that the product "flax" has.

SELECT count(*) 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 WHERE t1.product_name  =  "flax"

Find the number of characteristics that the product " flax " has .

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


Question: What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?

SELECT f_id FROM song WHERE resolution  >  (SELECT max(resolution) FROM song WHERE rating  <  8)

What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8 ?

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


Question: Return the number of distinct staff who have attended a meeting?

SELECT count(DISTINCT staff_id) FROM Staff_in_meetings

Return the number of distinct staff who have attended a meeting ?

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


Question: How many states are in the central time zone? Write their full names.

SELECT SUM(CASE WHEN T1.time_zone = 'Central' THEN 1 ELSE 0 END) AS count FROM zip_data AS T1 INNER JOIN state AS T2 ON T2.abbreviation = T1.state WHERE T1.time_zone = 'Central'

How many states are in the central time zone ? Write their full names .

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


Question: List the locations ids, compartments and containers for the Lock Ring

SELECT T2.LocationID, T2.Shelf, T2.Bin FROM Product AS T1 INNER JOIN ProductInventory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Lock Ring'

List the locations ids , compartments and containers for the Lock Ring

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


Question: How many of the cars from Japan weighed less than 3000?

SELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T4.weight < 3000

How many of the cars from Japan weighed less than 3000 ?

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


Question: How many buildings are there?


Question: Among the students who got a B in the course Machine Learning Theory, how many of them have a gpa of over 3?

SELECT COUNT(student_id) FROM registration WHERE grade = 'B' AND student_id IN ( SELECT student_id FROM student WHERE gpa > 3 AND course_id IN ( SELECT course_id FROM course WHERE name = 'Machine Learning Theory' ) )

Among the students who got a B in the course Machine Learning Theory , how many of them have a gpa of over 3 ?

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


Question: How many donations were paid via credit card to Memphis City School District?

SELECT COUNT(T1.projectid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_method = 'creditcard' AND T2.school_district = 'Memphis City School District'

How many donations were paid via credit card to Memphis City School District ?

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


Question: How many British drivers were born after 1980?

SELECT COUNT(driverId) FROM drivers WHERE nationality = 'British' AND STRFTIME('%Y', dob) > '1980'

How many British drivers were born after 1980 ?


Question: What is the maximum number that a certain service is provided? List the service id, details and number.

SELECT T1.service_id ,  T1.service_details ,  count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id  =  T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1

What is the maximum number that a certain service is provided ? List the service i d , details and number .

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


Question: What is the id and detail of the vehicle used in lessons for most of the times?

SELECT T1.vehicle_id ,  T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1

What is the i d and detail of the vehicle used in lessons for most of the times ?

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


Question: What are the medical encounter ids of patients who were born in Pembroke MA US?

SELECT DISTINCT T1.ENCOUNTER FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.birthplace = 'Pembroke MA US'

What are the medical encounter ids of patients who were born in Pembroke MA US ?

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


Question: What is the first and last name of the player with the highest field goal made rate in 1973?

SELECT T1.firstName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE year = 1973 ORDER BY CAST(T2.fgMade AS REAL) / T2.fgAttempted DESC LIMIT 1

What is the first and last name of the player with the highest field goal made rate in 1973 ?

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


Question: Please list the names of all the Olympic games that John Aalberg has taken part in.

SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg'

Please list the names of all the Olympic games that John Aalberg has taken part in .

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


Question: Show the names and ids of tourist attractions that are visited at least two times.

SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2

Show the names and ids of tourist attractions that are visited at least two times .

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


Question: Please give more information about the Formula_1 races that used the Silverstone Circuit.

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

Please give more information about the Formula_1 races that used the Silverstone Circuit .

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


Question: How many authors are named Adam?

SELECT COUNT(*) FROM author WHERE author_name LIKE 'Adam%'


Question: For the goalie who had the highest defensive success rate in the postseason of 2011, what's his legends ID ?

SELECT T2.legendsID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2011 ORDER BY 1 - CAST(T1.PostGA AS REAL) / T1.PostSA DESC LIMIT 1

For the goalie who had the highest defensive success rate in the postseason of 2011 , what 's his legends ID ?

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


Question: What is the review length of user 11021 to business with business ID 3?

SELECT review_length FROM Reviews WHERE user_id = 11021 AND business_id = 3

What is the review length of user 11021 to business with business ID 3 ?

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


Question: How many games are not of the genres 'Role-Playing', 'Shooter' and 'Simulation'?

SELECT COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation')

How many games are not of the genres ' Role - Playing ' , ' Shooter ' and ' Simulation ' ?

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


Question: Show all headquarters without a company in banking industry.

SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry  =  'Banking'

Show all headquarters without a company in banking industry .

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


Question: How many samples of food object are there in image no.6?

SELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food'

How many samples of food object are there in image no.6 ?


Question: What is the structure of the document with the least number of accesses?

SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code  =  t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY count(*) DESC LIMIT 1

What is the structure of the document with the least number of accesses ?


Question: Among the casts who were born in Los Angeles, describe the name and birth date of who have 1.8 m and above in height.

SELECT name, birthdate FROM Person WHERE birth_place = 'Los Angeles' AND height_meters >= 1.8;

Among the casts who were born in Los Angeles , describe the name and birth date of who have 1.8 m and above in height .

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


Question: Calculates the profit processed by Supplier No. 7414 on order No. 817154.

SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_suppkey = 7414 AND T1.l_orderkey = 817154

Calculates the profit processed by Supplier No . 7414 on order No . 817154 .

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


Question: Show the earnings of players from country "Australia" or "Zimbabwe".

SELECT Earnings FROM player WHERE Country  =  "Australia" OR Country  =  "Zimbabwe"

Show the earnings of players from country " Australia " or " Zimbabwe " .

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


Question: What is the last name of the customer who placed an order for sales id 178?

SELECT T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesID = 178

What is the last name of the customer who placed an order for sales i d 178 ?

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


Question: Return the name of the characteristic that is most common 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 ORDER BY count(*) DESC LIMIT 1

Return the name of the characteristic that is most common across all products .


Question: How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?

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

How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck ?

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


Question: Identify the store location and sales team who processed the sales order 'SO - 0001004'.

SELECT T3.`Sales Team`, T1.`City Name` FROM `Store Locations` AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.OrderNumber = 'SO - 0001004'

Identify the store location and sales team who processed the sales order ' SO - 0001004 ' .

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


Question: What are the names of climbers who are not from the country of Switzerland?

SELECT Name FROM climber WHERE Country != "Switzerland"

What are the names of climbers who are not from the country of Switzerland ?

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


Question:
What is the task method of the tokenized name "string extensions to pascal case
"?

SELECT DISTINCT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'string extensions to pascal case'

What is the task method of the tokenized name " string extensions to pascal case " ?

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


Question: What kind of restaurants can be found at "106 E 25th Ave"?

SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 106 AND T2.street_name = 'e 25th ave'

What kind of restaurants can be found at " 106 E 25th Ave " ?

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


Question: Show all the buildings along with the number of faculty members the buildings have.

SELECT building ,  count(*) FROM Faculty GROUP BY building

Show all the buildings along with the number of faculty members the buildings have .

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


Question: How many rooms cost more than 120, for each different decor?

SELECT decor , count(*) FROM Rooms WHERE basePrice  >  120 GROUP BY decor;

How many rooms cost more than 120 , for each different decor ?

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


Question: What are the themes and locations of parties?

SELECT Party_Theme ,  LOCATION FROM party

What are the themes and locations of parties ?

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


Question: What is the ratio of males and females among historical legislators?

SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical

What is the ratio of males and females among historical legislators ?


Question: How many cups of 1% lowfat milk should be added to no.1436 recipe?

SELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = '1% lowfat milk' AND T2.unit = 'cup(s)' AND T2.recipe_id = 1436

How many cups of 1 % lowfat milk should be added to no.1436 recipe ?

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


Question: Where is the coordinate (41.66236555, -87.63470194) located? Give the name of the district.

SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.longitude = '-87.63470194' AND T1.latitude = '41.66236555'

Where is the coordinate ( 41.66236555 , -87.63470194 ) located ? Give the name of the district .

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


Question: How many players, in games played in 1990, achieved 50% or less of oRebounds than dRebounds.

SELECT COUNT(playerID) FROM players_teams WHERE CAST(oRebounds AS REAL) * 100 / dRebounds <= 50 AND year = 1990

How many players , in games played in 1990 , achieved 50 % or less of oRebounds than dRebounds .

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


Question: Which year has the most elite users?

SELECT year_id FROM Elite GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1


Question: What are the first names of all professors not teaching any classes?

SELECT emp_fname FROM employee WHERE emp_jobcode  =  'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN CLASS AS T2 ON T1.emp_num  =  T2.prof_num

What are the first names of all professors not teaching any classes ?


Question: How many Men's 200 Metres Freestyle events did Ian James Thorpe compete in?

SELECT COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN event AS T4 ON T3.event_id = T4.id WHERE T1.full_name = 'Ian James Thorpe' AND T4.event_name LIKE 'Swimming Men%s 200 metres Freestyle'

How many Men 's 200 Metres Freestyle events did Ian James Thorpe compete in ?

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


Question: Show student ids who are on scholarship and have major 600.

SELECT StuID FROM Student WHERE major  =  600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y'

Show student ids who are on scholarship and have major 600 .

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


Question: What is the difference in overall student enrollment and international student enrollment at the Harvard university from 2011 to 2012?

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

What is the difference in overall student enrollment and international student enrollment at the Harvard university from 2011 to 2012 ?

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


Question: Which episode id did award Outstanding Animated Program (For Programming Less Than One Hour) with an episode star score of 10?

SELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.stars = 10;

Which episode i d did award Outstanding Animated Program ( For Programming Less Than One Hour ) with an episode star score of 10 ?

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


Question: Among the active male employees, how many of them are paid with the highest frequency?

SELECT COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.Gender = 'M' AND T1.PayFrequency = 2

Among the active male employees , how many of them are paid with the highest frequency ?

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


Question: What are the name and description for location code x?

SELECT location_name ,  location_description FROM Ref_locations WHERE location_code  =  "x"

What are the name and description for location code x ?

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


Question: List the names of all races that occurred in the earliest recorded year and month.

SELECT name FROM races WHERE STRFTIME('%Y', date) = ( SELECT STRFTIME('%Y', date) FROM races ORDER BY date ASC LIMIT 1 ) AND STRFTIME('%m', date) = ( SELECT STRFTIME('%m', date) FROM races ORDER BY date ASC LIMIT 1 )

List the names of all races that occurred in the earliest recorded year and month .

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


Question: Who was credited as "technical advisor" in the episode titled "Cherished"?

SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor'

Who was credited as " technical advisor " in the episode titled " Cherished " ?

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


Question: Find the id of the song that lasts the longest.

SELECT f_id FROM files ORDER BY duration DESC LIMIT 1

Find the i d of the song that lasts the longest .


Question: How many farms are there?


Question: How many different types of transactions are there?

SELECT count(DISTINCT transaction_type) FROM Financial_Transactions

How many different types of transactions are there ?


Question: List the account IDs with monthly issuance of statements.

SELECT account_id FROM account WHERE Frequency = 'POPLATEK MESICNE'

List the account IDs with monthly issuance of statements .


Question: What are the sources for the data of children who finished primary school education in Latin America & Caribbean countries?

SELECT DISTINCT T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode WHERE T3.Region = 'Latin America & Caribbean' AND T2.IndicatorName = 'Children out of school, primary'

What are the sources for the data of children who finished primary school education in Latin America & Caribbean countries ?

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


Question: Calculate the average monthly order and percentage of warehouse "WARE-NMK1003" in 2019. Among them, mention number of orders for floor lamps.

SELECT CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) / 12 , CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OrderNumber), COUNT(CASE WHEN T1.`Product Name` = 'Floor Lamps' AND T2.WarehouseCode = 'WARE-NMK1003' THEN T2.`Order Quantity` ELSE NULL END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T2.OrderDate LIKE '%/%/19'

Calculate the average monthly order and percentage of warehouse " WARE - NMK1003 " in 2019 . Among them , mention number of orders for floor lamps .

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


Question: What are the numbers of races for each constructor id?

SELECT count(*) ,  constructorid FROM constructorStandings GROUP BY constructorid

What are the numbers of races for each constructor i d ?

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


Question: Find the login name of the course author that teaches the course with name "advanced database".

SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"

Find the login name of the course author that teaches the course with name " advanced database " .

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


Question: Provide the total number of the budget amount for "September Speaker" event.

SELECT SUM(T1.amount) FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id WHERE T2.event_name = 'September Speaker'

Provide the total number of the budget amount for " September Speaker " event .

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


Question: Please list the assumed name of all the facilities that failed an inspection in 2010.

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

Please list the assumed name of all the facilities that failed an inspection in 2010 .

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


Question: How many actively running Yelp businesses are there located in "Phoenix" city?

SELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Phoenix'

How many actively running Yelp businesses are there located in " Phoenix " city ?

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


Question: Return the names and typical buying and selling prices for products that have 'yellow' as their color description.

SELECT t1.product_name ,  t1.typical_buying_price ,  t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code WHERE t2.color_description  =  "yellow"

Return the names and typical buying and selling prices for products that have ' yellow ' as their color description .

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


Question: Who is the author of the paper titled "Open Sourcing Social Solutions (Building Communities of Change)"?

SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Open Sourcing Social Solutions (Building Communities of Change)'

Who is the author of the paper titled " Open Sourcing Social Solutions ( Building Communities of Change ) " ?

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


Question: What is the gender of the user who has posted the tweet that is seen by the most number of unique users?

SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1

What is the gender of the user who has posted the tweet that is seen by the most number of unique users ?

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


Question: How many staff have the first name Ludie?

SELECT count(*) FROM Staff WHERE first_name = "Ludie";

How many staff have the first name Ludie ?

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


Question: Who got the Man of the Series Award in 2010?

SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 GROUP BY T1.Player_Name

Who got the Man of the Series Award in 2010 ?

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


Question: Who is the publisher of Hitchhiker's Guide To The Galaxy: The Filming of the Douglas Adams classic?

SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'Hitchhiker''s Guide To The Galaxy: The Filming of the Douglas Adams classic'

Who is the publisher of Hitchhiker 's Guide To The Galaxy : The Filming of the Douglas Adams classic ?

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


Question: What is the name of the state that the client with the email "skylar.ramirez@gmail.com" lives in?

SELECT T3.state FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T3.email = 'skylar.ramirez@gmail.com'

What is the name of the state that the client with the email " skylar.ramirez@gmail.com " lives in ?

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


Question: How many professors are in the accounting dept?

SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "Accounting"

How many professors are in the accounting dept ?


Question: How was the build up play dribbling class for "LEI" on 2015/9/10?

SELECT t2.buildUpPlayDribblingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_short_name = 'LEI' AND SUBSTR(t2.`date`, 1, 10) = '2015-09-10'

How was the build up play dribbling class for " LEI " on 2015/9/10 ?

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


Question: What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre.

SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid = 1684910 ) FROM actors WHERE actorid IN ( SELECT actorid FROM movies2actors WHERE movieid = 1684910 )

What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors ? Indicate your answer in percentage . List the the director as well as the genre .

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


Question: How many active businesses from Casa Grande are registered in the database?

SELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Casa Grande'

How many active businesses from Casa Grande are registered in the database ?

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


Question: What are the different stage positions for all musicians whose first name is "Solveig"?

SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id WHERE Firstname  =  "Solveig"

What are the different stage positions for all musicians whose first name is " Solveig " ?

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


Question: How many invoices do we have?


Question: What is the revision page ID of title "Aigua dolÃ§a"?

SELECT revision FROM pages WHERE title = 'Aigua dolÃ§a'

What is the revision page ID of title " Aigua dolÃ§a " ?

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


Question: What is the description for the process outcome code working?

SELECT process_outcome_description FROM Process_outcomes WHERE process_outcome_code  =  "working"

What is the description for the process outcome code working ?

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


Question: Lists all patients by ID who were diagnosed with Behcet's and had their exams between 01/01/197 and 12/31/1997.

SELECT ID FROM Examination WHERE `Examination Date` BETWEEN '1997-01-01' AND '1997-12-31' AND Diagnosis = 'Behcet'

Lists all patients by ID who were diagnosed with Behcet 's and had their exams between 01/01/197 and 12/31/1997 .

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


Question: How many underage patients were examined during the course of the three-year period from 1990 to 1993?

SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', T2.`Examination Date`) BETWEEN '1990' AND '1993' AND STRFTIME('%Y', T2.`Examination Date`) - STRFTIME('%Y', T1.Birthday) < 18

How many underage patients were examined during the course of the three - year period from 1990 to 1993 ?

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


Question: For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded?

SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH < 500 ORDER BY T2.LDH ASC LIMIT 1

For the patient with the highest lactate dehydrogenase in the normal range , when was his or her data first recorded ?

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


Question: Find the locations that have paintings before 1885 and no work with medium on canvas?

SELECT DISTINCT LOCATION FROM paintings WHERE YEAR  <  1885 AND mediumOn != "canvas"

Find the locations that have paintings before 1885 and no work with medium on canvas ?

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


Question: What is the average pages per minute color?

SELECT avg(pages_per_minute_color) FROM product

What is the average pages per minute color ?

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


Question: Return the completion date for all the tests that have "Fail" result.

SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id  =  T2.registration_id WHERE T2.test_result  =  "Fail"

Return the completion date for all the tests that have " Fail " result .

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


Question: Find the name of the directors whose age is between 30 and 60.

SELECT name FROM director WHERE age BETWEEN 30 AND 60

Find the name of the directors whose age is between 30 and 60 .

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


Question: List the first team's name in the match with the highest winning margin.

SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.Win_Margin DESC LIMIT 1

List the first team 's name in the match with the highest winning margin .

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


Question: List all the complaints narratives made by the customer named Brenda and last name Mayer.

SELECT T2.`Consumer complaint narrative` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Brenda' AND T1.last = 'Mayer'

List all the complaints narratives made by the customer named Brenda and last name Mayer .

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


Question: How many stores are there in each neighborhood?

SELECT count(*) ,  neighborhood FROM store GROUP BY neighborhood

How many stores are there in each neighborhood ?


Question: Which college do most of the members go to?

SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id GROUP BY T2.major_id ORDER BY COUNT(T2.college) DESC LIMIT 1

Which college do most of the members go to ?


Question: Who are the actors that act in the ACADEMY DINOSAUR film?

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

Who are the actors that act in the ACADEMY DINOSAUR film ?

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


Question: Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?

SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  <  100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id  =  T2.exhibition_id WHERE T1.attendance  >  500

Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500 ?

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


Question: Calculate the total number of sales closed by Michel E. DeFrance?

SELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID WHERE T2.FirstName = 'Michel' AND T2.MiddleInitial = 'e' AND T2.LastName = 'DeFrance'

Calculate the total number of sales closed by Michel E. DeFrance ?

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


Question: List down the actors' full names who performed in "CHOCOLATE DUCK" film.

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

List down the actors ' full names who performed in " CHOCOLATE DUCK " film .

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


Question: What is the first and last name of the employee who reports to Nancy Edwards?

SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";

What is the first and last name of the employee who reports to Nancy Edwards ?

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


Question: Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status.

SELECT SUM(T2.OrderQty) FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID WHERE T1.Status = 1

Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status .

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


Question: Which buildings have more than one company offices? Give me the building names.

SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id GROUP BY T1.building_id HAVING COUNT(*)  >  1

Which buildings have more than one company offices ? Give me the building names .

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


Question: What are the maximum and minimum health scores among countries that are not "Norway".

SELECT max(health_score) ,  min(health_score) FROM countries WHERE name != "Norway"

What are the maximum and minimum health scores among countries that are not " Norway " .

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


Question: Name the top five titles that sold more than average and list them in descending order of the number of sales in California stores?

SELECT T1.title FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id INNER JOIN publishers AS T3 ON T1.pub_id = T3.pub_id WHERE T2.qty > ( SELECT CAST(SUM(qty) AS REAL) / COUNT(title_id) FROM sales ) AND T3.state = 'CA' ORDER BY T2.qty DESC LIMIT 5

Name the top five titles that sold more than average and list them in descending order of the number of sales in California stores ?

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


Question: Among the cities with area code 608, how many cities implement daylight savings?

SELECT COUNT(T2.city) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 608 AND T2.daylight_savings = 'Yes'

Among the cities with area code 608 , how many cities implement daylight savings ?

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


Question: What are the ids of the two department store chains with the largest number of department stores?

SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2

What are the ids of the two department store chains with the largest number of department stores ?

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


Question: What is the percentage of romance films among films produced in India in 2015?

SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Romance' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'India' AND T1.release_date BETWEEN '2015-01-01' AND '2015-12-31'

What is the percentage of romance films among films produced in India in 2015 ?

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


Question: How old was the patient who had the highest hemoglobin count at the time of the examination, and what is the doctor's diagnosis?

SELECT STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday), T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.HGB DESC LIMIT 1

How old was the patient who had the highest hemoglobin count at the time of the examination , and what is the doctor 's diagnosis ?

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


Question: How many countries do not have an roller coaster longer than 3000?

SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )

How many countries do not have an roller coaster longer than 3000 ?

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


Question: List the description of the airports that have code that ends with number 3?

SELECT Description FROM Airports WHERE Code LIKE '%3'

List the description of the airports that have code that ends with number 3 ?

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


Question: Find the payment method that is used the most often in all the invoices. Give me its code.

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

Find the payment method that is used the most often in all the invoices . Give me its code .

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


Question: How many customers are named Charles in Sacramento?

SELECT COUNT(CustomerID) FROM customers WHERE First = 'Charles' AND City = 'Sacramento'

How many customers are named Charles in Sacramento ?


Question: Please indicate which labels have the city located in Santa Cruz.

SELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'Santa Cruz county'

Please indicate which labels have the city located in Santa Cruz .

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


Question: Count the number of institutions.


Question: Provide the weight and race of the superhero with superhero ID 40.

SELECT T1.weight_kg, T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.id = 40

Provide the weight and race of the superhero with superhero ID 40 .

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


Question: Who is the recipient of the Primetime Emmy Award with the most votes?

SELECT T1.person FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy' ORDER BY T2.votes DESC LIMIT 1;

Who is the recipient of the Primetime Emmy Award with the most votes ?

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


Question: Between Sac State Union and Sac State American River Courtyard, which location sold the most Dog n Suds root beer?

SELECT T3.LocationName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Dog n Suds' AND T3.LocationName IN ('Sac State American River Courtyard', 'Sac State Union') GROUP BY T1.LocationID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1

Between Sac State Union and Sac State American River Courtyard , which location sold the most Dog n Suds root beer ?

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


Question: What are the names of the official languages, sorted descending by the average overall scores across the countries that correspond to each?

SELECT T3.name FROM countries AS T1 JOIN official_languages AS T2 ON T1.id  =  T2.country_id JOIN languages AS T3 ON T2.language_id  =  T3.id GROUP BY T3.id ORDER BY avg(T1.overall_score) DESC

What are the names of the official languages , sorted descending by the average overall scores across the countries that correspond to each ?

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


Question: Which member names corresponding to members who are not in the Progress Party?

SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"

Which member names corresponding to members who are not in the Progress Party ?

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


Question: Among the classic movies, how many movies have a rental rate of less than 1?

SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate < 1 AND T2.name = 'Classics'

Among the classic movies , how many movies have a rental rate of less than 1 ?

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


Question: How many professors teaches no more than two high-level or harder undergraduate courses?

SELECT COUNT(*) FROM ( SELECT COUNT(T2.p_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400' GROUP BY T2.p_id HAVING COUNT(DISTINCT T1.course_id) <= 2 )

How many professors teaches no more than two high - level or harder undergraduate courses ?

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


Question: Calculate the percentage of voice actors whose main character in the movie is in the Drama genre.

SELECT CAST(COUNT(CASE WHEN T1.genre = 'Drama' THEN T3.`voice-actor` ELSE NULL END) AS REAL) * 100 / COUNT(T3.`voice-actor`) FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN `voice-actors` AS T3 ON T3.movie = T1.movie_title

Calculate the percentage of voice actors whose main character in the movie is in the Drama genre .

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


Question: How many cities are there in Orange County, Virginia?

SELECT COUNT(city) FROM zip_code WHERE county = 'Orange County' AND state = 'Virginia'

How many cities are there in Orange County , Virginia ?

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


Question: How many times between 1975 and 1980 did the player abdulka01 play for LAL?

SELECT COUNT(DISTINCT T2.year) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'LAL' AND T2.year BETWEEN 1975 AND 1980 AND T1.playerID = 'abdulka01'

How many times between 1975 and 1980 did the player abdulka01 play for LAL ?

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


Question: Show the players and years played for players from team "Columbus Crew".

SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Columbus Crew"

Show the players and years played for players from team " Columbus Crew " .

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


Question: State the name of major that Phillip Cullen has joined.

SELECT T1.major_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.first_name = 'Phillip' AND T2.last_name = 'Cullen'

State the name of major that Phillip Cullen has joined .

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


Question: What was the gas consumption peak month for SME customers in 2013?

SELECT SUBSTR(T2.Date, 5, 2) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE SUBSTR(T2.Date, 1, 4) = '2013' AND T1.Segment = 'SME' GROUP BY SUBSTR(T2.Date, 5, 2) ORDER BY SUM(T2.Consumption) DESC LIMIT 1

What was the gas consumption peak month for SME customers in 2013 ?

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


Question: Who owns the email address "regina7@adventure-works.com"?

SELECT T2.FirstName, T2.LastName FROM EmailAddress AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.EmailAddress = 'regina7@adventure-works.com'

Who owns the email address " regina7@adventure-works.com " ?


Question: Give the contact name of the supplier for the product "Gudbrandsdalsost".

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

Give the contact name of the supplier for the product " Gudbrandsdalsost " .

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


Question: In year 2010 at schools located in Hawaii, what is the percentage of schools offers an associate's degree?

SELECT CAST(SUM(CASE WHEN T2.level = '2-year' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.level) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state = 'Hawaii' AND T2.year = 2010

In year 2010 at schools located in Hawaii , what is the percentage of schools offers an associate 's degree ?

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


Question: Which country has the smallest surface area?

SELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1

Which country has the smallest surface area ?


Question: What is the type description of the organization whose detail is listed as 'quo'?

SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type  =  T2.organisation_type WHERE T2.organisation_details  =  'quo'

What is the type description of the organization whose detail is listed as ' quo ' ?

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


Question: What are the names and addresses for all affiliations?

SELECT DISTINCT name ,  address FROM Affiliation

What are the names and addresses for all affiliations ?


Question: How many trips with a bike borrowed from the stations in San Francisco were made by a subscriber?

SELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN station AS T2 ON T2.ID = T1.start_station_id WHERE T2.city = 'San Francisco' AND T1.subscription_type = 'Subscriber'

How many trips with a bike borrowed from the stations in San Francisco were made by a subscriber ?

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


Question: What year did the Simpsons receive its first ever award for Favorite Animated Comedy in People's Choice Award?

SELECT year FROM Award WHERE result = 'Winner' AND award = 'Favorite Animated Comedy' ORDER BY year DESC LIMIT 1;

What year did the Simpsons receive its first ever award for Favorite Animated Comedy in People 's Choice Award ?

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


Question: How many players are there?


Question: List the authors who do not have submission to any workshop.

SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)

List the authors who do not have submission to any workshop .


Question: What are the names of organizations that contain the word "Party"?

SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"

What are the names of organizations that contain the word " Party " ?

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


Question: Who has the heaviest weight?

SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id ORDER BY T2.weight_in_kg DESC LIMIT 1


Question: What are the titles and ids for albums containing tracks with unit price greater than 1?

SELECT T1.Title ,  T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId WHERE T2.UnitPrice  >  1 GROUP BY T2.AlbumID

What are the titles and ids for albums containing tracks with unit price greater than 1 ?

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


Question: List at least 3 cities under the country of Philippines.

SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'

List at least 3 cities under the country of Philippines .

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


Question: How many items are shipped?


Question: What is the famous release date of the artist with the oldest age?

SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1

What is the famous release date of the artist with the oldest age ?

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


Question: Find the total number of boats.


Question: List all the mountains that are volcanic along with its longitude and latitude.

SELECT Name, Latitude, Longitude FROM mountain WHERE Type = 'volcano'

List all the mountains that are volcanic along with its longitude and latitude .

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


Question: The part "hot spring dodger dim light" is ordered in how many orders?

SELECT COUNT(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light'

The part " hot spring dodger dim light " is ordered in how many orders ?

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


Question: List id of documents that in document subset Best for 2000 and collection named Best.

SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID JOIN Documents_in_Collections AS T3 ON T1.Document_Object_ID  =  T3.Document_Object_ID JOIN Collections AS T4 ON T3.Collection_ID  =  T4.Collection_ID WHERE T2.Document_Subset_Name = "Best for 2000" AND T4.Collection_Name = "Best";

List i d of documents that in document subset Best for 2000 and collection named Best .

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


Question: Which director has made the most movies?

SELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1

Which director has made the most movies ?


Question: State the name of the category which has the most number of films.

SELECT T.name FROM ( SELECT T2.name, COUNT(T1.film_id) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1

State the name of the category which has the most number of films .

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


Question: What is the average index of the lactate dehydrogenase (LDH) for all patients with lactate dehydrogenase (LDH) within the normal range.

SELECT AVG(LDH) FROM Laboratory WHERE LDH < 500

What is the average index of the lactate dehydrogenase ( LDH ) for all patients with lactate dehydrogenase ( LDH ) within the normal range .

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


Question: What is total number of show times per dat for each cinema?

SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id

What is total number of show times per dat for each cinema ?

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


Question: List the active business ID and its stars of the businesses fall under the category of Food.

SELECT DISTINCT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Food' AND T1.active = 'true'

List the active business ID and its stars of the businesses fall under the category of Food .

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


Question: What are the enrollment and primary conference for the university which was founded the earliest?

SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1

What are the enrollment and primary conference for the university which was founded the earliest ?

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


Question: Show the id, the date of account opened, the account name, and other account detail for all accounts.

SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts

Show the i d , the date of account opened , the account name , and other account detail for all accounts .

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


Question: What is the title of corpus with most words?

SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )

What is the title of corpus with most words ?


Question: How many registed students do each course have? List course name and the number of their registered students?

SELECT T3.course_name ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id

How many registed students do each course have ? List course name and the number of their registered students ?

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


Question: What are the valid e-mail addresses of the administrator of the school located in the San Bernardino county, City of San Bernardino City Unified that opened between 1/1/2009 to 12/31/2010 whose school types are public Intermediate/Middle Schools and Unified Schools?

SELECT T2.AdmEmail1, T2.AdmEmail2 FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'San Bernardino' AND T2.City = 'San Bernardino' AND T2.DOC = 54 AND strftime('%Y', T2.OpenDate) BETWEEN '2009' AND '2010' AND T2.SOC = 62

What are the valid e - mail addresses of the administrator of the school located in the San Bernardino county , City of San Bernardino City Unified that opened between 1/1/2009 to 12/31/2010 whose school types are public Intermediate / Middle Schools and Unified Schools ?

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


Question: Find the number of items without any review.

SELECT count(*) FROM item WHERE i_id NOT IN (SELECT i_id FROM review)

Find the number of items without any review .


Question: For the first client who opened his/her account in Prague, what is his/her account ID?

SELECT T1.account_id FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.A3 = 'Prague' ORDER BY T1.date ASC LIMIT 1

For the first client who opened his / her account in Prague , what is his / her account ID ?

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


Question: In which city did the heaviest shipment transported?

SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T1.weight DESC LIMIT 1

In which city did the heaviest shipment transported ?


Question: What are the department ids for which more than 10 employees had a commission?

SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10

What are the department ids for which more than 10 employees had a commission ?

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


Question: Among the review votes of funny and cool hit uber with long review length, describe the business ID, active status, user ID and user year of joining Yelp.

SELECT T1.business_id, T1.active, T3.user_id, T3.user_yelping_since_year FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T2.review_votes_cool = 'Uber' AND T2.review_votes_funny = 'Uber' AND T2.review_length = 'Long'

Among the review votes of funny and cool hit uber with long review length , describe the business ID , active status , user ID and user year of joining Yelp .

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


Question: Which actor played the role of Joker in the movie Batman?

SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman' AND T2.`Character Name` = 'Joker'

Which actor played the role of Joker in the movie Batman ?

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


Question: Show all male student ids who don't play football.

SELECT StuID FROM Student WHERE sex  =  'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"

Show all male student ids who do n't play football .


Question: Which state has the most bad aliases?

SELECT T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.state ORDER BY COUNT(T1.bad_alias) DESC LIMIT 1


Question: For each director, how many reviews have they received?

SELECT count(*) ,  T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID  =  T2.mID GROUP BY T1.director

For each director , how many reviews have they received ?


Question: What kind of "wi-fi" does Yelp business No."10172" have?

SELECT T2.attribute_value FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.business_id = 10172 AND T1.attribute_name LIKE 'wi-fi'

What kind of " wi - fi " does Yelp business No . "10172 " have ?

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


Question: What's of rating on the movie "Innocence Unprotected" by the user who created the movie list "250 Favourite Films"?

SELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T2.movie_title = 'Innocence Unprotected' AND T3.list_title = '250 Favourite Films'

What 's of rating on the movie " Innocence Unprotected " by the user who created the movie list " 250 Favourite Films " ?

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


Question: Which organization has the least number of male students?

SELECT T.organ FROM ( SELECT T2.organ, COUNT(T1.name) AS num FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name GROUP BY T2.organ ) T ORDER BY T.num LIMIT 1

Which organization has the least number of male students ?


Question: Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580.

SELECT CAST(SUM(IIF(T2.cast_num = 2 AND T1.a_quality = 2, 1, 0)) AS REAL) * 100 / COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1672580 AND T1.a_gender = 'F'

Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580 .

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


Question: List out student names that enrolled in two schools and two organizations?

SELECT T.name FROM ( SELECT T1.name, COUNT(T1.organ) AS num FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num = 2

List out student names that enrolled in two schools and two organizations ?

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


Question: Show the name and age for all male people who don't have a wedding.

SELECT name ,  age FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)

Show the name and age for all male people who do n't have a wedding .

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


Question: What is the address of the client who made a complaint via postal mail on March 14, 2012?

SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-03-14' AND T2.`Submitted via` = 'Postal mail'

What is the address of the client who made a complaint via postal mail on March 14 , 2012 ?

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


Question: Show the name of colleges that have at least two players in descending alphabetical order.

SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC

Show the name of colleges that have at least two players in descending alphabetical order .


Question: List all the locations of postal points with the area code "410".

SELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 410

List all the locations of postal points with the area code " 410 " .

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


Question: Find the number of funiture types produced by each manufacturer as well as the company names.

SELECT count(*) ,  t1.name FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id  =  t2.manufacturer_id GROUP BY t1.manufacturer_id

Find the number of funiture types produced by each manufacturer as well as the company names .

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


Question: Show the location with most number of train stations.

SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1

Show the location with most number of train stations .


Question: Which good has "70" in its id? And what is its price?

SELECT id ,  price FROM goods WHERE id LIKE "%70%"

Which good has " 70 " in its i d ? And what is its price ?

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


Question: Name the river at Little Rock city. State the length of the river.

SELECT T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Little Rock'

Name the river at Little Rock city . State the length of the river .

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


Question: What is the average time in seconds of champion for each year, before year 1975?

WITH time_in_seconds AS ( SELECT T2.year, T2.raceId, T1.positionOrder, CASE WHEN T1.positionOrder = 1 THEN (CAST(SUBSTR(T1.time, 1, 1) AS REAL) * 3600) + (CAST(SUBSTR(T1.time, 3, 2) AS REAL) * 60) + CAST(SUBSTR(T1.time, 6,2) AS REAL )   + CAST(SUBSTR(T1.time, 9) AS REAL)/1000 ELSE 0 END AS time_seconds FROM results AS T1 INNER JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T1.time IS NOT NULL ), champion_time AS ( SELECT year, raceId, time_seconds FROM time_in_seconds WHERE positionOrder = 1 ) SELECT year, AVG(time_seconds) FROM champion_time WHERE year < 1975 GROUP BY year HAVING AVG(time_seconds) IS NOT NULL

What is the average time in seconds of champion for each year , before year 1975 ?

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


Question: What are the first names and support rep ids for employees serving 10 or more customers?

SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10

What are the first names and support rep ids for employees serving 10 or more customers ?

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


Question: What country have its data estimated based on regression?

SELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Estimates are based on regression.'

What country have its data estimated based on regression ?

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


Question: What is the name, city, and country of the airport with the lowest altitude?

SELECT name ,  city ,  country FROM airports ORDER BY elevation LIMIT 1

What is the name , city , and country of the airport with the lowest altitude ?

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


Question: List the point IDs and fines of the inspections done on 7th August 2010.

SELECT T2.point_id, T2.fine FROM inspection AS T1 INNER JOIN violation AS T2 ON T1.inspection_id = T2.inspection_id WHERE T1.inspection_date = '2010-08-07'

List the point IDs and fines of the inspections done on 7th August 2010 .

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


Question: Name number of samples of "bed" object are there in the image No.1098?

SELECT SUM(CASE WHEN T2.OBJ_CLASS = 'bed' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1098

Name number of samples of " bed " object are there in the image No.1098 ?

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


Question: Find the number of clubs where "Tracy Kim" is a member.

SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t3.fname  =  "Tracy" AND t3.lname  =  "Kim"

Find the number of clubs where " Tracy Kim " is a member .

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


Question: List down all of the customers' first name who were attended by staff with ID 1.

SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1

List down all of the customers ' first name who were attended by staff with ID 1 .

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


Question: How many 1 star ratings are there in the worst rated episode of the season?

SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 1 ORDER BY T1.rating LIMIT 1;

How many 1 star ratings are there in the worst rated episode of the season ?

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


Question: Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments.

SELECT first_name ,  last_name ,  department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id)

Find the first name and last name and department i d for those employees who earn such amount of salary which is the smallest salary of any of the departments .

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


Question: What is the difference between the hottest temperature and the coldest temperature in in Fahrenheit on 8/29/2013 for the area where the zip code is 94107?

SELECT SUM(IIF(zip_code = 94107 AND date = '8/29/2013', max_temperature_f - min_temperature_f, 0)) FROM weather

What is the difference between the hottest temperature and the coldest temperature in in Fahrenheit on 8/29/2013 for the area where the zip code is 94107 ?

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