Question: Please list the names of all the counties with at least one residential area that implements daylight saving.

SELECT DISTINCT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.daylight_savings = 'Yes'

Please list the names of all the counties with at least one residential area that implements daylight saving .

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


Question: Count the number of collaborators that Mckeown , Kathleen has had .

select count (distinct t2.author_id) from author_list as t1 join author_list as t2 on t1.paper_id  =  t2.paper_id and t1.author_id != t2.author_id join author as t3 on t1.author_id  =  t3.author_id where t3.name = "mckeown ,  kathleen"

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


Question: How many shipments were shipped to the most densely populated city?

SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1

How many shipments were shipped to the most densely populated city ?

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


Question: Please list the names of the top 3 suppliers with the most amount of money in their accounts.

SELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3

Please list the names of the top 3 suppliers with the most amount of money in their accounts .

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


Question: What are the GPAs of the unpaid Research Assistants?

SELECT T2.gpa FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'

What are the GPAs of the unpaid Research Assistants ?


Question: Show the name, location, open year for all tracks with a seating higher than the average.

SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)

Show the name , location , open year for all tracks with a seating higher than the average .

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


Question: How many employees live in Canada?

SELECT count(*) FROM employees WHERE country = "Canada";


Question: Who was the champion of 2008's Australian Grand Prix and where can I know more about him?

SELECT T1.forename, T1.surname, T1.url FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian Grand Prix' AND T2.time LIKE '_:%:__.___' AND T3.year = 2008

Who was the champion of 2008 's Australian Grand Prix and where can I know more about him ?

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


Question: What are the ids of all female students who play football?

SELECT StuID FROM Student WHERE sex  =  'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"

What are the ids of all female students who play football ?

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


Question: What is the average number of terms for a current female legislator?

SELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F'

What is the average number of terms for a current female legislator ?


Question: List all the paper that were under the conference homepage URL "http://www.irma-international.org/".

SELECT T1.Title FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.HomePage = 'http://www.irma-international.org/'

List all the paper that were under the conference homepage URL " http://www.irma-international.org/ " .

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


Question: What is the nationality of "Customer#000000055"?

SELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_name = 'Customer#000000055'

What is the nationality of " Customer#000000055 " ?


Question: Please list the full names of all the sanitarians under the supervision of Darlisha Jacobs.

SELECT first_name, last_name FROM employee WHERE title = 'Sanitarian' AND supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Darlisha' AND last_name = 'Jacobs' )

Please list the full names of all the sanitarians under the supervision of Darlisha Jacobs .

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


Question: What are the user ids of property owners who have property photos, and how many do each of them have?

SELECT T1.owner_user_id ,  count(*) FROM Properties AS T1 JOIN Property_Photos AS T2 ON T1.property_id  =  T2.property_id GROUP BY T1.owner_user_id;

What are the user ids of property owners who have property photos , and how many do each of them have ?

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


Question: For each city, return the highest latitude among its stations.

SELECT city ,  max(lat) FROM station GROUP BY city

For each city , return the highest latitude among its stations .


Question: Who has played the most game plays in the 2000-2001 season of the International league?

SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.GP DESC LIMIT 1

Who has played the most game plays in the 2000 - 2001 season of the International league ?

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


Question: What is the type of the document whose description starts with the word 'Initial'?

SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'

What is the type of the document whose description starts with the word ' Initial ' ?

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


Question: List the types of competition that have at most five competitions of that type.

SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*)  <=  5

List the types of competition that have at most five competitions of that type .


Question: State all the Facebook ID for current legislators under the democrat party.

SELECT T2.facebook_id FROM `current-terms` AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide = T2.bioguide WHERE T1.party = 'Democrat' GROUP BY T2.facebook_id

State all the Facebook ID for current legislators under the democrat party .

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


Question: Give the address, phone, and email for customers with the name Jeromy.

SELECT customer_address ,  customer_phone ,  customer_email FROM Customers WHERE customer_name  =  "Jeromy"

Give the address , phone , and email for customers with the name Jeromy .

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


Question: What is the rental price per day for Airplane Sierra?

SELECT rental_rate / rental_duration AS result FROM film WHERE title = 'AIRPLANE SIERRA'

What is the rental price per day for Airplane Sierra ?

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


Question: In Sub-Saharan Africa, how many female out-of-school children of primary school age are there in the country with the higest number of female out-of-school children of primary school age? Indicate the year of when it was recorded.

SELECT MAX(T1.value), T1.year FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Sub-Saharan Africa' AND T1.IndicatorName = 'Out-of-school children of primary school age, female (number)'

In Sub - Saharan Africa , how many female out - of - school children of primary school age are there in the country with the higest number of female out - of - school children of primary school age ? Indicate the year of when it was recorded .

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


Question: What proportion of the total gross of all movies is from movies with songs?

SELECT CAST(COUNT(CASE WHEN T1.song IS NOT NULL THEN T2.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T2.movie_title) FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie_title = T2.movie_title

What proportion of the total gross of all movies is from movies with songs ?

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


Question: How many community areas are there in Central Chicago?

SELECT COUNT(*) FROM Community_Area WHERE side = 'Central'

How many community areas are there in Central Chicago ?


Question: How many active businesses of city are underrated?

SELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'Low' AND active LIKE 'TRUE'

How many active businesses of city are underrated ?


Question: Which country has the highest population in largest city for 19 consecutive years starting from 1960? Indicate the region to which the country is located.

SELECT T2.CountryCode, T2.Region FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Population in largest city' AND T1.Year >= 1960 AND T1.Year < 1980 ORDER BY T2.Region DESC LIMIT 1

Which country has the highest population in largest city for 19 consecutive years starting from 1960 ? Indicate the region to which the country is located .

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


Question: Show different type codes of products and the number of products with each type code.

SELECT Product_Type_Code ,  COUNT(*) FROM Products GROUP BY Product_Type_Code

Show different type codes of products and the number of products with each type code .

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


Question: Among the students with less than four intelligence, list the full name and phone number of students with a greater than 3 GPA.

SELECT f_name, l_name, phone_number FROM student WHERE gpa > 3 AND intelligence < 4

Among the students with less than four intelligence , list the full name and phone number of students with a greater than 3 GPA .

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


Question: How many awards has Julia Roberts been nominated for?

SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Julia Roberts' AND T2.result = 'Nominee'

How many awards has Julia Roberts been nominated for ?

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


Question: How many of the students joined two organization?

SELECT COUNT(name) FROM enlist WHERE organ >= 2

How many of the students joined two organization ?


Question: What is the name of the department with the most students minoring in it?

SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO  =  T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1

What is the name of the department with the most students minoring in it ?

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


Question: What are the maximum height and id of paintings painted before 1900?

SELECT max(height_mm) ,  paintingID FROM paintings WHERE YEAR  <  1900

What are the maximum height and i d of paintings painted before 1900 ?

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


Question: Among the people who got into the Hall of Fame after the year 1980, how many of them belong to the category of "Player"?

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

Among the people who got into the Hall of Fame after the year 1980 , how many of them belong to the category of " Player " ?

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


Question: What is the percentage of winning rate of improvement since Alain Vigneault became the coach of Vancouver Canucks in 2006 season?

SELECT SUM(CASE WHEN T1.year = 2006 THEN CAST(T1.W AS REAL) * 100 / (T1.W + T1.L) ELSE 0 END) - ( SELECT CAST(W AS REAL) * 100 / (W + L) FROM Teams WHERE year = '2005' AND name = 'Vancouver Canucks' ) FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.name = 'Vancouver Canucks' AND T3.firstName = 'Alain' AND T3.lastName = 'Vigneault'

What is the percentage of winning rate of improvement since Alain Vigneault became the coach of Vancouver Canucks in 2006 season ?

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


Question: How many drivers are there?


Question: What are the distinct last names of the students who have president votes and have 8741 as the advisor?

SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID  =  PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor  =  "8741"

What are the distinct last names of the students who have president votes and have 8741 as the advisor ?

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


Question: Show ids of students who play video game and play sports.

SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games

Show ids of students who play video game and play sports .

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


Question: What are the package numbers and weights that are between 10 and 30?

SELECT PackageNumber ,  Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;

What are the package numbers and weights that are between 10 and 30 ?

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


Question: Which segment had the least consumption?

SELECT T1.Segment FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Segment ORDER BY SUM(T2.Consumption) ASC LIMIT 1

Which segment had the least consumption ?


Question: What are the names of the members that have never registered at any branch?

SELECT name FROM member WHERE member_id NOT IN (SELECT member_id FROM membership_register_branch)

What are the names of the members that have never registered at any branch ?

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


Question: How many attributes are related to the object sample no. 7 on image no. 4?

SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 4 AND OBJ_SAMPLE_ID = 7

How many attributes are related to the object sample no . 7 on image no . 4 ?

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


Question: Count the number of distinct company industries.

SELECT count(DISTINCT Industry) FROM Companies

Count the number of distinct company industries .


Question: What are the Coordinates of planet Mars?

SELECT Coordinates FROM Planet WHERE Name  =  "Mars";

What are the Coordinates of planet Mars ?


Question: Please show the most common reigns of wrestlers.

SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1

Please show the most common reigns of wrestlers .


Question: How many matches of the Bundesliga division ended with an away victory in the 2021 season?

SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021

How many matches of the Bundesliga division ended with an away victory in the 2021 season ?

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


Question: Among all the current legislators who have served for more than 4 terms, what is the percentage of them being female?

SELECT CAST(SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.bioguide) FROM ( SELECT T2.bioguide, T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 ) T3

Among all the current legislators who have served for more than 4 terms , what is the percentage of them being female ?

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


Question: Which phone brand and model was used for event ID "6701"?

SELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701

Which phone brand and model was used for event ID " 6701 " ?

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


Question: What are the start time and end time of addresses for the students who receive 2 transcripts?

SELECT date_from ,  date_to FROM Students_Addresses WHERE student_id IN ( SELECT student_id FROM Transcripts GROUP BY student_id HAVING count(*)  =  2 )

What are the start time and end time of addresses for the students who receive 2 transcripts ?

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


Question: Return the full name and phone of the customer who has card number 4560596484842.

SELECT T2.customer_first_name ,  T2.customer_last_name ,  T2.customer_phone FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.card_number  =  "4560596484842"

Return the full name and phone of the customer who has card number 4560596484842 .

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


Question: List down the company names which supplied products for the order on 14th August, 1996.

SELECT T1.CompanyName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN `Order Details` AS T3 ON T2.ProductID = T3.ProductID INNER JOIN Orders AS T4 ON T3.OrderID = T4.OrderID WHERE date(T4.OrderDate) = '1996-08-14'

List down the company names which supplied products for the order on 14th August , 1996 .

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


Question: Calculate the percentage of the domestic violence cases handled by Christopher Taliaferro. Among them, list report numbers of cases that happened in the bank.

SELECT CAST(COUNT(CASE WHEN T1.domestic = 'TRUE' THEN T1.report_no END) AS REAL) * 100 / COUNT(T1.report_no), COUNT(CASE WHEN T1.domestic = 'TRUE' AND T1.location_description = 'BANK' THEN T1.report_no END) AS "number" FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T2.alderman_first_name = 'Christopher' AND T2.alderman_last_name = 'Taliaferro'

Calculate the percentage of the domestic violence cases handled by Christopher Taliaferro . Among them , list report numbers of cases that happened in the bank .

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


Question: Please provide sales ID for products named Hex Nut with a price greater than 100.

SELECT T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Hex Nut%' AND T1.Price > 100

Please provide sales ID for products named Hex Nut with a price greater than 100 .

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


Question: What is the genre of the game ID 119?

SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.id = 119

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


Question: What are the agency details for clients with the detail Mac?

SELECT T2.agency_details FROM Clients AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id WHERE T1.client_details  =  'Mac'

What are the agency details for clients with the detail Mac ?

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


Question: What is the average body weight of Asian patients?

SELECT SUM(T2.VALUE) / COUNT(T1.patient) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'asian' AND T2.DESCRIPTION = 'Body Weight' AND T2.UNITS = 'kg'

What is the average body weight of Asian patients ?

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


Question: What is the full address of Rattlesnake Canyon Grocery?

SELECT DISTINCT ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry FROM Orders WHERE ShipName = 'Rattlesnake Canyon Grocery'

What is the full address of Rattlesnake Canyon Grocery ?

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


Question: Please list the names of all the store contact employees whose credit cards expired in 2007.

SELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T3.ExpYear = 2007 AND T1.PersonType = 'SC'

Please list the names of all the store contact employees whose credit cards expired in 2007 .

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


Question: What is the email address of the customer who made a purchase in transaction 100016?

SELECT T1.Email FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.TransactionID = '100016'

What is the email address of the customer who made a purchase in transaction 100016 ?

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


Question: What are all the movies rated as R? List the titles.

SELECT title FROM film WHERE rating  =  'R'

What are all the movies rated as R ? List the titles .


Question: What are the name and publication date of the catalogs with catalog level number above 5?

SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5

What are the name and publication date of the catalogs with catalog level number above 5 ?

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


Question: For each location, how many gas stations are there in order?

SELECT LOCATION ,  count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)

For each location , how many gas stations are there in order ?

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


Question: Which of the film directed by director Abbas Kiarostami has the highest average score?

SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Abbas Kiarostami' GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1

Which of the film directed by director Abbas Kiarostami has the highest average score ?

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


Question: Among the German customers, how many of the them has credit limit of zero?

SELECT COUNT(customerNumber) FROM customers WHERE creditLimit = 0 AND country = 'Germany'

Among the German customers , how many of the them has credit limit of zero ?

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


Question: How many of the patients born in 1920s had pneumonia?

SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE DESCRIPTION = 'Pneumonia' AND strftime('%Y', T1.birthdate) LIKE '192%'

How many of the patients born in 1920s had pneumonia ?

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


Question: Please list the product description of the products consumed in September, 2013.

SELECT T3.Description FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Date = '201309'

Please list the product description of the products consumed in September , 2013 .

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


Question: What are the names and types of the companies that have ever operated a flight?

SELECT T1.name ,  T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id

What are the names and types of the companies that have ever operated a flight ?

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


Question: Count the active businesses that has an attribute of caters with low review count.

SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE'

Count the active businesses that has an attribute of caters with low review count .

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


Question: Find the names and years of all sculptures that are not located in gallery 226.

SELECT title ,  YEAR FROM sculptures WHERE LOCATION != "Gallery 226"

Find the names and years of all sculptures that are not located in gallery 226 .

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


Question: Show the id and builder of the railway that are associated with the most trains.

SELECT T2.Railway_ID ,  T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1

Show the i d and builder of the railway that are associated with the most trains .

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


Question: Which film has the most copies in the inventory? List both title and id.

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

Which film has the most copies in the inventory ? List both title and i d.

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


Question: Identify the total weight of shipments transported in 2016 by the newest Peterbilt.

SELECT SUM(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Peterbilt' AND STRFTIME('%Y', T2.ship_date) = '2016' ORDER BY T1.model_year DESC LIMIT 1

Identify the total weight of shipments transported in 2016 by the newest Peterbilt .

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


Question: What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?

SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20

What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points ?

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


Question: What is the ratio between male and female 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 between male and female legislators ?


Question: For the patient who was diagnosed SLE on 1997/1/27, what was his/her original diagnose when he/she came to the hospital for the first time?

SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID WHERE T1.ID = ( SELECT ID FROM Examination WHERE `Examination Date` = '1997-01-27' AND Diagnosis = 'SLE' ) AND T2.`Examination Date` = T1.`First Date`

For the patient who was diagnosed SLE on 1997/1/27 , what was his / her original diagnose when he / she came to the hospital for the first time ?

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


Question: What is the average fastest lap speed for races held after 2004, for each race, ordered by year?

SELECT avg(T2.fastestlapspeed) ,  T1.name ,  T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year

What is the average fastest lap speed for races held after 2004 , for each race , ordered by year ?

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


Question: What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000?

SELECT product_id FROM Order_Items GROUP BY product_id HAVING count(*)  >  3 UNION SELECT product_id FROM Product_Suppliers GROUP BY product_id HAVING sum(total_amount_purchased)  >  80000

What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000 ?

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


Question: How many settlements were made on the claim with the most recent claim settlement date? List the number and the claim id.

SELECT count(*) ,  T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id  =  T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1

How many settlements were made on the claim with the most recent claim settlement date ? List the number and the claim i d.

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


Question: List out the full name and total cost that member id "rec4BLdZHS2Blfp4v" incurred?

SELECT T1.first_name, T1.last_name, SUM(T2.cost) FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.member_id = 'rec4BLdZHS2Blfp4v'

List out the full name and total cost that member i d " rec4BLdZHS2Blfp4v " incurred ?

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


Question: How many districts are in Idaho?

SELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'


Question: List all the items from "Sax Arts & Crafts" and the zip code of the schools that received them.

SELECT T2.school_zip, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Sax Arts & Crafts'

List all the items from " Sax Arts & Crafts " and the zip code of the schools that received them .

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


Question: What are the areas and counties for all appelations?

What are the areas and counties for all appelations ?


Question: What is the relationship between object sample no.12 and no.8 of image no.2345511?

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.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_ID = 8

What is the relationship between object sample no.12 and no.8 of image no.2345511 ?

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


Question: What are the first names of the people in alphabetical order?

SELECT first_name FROM people ORDER BY first_name

What are the first names of the people in alphabetical order ?

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


Question: Find the city and state of the bank branch named morningside.

SELECT city ,  state FROM bank WHERE bname  =  'morningside'

Find the city and state of the bank branch named morningside .

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


Question: What are the work numbers that are related to King Henry?

SELECT id FROM works WHERE Title LIKE '%Henry%'

What are the work numbers that are related to King Henry ?


Question: How many businesses in Phoenix, Arizona is attributed to waiter service?

SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.city LIKE 'Phoenix' AND T3.attribute_name LIKE 'waiter_service' AND T2.attribute_id = 2

How many businesses in Phoenix , Arizona is attributed to waiter service ?

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


Question: Provide the names and inspection results of the facilities located in Burnham.

SELECT DISTINCT T1.dba_name, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'BURNHAM'

Provide the names and inspection results of the facilities located in Burnham .

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


Question: Among the countries with note on the series code SM.POP.TOTL, how many of them are in the low-income group?

SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SM.POP.TOTL' AND T1.IncomeGroup = 'Low income'

Among the countries with note on the series code SM.POP.TOTL , how many of them are in the low - income group ?

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


Question: Return the maximum and minimum number of cows across all farms.

Return the maximum and minimum number of cows across all farms .


Question: How many single bonds are there in the list?

SELECT COUNT(T.bond_id) FROM bond AS T WHERE T.bond_type = '-'

How many single bonds are there in the list ?


Question: How many female students have no payment due?

SELECT COUNT(name) FROM no_payment_due WHERE name NOT IN ( SELECT name FROM male )

How many female students have no payment due ?

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


Question: Which country have completed vital registration? List all the countries.

SELECT ShortName FROM Country WHERE VitalRegistrationComplete = 'Yes'

Which country have completed vital registration ? List all the countries .

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


Question: What are all the labels?


Question: Find the percentage of male students enlisted in the fire department.

SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.name = T2.name WHERE T1.organ = 'fire_department'

Find the percentage of male students enlisted in the fire department .

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


Question: What are the names, types of powertrains, and yearly fuel costs for vehicles with model years in either 2013 2014?

SELECT name ,  type_of_powertrain ,  annual_fuel_cost FROM vehicles WHERE model_year  =  2013 OR model_year  =  2014

What are the names , types of powertrains , and yearly fuel costs for vehicles with model years in either 2013 2014 ?

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


Question: List down the languages of countries with an independence year between 1980 to 1995.

SELECT T2.Name, T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.IndepYear BETWEEN 1980 AND 1995

List down the languages of countries with an independence year between 1980 to 1995 .

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


Question: How many accounts do we have?


Question: How many Orange Cap awards were won by CH Gayle?

SELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Orange_Cap

How many Orange Cap awards were won by CH Gayle ?

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


Question: Show all locations where at least two conferences are located.

SELECT LOCATION FROM conference GROUP BY LOCATION HAVING count(*)  >=  2

Show all locations where at least two conferences are located .


Question: Return the names and ids of customers who have TN in their address.

SELECT customer_name ,  customer_id FROM customers WHERE customer_address LIKE "%TN%"

Return the names and ids of customers who have TN in their address .

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


Question: How many object samples are there in image no.1?

SELECT COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ WHERE IMG_ID = 1

How many object samples are there in image no.1 ?


Question: Give the Wikipedia IDs of historical legislators who are Readjuster Democrats.

SELECT T2.wikipedia_id FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'Readjuster Democrat'

Give the Wikipedia IDs of historical legislators who are Readjuster Democrats .

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


Question: List at least 5 customers who paid greater than $10. Provide the full name of the customers.

SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10

List at least 5 customers who paid greater than $ 10 . Provide the full name of the customers .

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


Question: Write the full name of the customers whose address is at 55 Dorton Pass, Huangqiao.

SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.street_number = 55 AND T3.street_name = 'Dorton Pass' AND T3.city = 'Huangqiao'

Write the full name of the customers whose address is at 55 Dorton Pass , Huangqiao .

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


Question: How many students play sports?

SELECT count(DISTINCT StuID) FROM Sportsinfo


Question: What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A?

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

What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A ?

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


Question: List out the procedure and medicine prescribed for drug overdose patients.

SELECT DISTINCT T2.DESCRIPTION, T3.DESCRIPTION FROM encounters AS T1 INNER JOIN procedures AS T2 ON T1.PATIENT = T2.PATIENT INNER JOIN medications AS T3 ON T1.PATIENT = T3.PATIENT WHERE T1.REASONDESCRIPTION = 'Drug overdose'

List out the procedure and medicine prescribed for drug overdose patients .

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


Question: What is the percentage of books that cost greater than $10 and were ordered by customer Ruthanne Vatini?

SELECT CAST(SUM(CASE WHEN T1.price > 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Ruthanne' AND T3.last_name = 'Vatini'

What is the percentage of books that cost greater than $ 10 and were ordered by customer Ruthanne Vatini ?

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


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

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

Among all students , calculate the percentage of male students .


Question: How many distinct delegates are from counties with population larger than 50000?

SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  >  50000

How many distinct delegates are from counties with population larger than 50000 ?

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


Question: What is the ratio of customer to subscriber that making a trip inside Mountain View city?

SELECT CAST(SUM(CASE WHEN T1.subscription_type = 'Customer' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.subscription_type = 'Subscriber' THEN 1 ELSE 0 END) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Mountain View'

What is the ratio of customer to subscriber that making a trip inside Mountain View city ?

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


Question: How many Olympic Games has London hosted?

SELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London'

How many Olympic Games has London hosted ?


Question: Who is the sponsor of menu with ID 12463?

SELECT sponsor FROM Menu WHERE id = 12463

Who is the sponsor of menu with ID 12463 ?

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


Question: What are the draft pick numbers and draft classes for players who play the Defender position?

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

What are the draft pick numbers and draft classes for players who play the Defender position ?

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


Question: Return the years in which more than 1 institution was founded, as well as the number of institutions founded in each of those.

SELECT Founded ,  COUNT(*) FROM institution GROUP BY Founded HAVING COUNT(*)  >  1

Return the years in which more than 1 institution was founded , as well as the number of institutions founded in each of those .

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


Question: Show all majors and corresponding number of students.

SELECT major ,  count(*) FROM Student GROUP BY major

Show all majors and corresponding number of students .


Question: What are the opening hours of business number 53 on Friday?

SELECT T1.closing_time - T1.opening_time AS "opening hours" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Friday' AND T1.business_id = 53

What are the opening hours of business number 53 on Friday ?

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


Question: Return the average and minimum ages across all pilots.

SELECT avg(age) ,  min(age) FROM pilotskills

Return the average and minimum ages across all pilots .


Question: Give me the times and numbers of all trains that go to Chennai, ordered by time.

SELECT TIME ,  train_number FROM train WHERE destination  =  'Chennai' ORDER BY TIME

Give me the times and numbers of all trains that go to Chennai , ordered by time .

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


Question: What are the countries that have both mountains that are higher than 5600 and lower than 5200?

SELECT Country FROM mountain WHERE Height  >  5600 INTERSECT SELECT Country FROM mountain WHERE Height  <  5200

What are the countries that have both mountains that are higher than 5600 and lower than 5200 ?

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


Question: Show institution types, along with the number of institutions and total enrollment for each type.

SELECT TYPE ,  count(*) ,  sum(enrollment) FROM institution GROUP BY TYPE

Show institution types , along with the number of institutions and total enrollment for each type .

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


Question: What is the maximum and minimum market value of companies?

SELECT max(Market_Value_in_Billion) ,  min(Market_Value_in_Billion) FROM company

What is the maximum and minimum market value of companies ?

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


Question: Find the campus fee of "San Jose State University" in year 2000.

SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus  =  t2.id WHERE t2.campus  =  "San Jose State University" AND t1.year  =  2000

Find the campus fee of " San Jose State University " in year 2000 .

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


Question: When John Aalberg took part in the 1994 Winter Olympic Game, how old was he?

SELECT T2.age 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' AND T1.games_name = '1994 Winter'

When John Aalberg took part in the 1994 Winter Olympic Game , how old was he ?

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


Question: Show different occupations along with the number of players in each occupation.

SELECT Occupation ,  COUNT(*) FROM player GROUP BY Occupation

Show different occupations along with the number of players in each occupation .


Question: Find the distinct locations that has a cinema.

Find the distinct locations that has a cinema .


Question: Count the number of different complaint type codes.

SELECT count(DISTINCT complaint_type_code) FROM complaints

Count the number of different complaint type codes .


Question: How many years did player Id "healygl01" play?

SELECT COUNT(year) FROM Goalies WHERE playerID = 'healygl01'

How many years did player I d " healygl01 " play ?

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


Question: Which carcinogenic molecule have the highest number of atoms consisted in it?

SELECT T.molecule_id FROM ( SELECT T2.molecule_id, COUNT(T1.atom_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' GROUP BY T2.molecule_id ORDER BY COUNT(T1.atom_id) DESC LIMIT 1 ) t

Which carcinogenic molecule have the highest number of atoms consisted in it ?


Question: What is the title of the highest-budget film to date? Please include the revenue and name the country.

SELECT T1.title, T1.revenue, T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id ORDER BY T1.budget DESC LIMIT 1

What is the title of the highest - budget film to date ? Please include the revenue and name the country .

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


Question: What is the average rating score of the movie "When Will I Be Loved" and who was its director?

SELECT AVG(T1.rating_score), T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved'

What is the average rating score of the movie " When Will I Be Loved " and who was its director ?

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


Question: Show all the planned delivery dates and actual delivery dates of bookings.

SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS

Show all the planned delivery dates and actual delivery dates of bookings .

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


Question: Find the person who has exactly one friend.

SELECT name FROM PersonFriend GROUP BY name HAVING count(*)  =  1

Find the person who has exactly one friend .


Question: List the top 10 customers by total gross sales. List customers' first and last name and total gross sales.

SELECT T1.first_name ,  T1.last_name ,  SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id  =  T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;

List the top 10 customers by total gross sales . List customers ' first and last name and total gross sales .

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


Question: What is the gender of the user who tweeted `tw-715909161071091712`?

SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.TweetID = 'tw-715909161071091712'

What is the gender of the user who tweeted ` tw-715909161071091712 ` ?

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


Question: What are all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.

SELECT address_content FROM addresses WHERE city  =  "East Julianaside" AND state_province_county  =  "Texas" UNION SELECT address_content FROM addresses WHERE city  =  "Gleasonmouth" AND state_province_county  =  "Arizona"

What are all the addresses in East Julianaside , Texas or in Gleasonmouth , Arizona .

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


Question: List the inventory ID of the film titled "African Egg".

SELECT T2.inventory_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'African Egg'

List the inventory ID of the film titled " African Egg " .

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


Question: What is the owner's name of the of the business that violates 103156 on June 12, 2014?

SELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = 103156 AND T1.`date` = '2014-06-12'

What is the owner 's name of the of the business that violates 103156 on June 12 , 2014 ?

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


Question: How many players weigh more than 90 kg?

SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90

How many players weigh more than 90 kg ?


Question: For each station, find its latitude and the minimum duration of trips that ended at the station.

SELECT T1.name ,  T1.lat ,  min(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.end_station_id GROUP BY T2.end_station_id

For each station , find its latitude and the minimum duration of trips that ended at the station .

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


Question: What products were ordered by the customer ID "WILMK" which were required on 3/26/1998?

SELECT T3.ProductName FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.RequiredDate LIKE '1998-03-26%' AND T1.CustomerID = 'WILMK'

What products were ordered by the customer ID " WILMK " which were required on 3/26/1998 ?

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


Question: For the device with an event occurring on 2016/5/1 at 0:55:25, what is the gender of its user?

SELECT T1.gender FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-01 00:55:25'

For the device with an event occurring on 2016/5/1 at 0:55:25 , what is the gender of its user ?

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


Question: What is the surname of the driver with the best lap time in race number 19 in the second qualifying period?

SELECT T2.surname FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 19 ORDER BY T1.q2 ASC LIMIT 1

What is the surname of the driver with the best lap time in race number 19 in the second qualifying period ?

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


Question: What is the average household income of Glendale?

SELECT AVG(`Household Income`) FROM `Store Locations` WHERE `City Name` = 'Glendale'

What is the average household income of Glendale ?


Question: How many students are enrolled in the class taught by some professor from the accounting department?

SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN course AS T3 ON T1.crs_code  =  T3.crs_code JOIN department AS T4 ON T3.dept_code  =  T4.dept_code WHERE T4.dept_name  =  'Accounting'

How many students are enrolled in the class taught by some professor from the accounting department ?

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


Question: Provide the title and total time of the recipe which can be made with only lima beans.

SELECT T1.title, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'lima beans'

Provide the title and total time of the recipe which can be made with only lima beans .

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


Question: Among the vendors with maximum orders betweeen 500 to 750, which vendor has the 10th highest profit on net?

SELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.MaxOrderQty BETWEEN 500 AND 750 ORDER BY T1.LastReceiptCost - T1.StandardPrice DESC LIMIT 9, 1

Among the vendors with maximum orders betweeen 500 to 750 , which vendor has the 10th highest profit on net ?

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


Question: How many aircrafts exist in the database?

How many aircrafts exist in the database ?


Question: How many days did the show fell more than 5 inches?

SELECT COUNT(DISTINCT `date`) FROM weather WHERE snowfall > 5

How many days did the show fell more than 5 inches ?

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


Question: Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.

SELECT T1.first_name ,  T1.last_name ,  COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id  =  T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;

Find out the top 10 customers by total number of orders . List customers ' first and last name and the number of total orders .

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


Question: What is the customer id, first and last name with most number of accounts.

SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts 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 , first and last name with most number of accounts .

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


Question: Which country was the source of Pjandsh River? Give the full name of the country.

SELECT T1.Name FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country WHERE T2.River = 'Pjandsh'

Which country was the source of Pjandsh River ? Give the full name of the country .

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


Question: Provide the hero name and race of Charles Chandler.

SELECT T1.superhero_name, T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.full_name = 'Charles Chandler'

Provide the hero name and race of Charles Chandler .

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


Question: What are the category of music festivals with result "Awarded"?

SELECT Category FROM music_festival WHERE RESULT  =  "Awarded"

What are the category of music festivals with result " Awarded " ?

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


Question: Find the average access count of documents with the least popular structure.

SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1

Find the average access count of documents with the least popular structure .

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


Question: Other than the Chief Executive Officer, who is the employee who has the highest payrate? State the rate.

SELECT T2.FirstName, T2.LastName FROM EmployeePayHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.JobTitle NOT LIKE 'Chief Executive Officer' ORDER BY T1.Rate DESC LIMIT 1

Other than the Chief Executive Officer , who is the employee who has the highest payrate ? State the rate .

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


Question: Show the names of trains and locations of railways they are in.

SELECT T2.Name ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID

Show the names of trains and locations of railways they are in .

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


Question: List the race of institutions in Alabama with number of students greater than the 90% of average number of students of all institutions?

SELECT DISTINCT T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count > ( SELECT AVG(T1.student_count) * 0.9 FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' ) AND T1.state = 'Alabama'

List the race of institutions in Alabama with number of students greater than the 90 % of average number of students of all institutions ?

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


Question: What is the main spoken language in MNE?

SELECT Name FROM language WHERE Country = 'MNE' ORDER BY Percentage DESC LIMIT 1

What is the main spoken language in MNE ?


Question: How much higher is the average rating score of the movie "Innocence Unprotected" than the movie "When Will I Be Loved"?

SELECT SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id

How much higher is the average rating score of the movie " Innocence Unprotected " than the movie " When Will I Be Loved " ?

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


Question: How many employees does each role have? List role description, id and number of employees.

SELECT T1.role_description ,  T2.role_code ,  count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code;

How many employees does each role have ? List role description , i d and number of employees .

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


Question: What is the name of the most difficult course?

SELECT name FROM course WHERE diff = ( SELECT MAX(diff) FROM course )

What is the name of the most difficult course ?


Question: Return the type code of the document named "David CV".

SELECT document_type_code FROM documents WHERE document_name  =  "David CV"

Return the type code of the document named " David CV " .

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


Question: Find the name and capacity of the dorm with least number of amenities.

SELECT T1.dorm_name ,  T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid GROUP BY T2.dormid ORDER BY count(*) LIMIT 1

Find the name and capacity of the dorm with least number of amenities .

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


Question: Write down the atom IDs of the first and second atoms of triple bond type molecules.

SELECT T2.atom_id, T2.atom_id2 FROM bond AS T1 INNER JOIN connected AS T2 ON T1.bond_id = T2.bond_id WHERE T1.bond_type = '#'

Write down the atom IDs of the first and second atoms of triple bond type molecules .

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


Question: What is the fastest lap number of the champion in 2009?

SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T1.time LIKE '_:%:__.___'

What is the fastest lap number of the champion in 2009 ?

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


Question: Find the number of manufactures that are based in Tokyo or Beijing.

SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'

Find the number of manufactures that are based in Tokyo or Beijing .

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


Question: What is the average salary of the worst performing managers?

SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Manager'

What is the average salary of the worst performing managers ?

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


Question: Find the name, address, number of students in the departments that have the top 3 highest number of students.

SELECT T2.dept_name ,  T2.dept_address ,  count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3

Find the name , address , number of students in the departments that have the top 3 highest number of students .

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


Question: What are the zip codes of properties which do not belong to users who own at most 2 properties?

SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id WHERE T2.owner_user_id NOT IN ( SELECT owner_user_id FROM Properties GROUP BY owner_user_id HAVING count(*)  <=  2 );

What are the zip codes of properties which do not belong to users who own at most 2 properties ?

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


Question: Show different colleges along with the number of authors of submission from each college.

SELECT College ,  COUNT(*) FROM submission GROUP BY College

Show different colleges along with the number of authors of submission from each college .

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


Question: List all the negative comments on the "Dog Run - Pet Dog Simulator" app.

SELECT Translated_Review FROM user_reviews WHERE App = 'Dog Run - Pet Dog Simulator' AND Sentiment = 'Negative'

List all the negative comments on the " Dog Run - Pet Dog Simulator " app .

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


Question: what are the order id and customer id of the oldest order?

SELECT order_id ,  customer_id FROM orders ORDER BY date_order_placed LIMIT 1

what are the order i d and customer i d of the oldest order ?

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


Question: What are the names and nationalities of the people who did not participate in any ACL conferences?

SELECT name ,  nationality FROM staff WHERE staff_id NOT IN (SELECT T2.staff_id FROM Conference AS T1 JOIN Conference_participation AS T2 ON T1.conference_id  =  T2.conference_id WHERE T1.Conference_Name  =  "ACL")

What are the names and nationalities of the people who did not participate in any ACL conferences ?

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


Question: Please state the district name where incident number JB106545 took place.

SELECT T1.case_number FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.title = 'Criminal Sexual Assault' AND T2.crime_against = 'Persons' AND T1.arrest = 'TRUE' LIMIT 3

Please state the district name where incident number JB106545 took place .


Question: What is the description of the color for most products?

SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code  =  t2.color_code GROUP BY t2.color_description ORDER BY count(*) DESC LIMIT 1

What is the description of the color for most products ?

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


Question: What are the ids of stations that have latitude above 37.4 and never had bike availability below 7?

SELECT id FROM station WHERE lat  >  37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING min(bikes_available)  <  7

What are the ids of stations that have latitude above 37.4 and never had bike availability below 7 ?

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


Question: List the team name and the total wins of the team in year 2005 which has greater winning from the previous year.

SELECT T1.name, T1.won FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE year = 2004 ) AS T2 on T1.tmID = T2.tmID WHERE T1.year = 2005 and T1.won > T2.won

List the team name and the total wins of the team in year 2005 which has greater winning from the previous year .

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


Question: What is the name of the artist with the greatest number of albums?

SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1

What is the name of the artist with the greatest number of albums ?

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


Question: Give the country with the fewest students.

SELECT T1.country FROM City AS T1 JOIN Student AS T2 ON T1.city_code  =  T2.city_code GROUP BY T1.country ORDER BY count(*) LIMIT 1

Give the country with the fewest students .


Question: Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction.

SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus"

Find the names of the tourist attractions that is either accessible by bus or at address 254 Ottilie Junction .

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


Question: Show the names of members and the location of performances they attended in ascending alphabetical order of their names.

SELECT T2.Name ,  T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID  =  T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID  =  T3.Performance_ID ORDER BY T2.Name ASC

Show the names of members and the location of performances they attended in ascending alphabetical order of their names .

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


Question: What are the cell phone numbers of the candidates that received an assessment code of "Fail"?

SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"

What are the cell phone numbers of the candidates that received an assessment code of " Fail " ?

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


Question: List down the rating for the App Learn C++.

SELECT DISTINCT Rating FROM playstore WHERE App = 'Learn C++'

List down the rating for the App Learn C++ .

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


Question: What is the account balance of the supplier with the most parts?

SELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1

What is the account balance of the supplier with the most parts ?

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


Question: Where was the destination city of shipment no.1701?

SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1701'

Where was the destination city of shipment no.1701 ?


Question: Hom many albums does the artist "Metallica" have?

SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"

Hom many albums does the artist " Metallica " have ?

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


Question: How many female actors have been played a role in any of French or USA movies?

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

How many female actors have been played a role in any of French or USA movies ?

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


Question: List the names and the locations that the enzymes can make an effect.

List the names and the locations that the enzymes can make an effect .

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


Question: List the name of enzymes in descending lexicographical order.

SELECT name FROM enzyme ORDER BY name DESC

List the name of enzymes in descending lexicographical order .


Question: What is the ratio between famous current legislators and famous historical legislators?

SELECT CAST(COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) FROM historical ) FROM current

What is the ratio between famous current legislators and famous historical legislators ?


Question: Please list the name of the districts with accounts that made withdrawal transactions.

SELECT DISTINCT T1.A2 FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE T3.type = 'VYDAJ'

Please list the name of the districts with accounts that made withdrawal transactions .

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


Question: What are the official names of cities that have population over 1500 or less than 500?

SELECT Official_Name FROM city WHERE Population  >  1500 OR Population  <  500

What are the official names of cities that have population over 1500 or less than 500 ?

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


Question: What is the name of the customer who has the largest number of orders?

SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1

What is the name of the customer who has the largest number of orders ?

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


Question: What is the last name of the employees who must report to the Vice President of Sales?

SELECT LastName FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE Title = 'Vice President, Sales' )

What is the last name of the employees who must report to the Vice President of Sales ?

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


Question: What is the average review given by a subscriber?

SELECT AVG(T2.StarRating) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'TRUE'

What is the average review given by a subscriber ?

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


Question: Give the state and name of institutions in year of data release from 2010 to 2012 with black students.

SELECT DISTINCT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'B' AND T2.year BETWEEN 2010 AND 2012

Give the state and name of institutions in year of data release from 2010 to 2012 with black students .

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


Question: How many male Regional Managers are there?

SELECT COUNT(*) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M'

How many male Regional Managers are there ?


Question: Show names of clubs in descending order of average earnings of players belonging.

SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID GROUP BY T1.Club_ID ORDER BY avg(T2.Earnings) DESC

Show names of clubs in descending order of average earnings of players belonging .

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


Question: How many lakes are there in the 4th most populous African country with a republican form of government?

SELECT COUNT(*) FROM geo_lake WHERE Country = ( SELECT T4.Code FROM ( SELECT T2.Code, T2.Population FROM encompasses AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN politics AS T3 ON T1.Country = T3.Country WHERE T1.Continent = 'Africa' AND T1.Percentage = 100 AND T3.Government = 'republic' ORDER BY Population DESC LIMIT 4 ) AS T4 ORDER BY population ASC LIMIT 1 )

How many lakes are there in the 4th most populous African country with a republican form of government ?

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


Question: For each country and airline name, how many routes are there?

SELECT T1.country ,  T1.name ,  count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.country ,  T1.name

For each country and airline name , how many routes are there ?

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


Question: Return the addresses of the course authors or tutors whose personal name is "Cathrine".

SELECT address_line_1 FROM Course_Authors_and_Tutors WHERE personal_name	 =  "Cathrine"

Return the addresses of the course authors or tutors whose personal name is " Cathrine " .

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


Question: List the title of films that do not have any market estimation.

SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)

List the title of films that do not have any market estimation .

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


Question: Return the id of the project that has the fewest corresponding documents.

SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1

Return the i d of the project that has the fewest corresponding documents .

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


Question: What is the power ID of cryokinesis?

SELECT id FROM superpower WHERE power_name = 'Cryokinesis'


Question: How many different product types are there?

SELECT count(DISTINCT product_type_code) FROM products_for_hire

How many different product types are there ?

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


Question: At present, calculate for the player's age who have a sprint speed of no less than 97 between 2013 to 2015.

SELECT DISTINCT DATETIME() - T2.birthday age FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id WHERE STRFTIME('%Y',t1.`date`) >= '2013' AND STRFTIME('%Y',t1.`date`) <= '2015' AND t1.sprint_speed >= 97

At present , calculate for the player 's age who have a sprint speed of no less than 97 between 2013 to 2015 .

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


Question: What are the ids and durations of the trips with the top 3 durations?

SELECT id ,  duration FROM trip ORDER BY duration DESC LIMIT 3

What are the ids and durations of the trips with the top 3 durations ?

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


Question: What is the organization enlisted by student168?

SELECT organ FROM enlist WHERE name = 'student168'

What is the organization enlisted by student168 ?


Question: Mention the user average star, elite year and the compliment type of user ID 6027 whereby number of compliments reach uber.

SELECT T2.user_average_stars, T1.year_id, T4.compliment_type, T3.number_of_compliments FROM Elite AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id INNER JOIN Users_Compliments AS T3 ON T2.user_id = T3.user_id INNER JOIN Compliments AS T4 ON T3.compliment_id = T4.compliment_id INNER JOIN Years AS T5 ON T1.year_id = T5.year_id WHERE T3.number_of_compliments = 'Uber' AND T3.user_id = 6027

Mention the user average star , elite year and the compliment type of user ID 6027 whereby number of compliments reach uber .

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


Question: What is the rating and category of the podcast entitled Sitcomadon?

SELECT DISTINCT T3.rating, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'Sitcomadon'

What is the rating and category of the podcast entitled Sitcomadon ?

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


Question: List the full name its capital of all the countries with parliamentary democracy government.

SELECT T1.Capital FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Government = 'parliamentary democracy'

List the full name its capital of all the countries with parliamentary democracy government .

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


Question: Which countries use Euro as their currency? List down the table name.

SELECT TableName FROM Country WHERE CurrencyUnit = 'Euro'

Which countries use Euro as their currency ? List down the table name .

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


Question: What is the most common sign of patients with SLE disease?

SELECT Symptoms FROM Examination WHERE Diagnosis = 'SLE' GROUP BY Symptoms ORDER BY COUNT(Symptoms) DESC LIMIT 1

What is the most common sign of patients with SLE disease ?


Question: What is the percentage of offense rebounds from the total rebounds of the players in year 2000.

SELECT CAST(SUM(T2.o_rebounds) AS REAL) * 100 / SUM(T2.rebounds) FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2000

What is the percentage of offense rebounds from the total rebounds of the players in year 2000 .

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


Question: List the start time and the end time of the students' addresses for the students who have 2 transcripts.

SELECT date_from ,  date_to FROM Students_Addresses WHERE student_id IN ( SELECT student_id FROM Transcripts GROUP BY student_id HAVING count(*)  =  2 )

List the start time and the end time of the students ' addresses for the students who have 2 transcripts .

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


Question: What are the details of the lots which are not used in any transactions?

SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id  =  T2.lot_id

What are the details of the lots which are not used in any transactions ?

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


Question: Please list the dates on which the temperature of station no.2 was above the 30-year normal.

SELECT `date` FROM weather WHERE station_nbr = 2 AND depart > 0

Please list the dates on which the temperature of station no.2 was above the 30 - year normal .

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


Question: which course has most number of registered students?

SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1

which course has most number of registered students ?


Question: What are the ids with apple flavor?

SELECT id FROM goods WHERE flavor  =  "Apple"


Question: What is the name of the supplier company for Aniseed Syrup?

SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Aniseed Syrup'

What is the name of the supplier company for Aniseed Syrup ?

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


Question: What are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3?

SELECT title ,  film_id FROM film WHERE rental_rate  =  0.99 INTERSECT SELECT T1.title ,  T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id HAVING count(*)  <  3

What are the title and i d of the film which has a rental rate of 0.99 and an inventory of below 3 ?

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


Question: How many budgets are above 3000 in year 2001 or before?

SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001

How many budgets are above 3000 in year 2001 or before ?

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


Question: How many students took the hardest course?

SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5

How many students took the hardest course ?


Question: Which employees do not destroy any document? Find their employee ids.

SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed

Which employees do not destroy any document ? Find their employee ids .

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


Question: Return the title of the film with the highest high estimate?

SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2  ON T1.Film_ID  =  T2.Film_ID ORDER BY high_estimate DESC LIMIT 1

Return the title of the film with the highest high estimate ?

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


Question: What is department name and office for the professor whose last name is Heffington?

SELECT T3.dept_name  ,  T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num  =  T2.emp_num JOIN department AS T3 ON T2.dept_code  =  T3.dept_code WHERE T1.emp_lname  =  'Heffington'

What is department name and office for the professor whose last name is Heffington ?

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


Question: How much in total does customer with first name as Carole and last name as Bernhard paid?

SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"

How much in total does customer with first name as Carole and last name as Bernhard paid ?

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


Question: Return the weights of entrepreneurs, ordered descending by amount of money requested.

SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested DESC

Return the weights of entrepreneurs , ordered descending by amount of money requested .

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


Question: What are the names of the clubs that have "Davis Steven" as a member?

SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t3.fname  =  "Davis" AND t3.lname  =  "Steven"

What are the names of the clubs that have " Davis Steven " as a member ?

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


Question: For the students who have been absent from school for the longest time, how many months have they been absent?

SELECT MAX(month) FROM longest_absense_from_school

For the students who have been absent from school for the longest time , how many months have they been absent ?

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


Question: How many chapters include the character name "First Witch"?

SELECT COUNT(T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'First Witch'

How many chapters include the character name " First Witch " ?

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


Question: Find the id and first name of the student that has the most number of assessment notes?

SELECT T1.student_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1

Find the i d and first name of the student that has the most number of assessment notes ?

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


Question: What are the names of patients who are not taking the medication of Procrastin-X.

SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient  =  T1.SSN JOIN Medication AS T3 ON T2.Medication  =  T3.Code WHERE T3.name  =  'Procrastin-X'

What are the names of patients who are not taking the medication of Procrastin - X.

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


Question: After making a credit card withdrawal, how many account/s with monthly issuance has a negative balance?

SELECT COUNT(T1.account_id) FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE T1.balance < 0 AND T1.operation = 'VYBER KARTOU' AND T2.frequency = 'POPLATEK MESICNE'

After making a credit card withdrawal , how many account / s with monthly issuance has a negative balance ?

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


Question: Find the total number of hours have done for all students in each department.

SELECT sum(stu_hrs) ,  dept_code FROM student GROUP BY dept_code

Find the total number of hours have done for all students in each department .


Question: Among the players whose preferred foot was the left foot when attacking, how many of them would remain in his position when the team attacked?

SELECT COUNT(player_api_id) FROM Player_Attributes WHERE preferred_foot = 'left' AND attacking_work_rate = 'low'

Among the players whose preferred foot was the left foot when attacking , how many of them would remain in his position when the team attacked ?

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


Question: How many users are there in the Home Decoration category?

SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Home Decoration'

How many users are there in the Home Decoration category ?

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


Question: What is the total number of people who has no friend living in the city of Austin.

SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city  =  'Austin')

What is the total number of people who has no friend living in the city of Austin .

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


Question: Return the total revenue of companies with headquarters in Tokyo or Taiwan.

SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'

Return the total revenue of companies with headquarters in Tokyo or Taiwan .

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


Question: Show the location codes with at least 3 documents.

SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*)  >=  3

Show the location codes with at least 3 documents .

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


Question: Sort all the distinct product names in alphabetical order.

SELECT DISTINCT product_name FROM product ORDER BY product_name

Sort all the distinct product names in alphabetical order .


Question: Indicate the title of all the films rated as 'Adults Only'.

SELECT title FROM film WHERE rating = 'NC-17'

Indicate the title of all the films rated as ' Adults Only ' .

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


Question: What is the episode ID that received 2 stars and 9 votes?

SELECT episode_id FROM Vote WHERE stars = 2 AND votes = 9;

What is the episode ID that received 2 stars and 9 votes ?

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


Question: What is the average number of tweets posted by the users in a city in Argentina?

SELECT SUM(CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'

What is the average number of tweets posted by the users in a city in Argentina ?

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


Question: What is the website address of the institution with the highest number of White degree-seeking students at 2-year institutions in 2008?

SELECT T1.site FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'W' AND T2.cohort = '2y all' AND T2.year = 2008 ORDER BY T2.grad_cohort DESC LIMIT 1

What is the website address of the institution with the highest number of White degree - seeking students at 2 - year institutions in 2008 ?

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


Question: Give the names of the schools with the percent eligible for free meals in K-12 is more than 0.1 and test takers whose test score is greater than or equal to 1500?

SELECT T2.`School Name` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE CAST(T2.`Free Meal Count (K-12)` AS REAL) / T2.`Enrollment (K-12)` > 0.1 AND T1.NumGE1500 > 0

Give the names of the schools with the percent eligible for free meals in K-12 is more than 0.1 and test takers whose test score is greater than or equal to 1500 ?

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


Question: Find the name of songs that does not have a back vocal.

SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back"

Find the name of songs that does not have a back vocal .

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


Question: Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served.

SELECT coachID, tmID FROM coaches WHERE year BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1

Who is the longest serving coach from year 1970 to 1980 . List the coach ID and the team(s ) he served .

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


Question: What is the id of the shortest trip?

SELECT id FROM trip ORDER BY duration LIMIT 1


Question: In male customers with an occupation handlers or cleaners, what is the percentage of customers with a true response?

SELECT CAST(SUM(CASE WHEN T2.RESPONSE = 'true' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.REFID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.OCCUPATION = 'Handlers-cleaners' AND T1.SEX = 'Male'

In male customers with an occupation handlers or cleaners , what is the percentage of customers with a true response ?

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


Question: When did the first payment happen?

SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1


Question: Find the names of the districts which have had both spokesman with rank position 1 and 2.

SELECT t3.name FROM spokesman AS t1 JOIN spokesman_district AS t2 ON t1.Spokesman_ID  =  t2.Spokesman_ID JOIN district AS t3 ON t3.district_id  =  t2.district_id WHERE t1.rank_position  =  1 INTERSECT SELECT t3.name FROM spokesman AS t1 JOIN spokesman_district AS t2 ON t1.Spokesman_ID  =  t2.Spokesman_ID JOIN district AS t3 ON t3.district_id  =  t2.district_id WHERE t1.rank_position  =  2

Find the names of the districts which have had both spokesman with rank position 1 and 2 .

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


Question: What are the ids of documents which don't have expense budgets?

SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses

What are the ids of documents which do n't have expense budgets ?


Question:
What country has the latest trade data with a series code of "SP.DYN.CDRT.IN
"? List the table name of the country.

SELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorCode = 'SP.DYN.CDRT.IN'

What country has the latest trade data with a series code of " SP.DYN.CDRT.IN " ? List the table name of the country .

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


Question: Count the number of voting records for each election cycle.

SELECT Election_Cycle ,  count(*) FROM VOTING_RECORD GROUP BY Election_Cycle

Count the number of voting records for each election cycle .

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


Question: Which company falls under the category of an associated member? Please provide the organization's full name.

SELECT NAME FROM organization WHERE country IN ( SELECT country FROM politics WHERE dependent != '' )

Which company falls under the category of an associated member ? Please provide the organization 's full name .

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


Question: Please list any two character names in chapter 18708.

SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.chapter_id = 18708 LIMIT 2

Please list any two character names in chapter 18708 .


Question: Find the id of the order whose shipment tracking number is "3452".

SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"

Find the i d of the order whose shipment tracking number is " 3452 " .

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


Question: How many active users were there in the event id 2?

SELECT COUNT(is_active) FROM app_events WHERE event_id = 2 AND is_active = 1

How many active users were there in the event i d 2 ?

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


Question: Show the theme for exhibitions with both records of an attendance 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

Show the theme for exhibitions with both records of an attendance below 100 and above 500 .

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


Question: List by its ID number all restaurants on 11th Street in Oakland.

SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street'

List by its ID number all restaurants on 11th Street in Oakland .

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


Question: How many dairy recipes can serve more than 10 people?

SELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.category = 'dairy' AND T1.servings > 10

How many dairy recipes can serve more than 10 people ?

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


Question: Show the budget type code and description and the corresponding document id.

SELECT T2.budget_type_code ,  T2.budget_type_description ,  T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code  =  T2.budget_type_code

Show the budget type code and description and the corresponding document i d.

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


Question: Return the date stamp and property name for each property history event, sorted by date stamp.

SELECT T1.datestamp ,  T2.property_name FROM User_Property_History AS T1 JOIN Properties AS T2 ON T1.property_id  =  T2.property_id ORDER BY datestamp;

Return the date stamp and property name for each property history event , sorted by date stamp .

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


Question: Please provide any two episodes' names that have the same keyword of "1930s to 2020s".

SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = '1930s to 2020s' LIMIT 2;

Please provide any two episodes ' names that have the same keyword of " 1930s to 2020s " .

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


Question: Please list any two user numbers that have an "Uber" number of cute compliments.

SELECT T1.user_id FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.number_of_compliments LIKE 'Uber' AND T2.compliment_type LIKE 'cute' LIMIT 2

Please list any two user numbers that have an " Uber " number of cute compliments .

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


Question: List down names of teams that have played as second team against Pune Warriors.

SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_2 WHERE T1.Team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Pune Warriors' ) GROUP BY T2.Team_Name

List down names of teams that have played as second team against Pune Warriors .

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


Question: Where is the address 15873 located, in what city and state? Does that city belong to a province where the code exists?

SELECT T2.City, T1.Name, T1.IsOnlyStateProvinceFlag FROM StateProvince AS T1 INNER JOIN Address AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T2.AddressID = 15873

Where is the address 15873 located , in what city and state ? Does that city belong to a province where the code exists ?

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


Question: List the details of the customers who do not have any policies.

SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id  =  T2.customer_id

List the details of the customers who do not have any policies .


Question: What is the percentage of champions at the age of over 30?

SELECT CAST(COUNT(CASE WHEN T2.age > 30 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id WHERE T1.medal_id = 1

What is the percentage of champions at the age of over 30 ?


Question: How many customers have ordered the product named Monitor?

SELECT count(DISTINCT T3.customer_id) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Customer_orders AS T3 ON T3.order_id  =  T1.order_id WHERE T2.product_name  =  "Monitor"

How many customers have ordered the product named Monitor ?

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


Question: In which region can you find the top 4 most popular restaurants?

SELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4

In which region can you find the top 4 most popular restaurants ?


Question: Find the name of captains whose rank are either Midshipman or Lieutenant.

SELECT name FROM captain WHERE rank  =  'Midshipman' OR rank  =  'Lieutenant'

Find the name of captains whose rank are either Midshipman or Lieutenant .

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


Question: Find the customer name and date of the orders that have the status "Delivered".

SELECT t1.customer_name ,  t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id  =  t2.customer_id WHERE order_status  =  "Delivered"

Find the customer name and date of the orders that have the status " Delivered " .

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


Question: How many budget types do we have?