Question: Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive.

SELECT t1.phone FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Leslie' AND t2.lastName = 'Jennings' ORDER BY t1.creditLimit DESC LIMIT 3

Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive .

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


Question: How many exhibition are there in year 2005 or after?

SELECT count(*) FROM exhibition WHERE YEAR  >=  2005

How many exhibition are there in year 2005 or after ?

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


Question: Which countries do the top 5 highest paying customers in a single payment come from? Indicate their entire address.

SELECT DISTINCT T2.country, T2.addressLine1, T2.addressLine2 FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber ORDER BY T1.amount DESC LIMIT 5

Which countries do the top 5 highest paying customers in a single payment come from ? Indicate their entire address .

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


Question: The lake with the highest altitude is located in which city?

SELECT T2.City FROM lake AS T1 LEFT JOIN located AS T2 ON T2.Lake = T1.Name ORDER BY T1.Altitude DESC LIMIT 1

The lake with the highest altitude is located in which city ?

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


Question: Please list the lap records for the circuits in Italy.

WITH fastest_lap_times AS (SELECT T1.raceId, T1.FastestLapTime, (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) as time_in_seconds FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL ) SELECT T1.FastestLapTime as lap_record FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId INNER JOIN (SELECT MIN(fastest_lap_times.time_in_seconds) as min_time_in_seconds FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T3.country = 'Italy' ) AS T4 ON (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) = T4.min_time_in_seconds LIMIT 1

Please list the lap records for the circuits in Italy .


Question: What are the name and id of the team with the most victories in 2008 postseason?

SELECT T2.name ,  T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T1.year  =  2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;

What are the name and i d of the team with the most victories in 2008 postseason ?

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


Question: How many people who are below 30 and participated in the summer season?

SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' AND T2.age < 30

How many people who are below 30 and participated in the summer season ?

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


Question: What search strings were entered by users who do not own any properties?

SELECT search_string FROM User_Searches EXCEPT SELECT T1.search_string FROM User_Searches AS T1 JOIN Properties AS T2 ON T1.user_id  =  T2.owner_user_id;

What search strings were entered by users who do not own any properties ?

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


Question: Calculate the average number of the word occurrences in which ‘system’ appeared as the first word in the pair.

SELECT AVG(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'sistema' )

Calculate the average number of the word occurrences in which ‘ system ’ appeared as the first word in the pair .

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


Question: Give the name and the position of the cbsa officer from the area with the zip code 45503.

SELECT T1.CBSA_name, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.zip_code = 45503 GROUP BY T1.CBSA_name, T2.latitude, T2.longitude

Give the name and the position of the cbsa officer from the area with the zip code 45503 .

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


Question: How many times is the number of active apps in the event that happened at 7:50:28 on 2016/5/2 than in the event that happened at 7:41:03 on 2016/5/2?

SELECT SUM(IIF(timestamp = '2016-05-02 7:50:28', 1, 0)) / SUM(IIF(timestamp = '2016-05-02 7:41:03', 1, 0)) AS num FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.is_active = '1'

How many times is the number of active apps in the event that happened at 7:50:28 on 2016/5/2 than in the event that happened at 7:41:03 on 2016/5/2 ?

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


Question: Show the years and the official names of the host cities of competitions.

SELECT T2.Year ,  T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID  =  T2.Host_city_ID

Show the years and the official names of the host cities of competitions .

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


Question: Please give the name of the race held on the circuits in Germany.

SELECT DISTINCT T2.name FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.country = 'Germany'

Please give the name of the race held on the circuits in Germany .

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


Question: Among the players with an overall rating between 60 to 65, how many players whose going to be in all of your attack moves instead of defensing?

SELECT COUNT(id) FROM Player_Attributes WHERE overall_rating BETWEEN 60 AND 65 AND defensive_work_rate = 'low'

Among the players with an overall rating between 60 to 65 , how many players whose going to be in all of your attack moves instead of defensing ?

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


Question: Mention the number of businesses that have no any attribute.

SELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_value IN ('none', 'no', 'false')

Mention the number of businesses that have no any attribute .

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


Question: On what year did the youngest driver had his first qualifying race? Also state the name, date and time of the race.

SELECT T3.year, T3.name, T3.date, T3.time FROM qualifying AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 on T1.raceId = T3.raceId WHERE T1.driverId = ( SELECT driverId FROM drivers ORDER BY dob DESC LIMIT 1 ) ORDER BY T3.date ASC LIMIT 1

On what year did the youngest driver had his first qualifying race ? Also state the name , date and time of the race .

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


Question: How many orders of O'Sullivan Plantations 2-Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed?

SELECT COUNT(DISTINCT T1.`Order ID`) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND T2.Region = 'Central' AND T1.`Ship Mode` = 'First Class'

How many orders of O'Sullivan Plantations 2 - Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed ?

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


Question: List the closing time and day of week of active businesses in Goodyear with stars greater than the 80% of average age of star rating.

SELECT DISTINCT T2.closing_time, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.active = 'true' AND T1.city = 'Goodyear' AND T1.stars > ( SELECT AVG(stars) * 0.8 FROM Business WHERE active = 'true' AND city = 'Goodyear' )

List the closing time and day of week of active businesses in Goodyear with stars greater than the 80 % of average age of star rating .

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


Question: How many distinct colleges are associated with players from the team with name "Columbus Crew".

SELECT count(DISTINCT T1.College) FROM match_season AS T1 JOIN team AS T2 ON T1.Team  =  T2.Team_id WHERE T2.Name  =  "Columbus Crew"

How many distinct colleges are associated with players from the team with name " Columbus Crew " .

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


Question: How many research assistants does Sauveur Skyme have?

SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Sauveur' AND T2.last_name = 'Skyme'

How many research assistants does Sauveur Skyme have ?


Question: Please list the IDs of the paragraphs in which the character "son to Tamora" appears.

SELECT T1.id FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.Description = 'son to Tamora'

Please list the IDs of the paragraphs in which the character " son to Tamora " appears .

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


Question: Among the orders with sales value of no less than 5,000 in west superstore, how many were bought by the customers in California?

SELECT COUNT(DISTINCT T1.`Order ID`) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` INNER JOIN people AS T3 ON T3.`Customer ID` = T1.`Customer ID` WHERE T1.Sales > 5000 AND T3.State = 'California' AND T2.Region = 'West'

Among the orders with sales value of no less than 5,000 in west superstore , how many were bought by the customers in California ?

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


Question: What are the collection subset ids, names, and number of collections for each subset?

SELECT T2.Collection_Subset_ID ,  T1.Collection_Subset_Name ,  count(*) FROM Collection_Subsets AS T1 JOIN Collection_Subset_Members AS T2 ON T1.Collection_Subset_ID =  T2.Collection_Subset_ID GROUP BY T2.Collection_Subset_ID;

What are the collection subset ids , names , and number of collections for each subset ?

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


Question: List the year, location, and name of all paintings that are taller than 1000 in alphabetical order.

SELECT title ,  LOCATION ,  YEAR FROM paintings WHERE height_mm  >  1000 ORDER BY title

List the year , location , and name of all paintings that are taller than 1000 in alphabetical order .

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


Question: Show the name of the competitor id 90991.

SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 90991

Show the name of the competitor i d 90991 .

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


Question: Where is the hometown of Garrett Gerke?

SELECT T2.city FROM member AS T1 INNER JOIN zip_code AS T2 ON T2.zip_code = T1.zip WHERE T1.first_name = 'Garrett' AND T1.last_name = 'Gerke'

Where is the hometown of Garrett Gerke ?


Question: Which brand of root beer has the lowest unit profit available to wholesalers? Indicate the ID of the customer that has the highest number of purchases of the said brand.

SELECT T3.BrandName, T2.CustomerID FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY T3.CurrentRetailPrice - T3.WholesaleCost, COUNT(T1.BrandID) DESC LIMIT 1

Which brand of root beer has the lowest unit profit available to wholesalers ? Indicate the ID of the customer that has the highest number of purchases of the said brand .

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


Question: Show all the locations with at least two cinemas with capacity above 300.

SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2

Show all the locations with at least two cinemas with capacity above 300 .

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


Question: Please list the countries in Latin America & Caribbean with a note on the series code SM.POP.TOTL.

SELECT T1.SHORTNAME, T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Region = 'Latin America & Caribbean' AND T2.Seriescode = 'SM.POP.TOTL'

Please list the countries in Latin America & Caribbean with a note on the series code SM.POP.TOTL .

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


Question: What is the maximum and the minimum sale price?

SELECT max(saleprice) ,  min(saleprice) FROM Book

What is the maximum and the minimum sale price ?


Question: What is the id and name of the employee with the highest salary?

SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1

What is the i d and name of the employee with the highest salary ?

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


Question: What is the card type code with most number of cards?

SELECT card_type_code FROM Customers_cards GROUP BY card_type_code ORDER BY count(*) DESC LIMIT 1

What is the card type code with most number of cards ?

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


Question: Which team has the highest winning rate in year 2000? State the team ID and list down the birth country of it's players.

SELECT DISTINCT T3.tmID, T1.birthCountry FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID INNER JOIN ( SELECT year, tmID FROM Teams WHERE year = 2000 ORDER BY W / (W + L) DESC LIMIT 1 ) AS T3 ON T2.tmID = T3.tmID AND T2.year = T3.year

Which team has the highest winning rate in year 2000 ? State the team ID and list down the birth country of it 's players .

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


Question: How many players bat with their left hands?

SELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id

How many players bat with their left hands ?


Question: What's the percentage of the users who have rated "1" on the movie "When Will I Be Loved"?

SELECT CAST(SUM(CASE WHEN T1.rating_score = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) 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 's the percentage of the users who have rated " 1 " on the movie " When Will I Be Loved " ?

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


Question: report the total number of degrees granted between 1998 and 2002.

SELECT T1.campus ,  sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id  =  T2.campus WHERE T2.year  >=  1998 AND T2.year  <=  2002 GROUP BY T1.campus

report the total number of degrees granted between 1998 and 2002 .

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


Question: What are the ids of the students who are under 20 years old and are involved in at least one activity.

SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age  <  20

What are the ids of the students who are under 20 years old and are involved in at least one activity .

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


Question: Which students that filed for bankruptcy are also in the foreign legion?

SELECT T2.name FROM enlist AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'foreign_legion'

Which students that filed for bankruptcy are also in the foreign legion ?

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


Question: Name the organizations with the most members.

SELECT T1.Name FROM organization AS T1 INNER JOIN isMember AS T2 ON T2.Country = T1.Country INNER JOIN country AS T3 ON T2.Country = T3.Code GROUP BY T1.Name ORDER BY COUNT(T3.Name) DESC LIMIT 1

Name the organizations with the most members .


Question: What is the nationality of the 7th season Purple Cap winner?

SELECT T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Id = 7 AND T1.Purple_Cap IS NOT NULL

What is the nationality of the 7th season Purple Cap winner ?

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


Question: What are the names of the person that were not credited at the end of episode tt0629391?

SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.credited = 'false' AND T1.episode_id = 'tt0629391'

What are the names of the person that were not credited at the end of episode tt0629391 ?

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


Question: Find the number of members of club "Pen and Paper Gaming".

SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Pen and Paper Gaming"

Find the number of members of club " Pen and Paper Gaming " .

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


Question: In "Twelfth Night, Or What You Will", what is the description of the chapter in 2nd scene, Act 2?

SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Twelfth Night, Or What You Will' AND T2.Scene = 2 AND T2.Act = 2

In " Twelfth Night , Or What You Will " , what is the description of the chapter in 2nd scene , Act 2 ?

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


Question: How many pilots who are older than 40 or younger than 30?

SELECT count(pilot_name) FROM pilotskills ORDER BY age  >  40 OR age  <  30

How many pilots who are older than 40 or younger than 30 ?

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


Question: Give the id and product type of the product with the lowest price.

SELECT product_id ,  product_type_code FROM products ORDER BY product_price LIMIT 1

Give the i d and product type of the product with the lowest price .

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


Question: Who is the person that has no friend?

SELECT name FROM person EXCEPT SELECT name FROM PersonFriend


Question: What is the title and purchase price of the book that has the highest total order amount?

SELECT T2.title ,  T2.PurchasePrice FROM Books_Order AS T1 JOIN BOOk AS T2 ON T1.isbn  =  T2.isbn GROUP BY T1.isbn ORDER BY sum(amount) DESC LIMIT 1

What is the title and purchase price of the book that has the highest total order amount ?

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


Question: What is the first and last name of the student participating in the most activities?

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

What is the first and last name of the student participating in the most activities ?

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


Question: Please list the customer names whose order quantity was more than 5 on 6/1/2018.

SELECT T FROM ( SELECT DISTINCT CASE  WHEN SUM(T1.`Order Quantity`) > 5 THEN T2.`Customer Names` END AS T FROM `Sales Orders` T1 INNER JOIN Customers T2 ON T2.CustomerID = T1._CustomerID WHERE T1.OrderDate = '6/1/18' GROUP BY T1._CustomerID ) WHERE T IS NOT NULL

Please list the customer names whose order quantity was more than 5 on 6/1/2018 .

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


Question: What is the title of the animated films that have the shortest length?

SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id ORDER BY T1.length LIMIT 1

What is the title of the animated films that have the shortest length ?

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


Question: Show all date and share count of transactions.

SELECT date_of_transaction ,  share_count FROM TRANSACTIONS

Show all date and share count of transactions .

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


Question: State the name of director for the 'Treehouse of Horror XIX' episode.

SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';

State the name of director for the ' Treehouse of Horror XIX ' episode .

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


Question: Count the number of party events.


Question: Find the total saving balance for each account name.

SELECT sum(T2.balance) ,  T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name

Find the total saving balance for each account name .

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


Question: Find the total credits of courses provided by different department.

SELECT sum(credits) ,  dept_name FROM course GROUP BY dept_name

Find the total credits of courses provided by different department .

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


Question: How many users have joined Yelp since the year 2012?

SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012

How many users have joined Yelp since the year 2012 ?

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


Question: What are the 3 best selling books? Show their titles, author names, and press names.

SELECT t1.name ,  t2.title ,  t3.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id JOIN press AS t3 ON t2.press_id  =  t3.press_id ORDER BY t2.sale_amount DESC LIMIT 3

What are the 3 best selling books ? Show their titles , author names , and press names .

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


Question: Find all the songs that do not have a lead 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  =  "lead"

Find all the songs that do not have a lead vocal .

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


Question: Which clubs are located at "AKW"? Return the club names.

SELECT clubname FROM club WHERE clublocation  =  "AKW"

Which clubs are located at " AKW " ? Return the club names .

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


Question: What are the types of vocals that the musician with the first name "Solveig" played in the song "A Bar in Amsterdam"?

SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.firstname  =  "Solveig" AND T2.title  =  "A Bar In Amsterdam"

What are the types of vocals that the musician with the first name " Solveig " played in the song " A Bar in Amsterdam " ?

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


Question: Provide any four valid Journal ID along with short name and full name of the papers which were made in 2013.

SELECT DISTINCT T2.JournalId, T1.ShortName, T1.FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 2013 AND T2.JournalId != 0 AND T2.JournalId != -1 LIMIT 4

Provide any four valid Journal ID along with short name and full name of the papers which were made in 2013 .

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


Question: What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?

SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"

What are the names of entrepreneurs whose investor is not " Rachel Elnaugh " ?

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


Question: List the store located cities with regions in no water area of California state.

SELECT DISTINCT T2.`City Name` FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.State = 'California' AND T2.`Water Area` = '0'

List the store located cities with regions in no water area of California state .

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


Question: What are the ids and names for each of the documents?

SELECT document_id ,  document_name FROM Documents

What are the ids and names for each of the documents ?


Question: Describe the condition of patient Wilmer Koepp.

SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Wilmer' AND T1.last = 'Koepp'

Describe the condition of patient Wilmer Koepp .

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


Question: What is the average number of stars for businesses in the Obstetricians & Gynecologists category?

SELECT CAST(SUM(T1.stars) AS REAL) / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Obstetricians & Gynecologists'

What is the average number of stars for businesses in the Obstetricians & Gynecologists category ?

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


Question: On average, how much did the Student_Club spend on food for the typical event in the past?

SELECT SUM(spent) / COUNT(spent) FROM budget WHERE category = 'Food' AND event_status = 'Closed'

On average , how much did the Student_Club spend on food for the typical event in the past ?

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


Question: How many words has the appearance times greater than 10?

SELECT COUNT(w1st) AS countwords FROM biwords WHERE occurrences > 10

How many words has the appearance times greater than 10 ?


Question: What's the number of infant mortality in Switzerland in a year?

SELECT T2.Infant_Mortality * T1.Population * T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland'

What 's the number of infant mortality in Switzerland in a year ?

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


Question: How many orders have each order status code?

SELECT order_status_code ,  count(*) FROM Customer_orders GROUP BY order_status_code

How many orders have each order status code ?


Question: What is the shipping agent code of shipping agent UPS?

SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS";

What is the shipping agent code of shipping agent UPS ?

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


Question: What's the profit for the Freewheel?

SELECT T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Freewheel'


Question: What are the first names of all students taking accoutning and Computer Information Systems classes?

SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code JOIN course AS T4 ON T3.crs_code  =  T4.crs_code JOIN department AS T5 ON T5.dept_code  =  T4.dept_code WHERE T5.dept_name  =  'Computer Info. Systems'

What are the first names of all students taking accoutning and Computer Information Systems classes ?

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


Question: Show all track names that have had no races.

SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)

Show all track names that have had no races .


Question: What is the name of the person who has the oldest average age for their friends, and what is that average age?

SELECT T2.name ,  avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1

What is the name of the person who has the oldest average age for their friends , and what is that average age ?

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


Question: What are the teams that played in a match with the point of winning margin of 38 on April 30, 2009?

SELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 WHERE T2.win_margin = 38 AND match_date = '2009-04-30'

What are the teams that played in a match with the point of winning margin of 38 on April 30 , 2009 ?

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


Question: What are the awards won by the coach who coached the team with the most number of victories of all time? Indicate the choach ID.

SELECT DISTINCT T2.coachID, T1.award FROM AwardsCoaches AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID GROUP BY T2.coachID, T1.award ORDER BY SUM(T2.w) DESC LIMIT 1

What are the awards won by the coach who coached the team with the most number of victories of all time ? Indicate the choach ID .

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


Question: How many football players born after the 1990s have the first name "Aaron"?

SELECT COUNT(id) FROM Player WHERE birthday > '1990' AND player_name LIKE 'Aaron%'

How many football players born after the 1990s have the first name " Aaron " ?

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


Question: What is the highest level of job to get to for the employee who got hired the earliest?

SELECT T2.max_lvl FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.hire_date LIMIT 1

What is the highest level of job to get to for the employee who got hired the earliest ?

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


Question: What are first names of the artists with oil paintings in gallery 241?

SELECT DISTINCT T1.fname FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID  =  T2.painterID WHERE T2.medium  =  "oil" AND LOCATION  =  "Gallery 241"

What are first names of the artists with oil paintings in gallery 241 ?

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


Question: Show all role codes and the number of employees in each role.

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

Show all role codes and the number of employees in each role .

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


Question: State all the district that Benjamin Contee has served before.

SELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T1.last_name = 'Contee'

State all the district that Benjamin Contee has served before .

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


Question: How many papers does Mckeown , Kathleen cite ?

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

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


Question: How many atoms belong to molecule id TR001?

SELECT COUNT(T.atom_id) FROM atom AS T WHERE T.molecule_id = 'TR001'

How many atoms belong to molecule i d TR001 ?

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


Question: Which customer have the most policies? Give me the customer details.

SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1

Which customer have the most policies ? Give me the customer details .

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


Question: What is minimum hours of the students playing in different position?

SELECT min(T2.HS) ,   T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID GROUP BY T1.pPos

What is minimum hours of the students playing in different position ?


Question: How many more "buffets" than "gyms" in Yelp business?

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

How many more " buffets " than " gyms " in Yelp business ?

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


Question: For each type of food, tell me how many customers have ever bought it.

SELECT T1.food ,  count(DISTINCT T3.CustomerId) FROM goods AS T1 JOIN items AS T2 ON T1.Id  =  T2.Item JOIN receipts AS T3 ON T2.Receipt  =  T3.ReceiptNumber GROUP BY T1.food

For each type of food , tell me how many customers have ever bought it .

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


Question: What are the names of the directors who made exactly one movie?

SELECT director FROM Movie GROUP BY director HAVING count(*)  =  1

What are the names of the directors who made exactly one movie ?


Question: What are the products that are supplied by Aux joyeux ecclsiastiques?

SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Aux joyeux ecclsiastiques'

What are the products that are supplied by Aux joyeux ecclsiastiques ?

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


Question: Give the cities and district names that belong to the country with Hajastan as its local name.

SELECT T2.Name, T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LocalName = 'Hajastan'

Give the cities and district names that belong to the country with Hajastan as its local name .

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


Question: How many games has each stadium held?

SELECT T1.id ,  count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id  =  T2.stadium_id GROUP BY T1.id


Question: Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.

SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Louisville ,  Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id  =  T2.branch_id JOIN member AS T3 ON T1.member_id  =  T3.member_id WHERE T3.Hometown  =  'Hiram ,  Georgia'

Find the name of branches where have some members whose hometown is in Louisville , Kentucky and some in Hiram , Georgia .

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


Question: List all the distinct president votes and the vice president votes.

SELECT DISTINCT President_Vote ,  VICE_President_Vote FROM VOTING_RECORD

List all the distinct president votes and the vice president votes .

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


Question: What is the percentage of students who get a "B" in the course "Computer Network"?

SELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network'

What is the percentage of students who get a " B " in the course " Computer Network " ?

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


Question: Which team has the most Swedish?

SELECT T.TEAM FROM ( SELECT T2.TEAM, COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.nation = 'Sweden' GROUP BY T2.TEAM ORDER BY COUNT(DISTINCT T1.ELITEID) DESC LIMIT 1 ) AS T


Question: What is the average number of pages in the books written by Jennifer Crusie?

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

What is the average number of pages in the books written by Jennifer Crusie ?

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


Question: What is the total amount of money spent for food?

SELECT SUM(spent) FROM budget WHERE category = 'Food'

What is the total amount of money spent for food ?


Question: How many times did Keven Kuhn receive DTaP immunization?

SELECT COUNT(T2.CODE) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.DESCRIPTION = 'DTaP'

How many times did Keven Kuhn receive DTaP immunization ?

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


Question: What are the names and data types of the characteristics of the 'cumin' product?

SELECT t3.characteristic_name ,  t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id  =  t3.characteristic_id WHERE t1.product_name  =  "cumin"

What are the names and data types of the characteristics of the ' cumin ' product ?

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


Question: How many students got accepted after the tryout?

SELECT count(*) FROM tryout WHERE decision  =  'yes'

How many students got accepted after the tryout ?


Question: Which year had the most released films?

SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1

Which year had the most released films ?


Question: Tell the resultant wind speed of station no.9 on 2014/1/15.

SELECT resultspeed FROM weather WHERE `date` = '2014-01-15' AND station_nbr = 9

Tell the resultant wind speed of station no.9 on 2014/1/15 .

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


Question: What is the name of the city furthest to Boston?

SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code  =  T2.city_code JOIN City AS T3 ON T1.city2_code  =  T3.city_code WHERE T2.city_name  =  "Boston" ORDER BY distance DESC LIMIT 1

What is the name of the city furthest to Boston ?


Question: What information is there on albums from 2010?

SELECT * FROM Albums WHERE YEAR  =  2010

What information is there on albums from 2010 ?


Question: Among the students that have a payment due, how many students are unemployed?

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

Among the students that have a payment due , how many students are unemployed ?

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


Question: Who advises student 1004?

SELECT Advisor FROM Student WHERE StuID  =  1004


Question: List the name and number of followers for each user, and sort the results by the number of followers in descending order.

SELECT name ,  followers FROM user_profiles ORDER BY followers DESC

List the name and number of followers for each user , and sort the results by the number of followers in descending order .

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


Question: List the dates of the orders which were placed at the earliest time or have more than 1 items.

SELECT min(date_order_placed) FROM Orders UNION SELECT T1.date_order_placed FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >  1

List the dates of the orders which were placed at the earliest time or have more than 1 items .

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


Question: For each manufacturer name, what are the names and prices of their most expensive product?

SELECT T1.Name ,  max(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name

For each manufacturer name , what are the names and prices of their most expensive product ?

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


Question: What college offers the major that Tyler Hewitt took?

SELECT T2.college FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Tyler' AND T1.last_name = 'Hewitt'

What college offers the major that Tyler Hewitt took ?

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


Question: List down the states in 2011 with a national sector average of 20 and below.

SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.year = 2011 AND T1.awards_per_natl_value <= 20

List down the states in 2011 with a national sector average of 20 and below .

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


Question: Return the location of the hangar in which F-14 Fighter is located.

SELECT LOCATION FROM hangar WHERE plane_name  =  'F-14 Fighter'

Return the location of the hangar in which F-14 Fighter is located .

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


Question: How many female athletes are from the Philippines?

SELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Philippines' AND T3.gender = 'F'

How many female athletes are from the Philippines ?


Question: How many times did Valencia's home team win in the LaLiga division?

SELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H'

How many times did Valencia 's home team win in the LaLiga division ?

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


Question: Which major has least number of students? List the major and the number of students.

SELECT Major ,  count(*) FROM Student GROUP BY Major ORDER BY count(Major) ASC LIMIT 1;

Which major has least number of students ? List the major and the number of students .

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


Question: Compute the average amount of student loans.

SELECT avg(amount_of_loan) FROM Student_Loans

Compute the average amount of student loans .

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


Question: How many overs were there in the first innings of match ID "335996"?

SELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1

How many overs were there in the first innings of match ID " 335996 " ?

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


Question: How many courses have more than 2 credits?

SELECT count(*) FROM COURSE WHERE Credits  >  2

How many courses have more than 2 credits ?


Question: What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ?

SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"

What are the distinct reigns of wrestlers whose location is not " Tokyo , Japan " ?

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


Question: In total, all the students in the 3rd year of their program are advised by how many professors?

SELECT COUNT(DISTINCT T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_3'

In total , all the students in the 3rd year of their program are advised by how many professors ?

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


Question: From 2012 to 2015, how many complaints were submitted via email from female clients?

SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2012' AND '2015' AND T2.`Submitted via` = 'Email' AND T1.sex = 'Male'

From 2012 to 2015 , how many complaints were submitted via email from female clients ?

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


Question: List the name of playlist which has number of tracks greater than 100.

SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id)  >  100;

List the name of playlist which has number of tracks greater than 100 .

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


Question: What is the shipping cost for order number 10692 from the company Alfreds Futterkiste?

SELECT T2.Freight FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.OrderID = 10692 AND T1.CompanyName = 'Alfreds Futterkiste'

What is the shipping cost for order number 10692 from the company Alfreds Futterkiste ?

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


Question: What is the percentage of female patient were born after 1930?

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

What is the percentage of female patient were born after 1930 ?

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


Question: What are the ids of the paintings whose height is longer than the height of all paintings created after 1900?

SELECT paintingID FROM paintings WHERE height_mm  >   (SELECT max(height_mm) FROM paintings WHERE YEAR  >  1900)

What are the ids of the paintings whose height is longer than the height of all paintings created after 1900 ?

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


Question: What is the average score of all universities in 2012?

SELECT AVG(score) FROM university_ranking_year WHERE year = 2012

What is the average score of all universities in 2012 ?

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


Question: How many 10-year old athletes participated in the Gymnastics Men's Parallel Bars, Teams event?

SELECT COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id WHERE T3.event_name LIKE 'Gymnastics Men%s Parallel Bars, Teams' AND T2.age = 10

How many 10 - year old athletes participated in the Gymnastics Men 's Parallel Bars , Teams event ?

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


Question: How many professors do have a Ph.D. degree?

SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'

How many professors do have a Ph.D. degree ?


Question: What are the engine types that are used by two or more drivers?

SELECT Engine FROM driver GROUP BY Engine HAVING COUNT(*)  >=  2

What are the engine types that are used by two or more drivers ?

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


Question: List the full names, religions, and parties of legislators who have served in Maine.

SELECT T1.official_full_name, T2.relation, T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'ME' GROUP BY T1.official_full_name, T2.relation, T2.party

List the full names , religions , and parties of legislators who have served in Maine .

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


Question: List the full name of all past legislators that chose Pro-Administration as their political party in year 1791.

SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Pro-Administration' AND CAST(T2.start AS DATE) <= 1791 AND CAST(T2.END AS DATE) >= 1791

List the full name of all past legislators that chose Pro - Administration as their political party in year 1791 .

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


Question: How many stars on average does the episode Lost Verizon have?

SELECT CAST(SUM(T2.votes * T2.stars) AS REAL) / SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon';

How many stars on average does the episode Lost Verizon have ?

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


Question: What are the receipt numbers for which either an apple flavor pie was purchased or the customer with id 12 shopped?

SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.flavor  =  "Apple" AND T2.food  =  "Pie" UNION SELECT ReceiptNumber FROM receipts WHERE CustomerId  =  12

What are the receipt numbers for which either an apple flavor pie was purchased or the customer with i d 12 shopped ?

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


Question: List the name and country of the players who got more than average catches in ascending order of the number of catches.

SELECT T1.Player_Name, T4.Country_Name FROM Player AS T1 INNER JOIN Wicket_Taken AS T2 ON T1.Player_Id = T2.Fielders INNER JOIN Out_Type AS T3 ON T2.Kind_Out = T3.Out_Id INNER JOIN Country AS T4 ON T1.Country_Name = T4.Country_Id GROUP BY T1.Player_Name ORDER BY COUNT(T3.Out_Name) ASC

List the name and country of the players who got more than average catches in ascending order of the number of catches .

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


Question: How many athletes are from Australia?

SELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Australia'


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

SELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Widowed' AND age < 50

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

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


Question: What is the full name of the customers who live in Baiyin city?

SELECT T3.first_name, T3.last_name FROM address AS T1 INNER JOIN customer_address AS T2 ON T1.address_id = T2.address_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T1.city = 'Baiyin'

What is the full name of the customers who live in Baiyin city ?

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


Question: Name the goalies who have played more than total of 5000 minutes in the all the season played. State given name of the player and from which country was he born.

SELECT DISTINCT T1.nameGiven, T1.birthCountry FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T1.nameGiven, T1.birthCountry HAVING SUM(T2.Min) > 5000

Name the goalies who have played more than total of 5000 minutes in the all the season played . State given name of the player and from which country was he born .

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


Question: What is the device model used by the most female users over 30?

SELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 30 AND T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 1

What is the device model used by the most female users over 30 ?

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


Question: Count the total number of available customers and services details.

SELECT count(DISTINCT customers_and_services_details) FROM customers_and_services

Count the total number of available customers and services details .

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


Question: Write down bond id for molecules that are carcinogenic.

SELECT DISTINCT T1.bond_id FROM bond AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'

Write down bond i d for molecules that are carcinogenic .

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


Question: What is the employee of company number 1's full name?

SELECT FirstName, MiddleName, LastName FROM Person WHERE BusinessEntityID = 1 AND PersonType = 'EM'

What is the employee of company number 1 's full name ?


Question: What was the venue and year with the most publications?

SELECT venue ,  YEAR FROM paper GROUP BY venue ,  YEAR ORDER BY count(*) DESC LIMIT 1

What was the venue and year with the most publications ?


Question: What are the episodes Oscar Cervantes is credited with?

SELECT episode_id FROM Credit WHERE person = 'Oscar Cervantes' AND credited = 'true';

What are the episodes Oscar Cervantes is credited with ?

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


Question: What is the average number of passengers carried via air transport per year by Bulgaria between 1970 to 1980? Indicate the country's system of trade.

SELECT AVG(T1.Value), T2.SystemOfTrade FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Air transport, passengers carried' AND T1.Year >= 1970 AND T1.Year < 1981 AND T1.CountryName = 'Bulgaria'

What is the average number of passengers carried via air transport per year by Bulgaria between 1970 to 1980 ? Indicate the country 's system of trade .

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


Question: State the royalty percentage for the most year to date sale title within the 20000 range.

SELECT MAX(T1.ytd_sales) FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 20000 AND T2.hirange < 20000

State the royalty percentage for the most year to date sale title within the 20000 range .

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


Question: What is the FBI description of the crime for report number 23778?

SELECT T1.description FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.report_no = 23843

What is the FBI description of the crime for report number 23778 ?

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


Question: Which game has the most sales in Japan?

SELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1

Which game has the most sales in Japan ?


Question: What is the most distinct rated movie with a running time of 0?

SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime = 0 AND T2.rating = ( SELECT MAX(rating) FROM u2base )

What is the most distinct rated movie with a running time of 0 ?

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


Question: List out the account numbers of clients who are youngest and have highest average salary?

SELECT T1.account_id  FROM account AS T1 INNER JOIN disp AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.client_id = T3.client_id INNER JOIN district AS T4 on T4.district_id = T1.district_id WHERE T2.client_id = ( SELECT client_id FROM client ORDER BY birth_date DESC LIMIT 1) GROUP BY T4.A11, T1.account_id

List out the account numbers of clients who are youngest and have highest average salary ?

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


Question: The highest Systolic Blood Pressure was observed in which patient? Please give his or her full name.

SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.VALUE = ( SELECT MAX(VALUE) FROM observations WHERE description = 'Systolic Blood Pressure' ) LIMIT 1

The highest Systolic Blood Pressure was observed in which patient ? Please give his or her full name .

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


Question: Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.

SELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T1.votes BETWEEN 950 AND 960;

Among the episodes aired in 2008 with votes ranges from 920 to 950 , list their percent .

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


Question: How many XML format does the github address "https://github.com/dogeth/vss2git.git" have?

SELECT COUNT(T3.CommentIsXml) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/dogeth/vss2git.git' AND T3.CommentIsXml = 1

How many XML format does the github address " https://github.com/dogeth/vss2git.git " have ?


Question: What is the joined year of the pilot of the highest rank?

SELECT Join_Year FROM pilot ORDER BY Rank ASC LIMIT 1

What is the joined year of the pilot of the highest rank ?

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


Question: Calculate the average of authors for each paper from the year of 1990 to 2000.

SELECT CAST(COUNT(DISTINCT T2.AuthorId) AS REAL) / COUNT(DISTINCT T1.Title) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year BETWEEN 1990 AND 2000

Calculate the average of authors for each paper from the year of 1990 to 2000 .

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


Question: What is the language ID of the movie "Walk the Line"?

SELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Walk the Line'

What is the language ID of the movie " Walk the Line " ?

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


Question: What are the top 10 oldest movies and what are the average rating score for each movie? Indicate the name of the director and when the movies were released.

SELECT T2.movie_id, AVG(T1.rating_score), T2.director_name, T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.rating_timestamp_utc ASC LIMIT 10

What are the top 10 oldest movies and what are the average rating score for each movie ? Indicate the name of the director and when the movies were released .

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


Question: What are the names of the storms that affected Denmark?

SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id  =  T2.region_id JOIN storm AS T3 ON T1.storm_id  =  T3.storm_id WHERE T2.region_name  =  'Denmark'

What are the names of the storms that affected Denmark ?

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


Question: Which services are both used by the customer "Hardy Kutch" and are rated as "bad" in a customer interaction? Give me the service details.

SELECT DISTINCT t3.service_details FROM customers AS t1 JOIN customers_and_services AS t2 ON t1.customer_id  =  t2.customer_id JOIN services AS t3 ON t2.service_id  =  t3.service_id JOIN customer_interactions AS t4 ON t3.service_id  =  t4.service_id WHERE t1.customer_details  =  "Hardy Kutch" AND t4.services_and_channels_details  =  "bad"

Which services are both used by the customer " Hardy Kutch " and are rated as " bad " in a customer interaction ? Give me the service details .

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


Question: How many times has SR Watson been named 'Man of the Match'?

SELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id

How many times has SR Watson been named ' Man of the Match ' ?

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


Question: Jill ranked which medium-quality class product as the highest, and how long will it take the company to manufacture such a product?

SELECT T1.DaysToManufacture FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Rating = 5 AND T1.Class = 'M' ORDER BY T2.Rating LIMIT 1

Jill ranked which medium - quality class product as the highest , and how long will it take the company to manufacture such a product ?

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


Question: What is the disease name of the patient who has the highest level of triglyceride within the normal range?

SELECT T1.Diagnosis FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG < 200 ORDER BY T2.TG DESC LIMIT 1

What is the disease name of the patient who has the highest level of triglyceride within the normal range ?


Question: What is the age of the youngest female user of the app?

SELECT MIN(age) FROM gender_age WHERE gender = 'F'

What is the age of the youngest female user of the app ?


Question: Return the names of teams that have no match season record.

SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season)

Return the names of teams that have no match season record .

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


Question: List out the product name of order which has unit cost of 781.22.

SELECT T FROM ( SELECT DISTINCT IIF(T1.`Unit Cost` = 781.22, T2.`Product Name`, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL

List out the product name of order which has unit cost of 781.22 .

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


Question: How many cards did Volkan BaÇµa illustrated whose foreign language is in French?

SELECT COUNT(T3.id) FROM ( SELECT T1.id FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Volkan Baǵa' AND T2.language = 'French' GROUP BY T1.id ) AS T3

How many cards did Volkan BaÇµa illustrated whose foreign language is in French ?

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


Question: Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.

SELECT DISTINCT Name FROM WINE WHERE Price  >  (SELECT min(Price) FROM wine WHERE Winery  =  "John Anthony")

Find the distinct names of all wines that have prices higher than some wines from John Anthony winery .

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


Question: What are the 3 most common cloud covers in the zip code of 94107?

SELECT cloud_cover FROM weather WHERE zip_code  =  94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3

What are the 3 most common cloud covers in the zip code of 94107 ?

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


Question: What are all the different start station names for a trip that lasted less than 100?

SELECT DISTINCT start_station_name FROM trip WHERE duration  <  100

What are all the different start station names for a trip that lasted less than 100 ?

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


Question: How many movies directed by Felipe Cazals was realeased on 1976?

SELECT COUNT(movie_id) FROM movies WHERE movie_release_year = 1976 AND director_name LIKE 'Felipe Cazals'

How many movies directed by Felipe Cazals was realeased on 1976 ?

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


Question: Find the names of all reviewers who have ratings with a NULL value for the date.

SELECT DISTINCT name FROM Reviewer AS T1 JOIN Rating AS T2 ON T1.rID  =  T2.rID WHERE ratingDate  =  "null"

Find the names of all reviewers who have ratings with a NULL value for the date .

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


Question: What is the average weight of the players who have won the award of Rookie of the year?

SELECT AVG(T1.weight) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year'

What is the average weight of the players who have won the award of Rookie of the year ?

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


Question: What is the description for staff role code HR?

SELECT staff_role_description FROM Ref_staff_roles WHERE staff_role_code  =  "HR"

What is the description for staff role code HR ?

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


Question: Which game type has least number of games?

SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1

Which game type has least number of games ?


Question: List the paper title and journal ID which were published under the conference name of "International Symposium of Robotics Research".

SELECT DISTINCT T2.Title, T2.JournalId FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'International Symposium of Robotics Research' AND T2.Year = 2003

List the paper title and journal ID which were published under the conference name of " International Symposium of Robotics Research " .

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


Question: Find the average price of wines that are not produced from Sonoma county.

SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.County  =  'Sonoma')

Find the average price of wines that are not produced from Sonoma county .

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


Question: What is the count of documents owned by Marlin?

SELECT count(*) FROM Document_Objects WHERE OWNER = "Marlin";

What is the count of documents owned by Marlin ?


Question: How many transaction does each account have? Show the number and account id.

SELECT count(*) ,  account_id FROM Financial_transactions

How many transaction does each account have ? Show the number and account i d.

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


Question: Provide the names of the students enlisted in the fire department.

SELECT name FROM enlist WHERE organ = 'fire_department'

Provide the names of the students enlisted in the fire department .

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


Question: Display the first name and department name for each employee.

SELECT T1.first_name ,  T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id

Display the first name and department name for each employee .

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


Question: What is the maximum number of stories of buildings not completed in 1980?

SELECT max(Number_of_Stories) FROM building WHERE Completed_Year != "1980"

What is the maximum number of stories of buildings not completed in 1980 ?

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


Question: Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees.

SELECT LOCATION FROM performance WHERE Attendance  >  2000 INTERSECT SELECT LOCATION FROM performance WHERE Attendance  <  1000

Show the locations that have both performances with more than 2000 attendees and performances with less than 1000 attendees .

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


Question: What are the distinct names of wines that have appellations in the North Coast area?

SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation  =  T2.Appelation WHERE T1.Area  =  "North Coast"

What are the distinct names of wines that have appellations in the North Coast area ?

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


Question: List all countries of markets in ascending alphabetical order.

SELECT Country FROM market ORDER BY Country ASC

List all countries of markets in ascending alphabetical order .


Question: Give the customer id of the customer that made the most purchases, as well as the number of purchases made.

SELECT CustomerId ,  count(*) FROM receipts GROUP BY CustomerId ORDER BY count(*) DESC LIMIT 1

Give the customer i d of the customer that made the most purchases , as well as the number of purchases made .

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


Question: What is the longitude and latitude for the district represented by Grayson Alan?

SELECT T1.latitude, T1.longitude FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Grayson' AND T3.last_name = 'Alan'

What is the longitude and latitude for the district represented by Grayson Alan ?

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


Question: Find the cities corresponding to employees who help customers with the postal code 70174.

SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"

Find the cities corresponding to employees who help customers with the postal code 70174 .

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


Question: Return the unique names of sailors who are older than any sailors whose rating is larger than 7.

SELECT DISTINCT name FROM Sailors WHERE age  >  (SELECT min(age) FROM Sailors WHERE rating  >  7);

Return the unique names of sailors who are older than any sailors whose rating is larger than 7 .

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


Question: Who is the publisher of the game 2002 FIFA World Cup?

SELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id WHERE T3.game_name = '2002 FIFA World Cup'

Who is the publisher of the game 2002 FIFA World Cup ?

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


Question: Find the names of the swimmers who have both "win" and "loss" results in the record.

SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id  =  t2.swimmer_id WHERE RESULT  =  'Loss'

Find the names of the swimmers who have both " win " and " loss " results in the record .

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


Question: What are the names of all races held after 2000 in Spain?

SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000

What are the names of all races held after 2000 in Spain ?

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


Question: Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons?

SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10

Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons ?

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


Question: What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?

SELECT T1.driverid ,  T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION  =  '1' GROUP BY T1.driverid HAVING count(*)  >=  2

What is the i d , forname and surname of the driver who had the first position in terms of laptime at least twice ?

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


Question: Show the name, average attendance, total attendance for stadiums where no accidents happened.

SELECT name ,  average_attendance ,  total_attendance FROM stadium EXCEPT SELECT T2.name ,  T2.average_attendance ,  T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id

Show the name , average attendance , total attendance for stadiums where no accidents happened .

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


Question: List down at least five superpowers of male superheroes.

SELECT T3.power_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T3.id = T2.power_id INNER JOIN gender AS T4 ON T4.id = T1.gender_id WHERE T4.gender = 'Male' LIMIT 5

List down at least five superpowers of male superheroes .


Question: What is the word that occurs the most in the Catalan language?

SELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words )

What is the word that occurs the most in the Catalan language ?


Question: What is the brand of truck used in shipment id 1011?

SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011'

What is the brand of truck used in shipment i d 1011 ?

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


Question: What is the composer who created the track "Fast As a Shark"?

SELECT composer FROM tracks WHERE name = "Fast As a Shark";

What is the composer who created the track " Fast As a Shark " ?

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


Question: How many films are there in each category? List the genre name, genre id and the count.

SELECT T2.name ,  T1.category_id ,  count(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id  =  T2.category_id GROUP BY T1.category_id

How many films are there in each category ? List the genre name , genre i d and the count .

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


Question: List the painting id, location and title of the medium oil paintings ordered by year.

SELECT paintingID ,  title ,  LOCATION FROM paintings WHERE medium  =  "oil" ORDER BY YEAR

List the painting i d , location and title of the medium oil paintings ordered by year .

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


Question: How many cities are in Canada?

SELECT count(*) FROM City WHERE country  =  "CANADA"


Question: Find the number of distinct room types available.

SELECT count(DISTINCT roomtype) FROM room

Find the number of distinct room types available .


Question: What are the attributes that business number 56 have?

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

What are the attributes that business number 56 have ?


Question: What are the Facebook, Twitter and YouTube usernames of Adam Kinzinger?

SELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Adam Kinzinger'

What are the Facebook , Twitter and YouTube usernames of Adam Kinzinger ?

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


Question: Please list all of the episodes that aired in 2008 that have the highest number of votes for the maximum star rating.

SELECT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' ORDER BY T2.votes DESC LIMIT 1;

Please list all of the episodes that aired in 2008 that have the highest number of votes for the maximum star rating .

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


Question: What was the medal that Coleen Dufresne got?

SELECT T4.medal_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Coleen Dufresne (-Stewner)'

What was the medal that Coleen Dufresne got ?

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


Question: Which students are advised by Michael Goodrich? Give me their first and last names.

SELECT T2.fname ,  T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID  =  T2.advisor WHERE T1.fname  =  "Michael" AND T1.lname  =  "Goodrich"

Which students are advised by Michael Goodrich ? Give me their first and last names .

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


Question: Among the store contact employees, how many of them have a Vista credit card?

SELECT COUNT(T1.FirstName) 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.CardType = 'Vista' AND T1.PersonType = 'SC'

Among the store contact employees , how many of them have a Vista credit card ?

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


Question: Which school district was Future Einsteins Of America project located at?

SELECT T1.school_district FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Future Einsteins Of America'

Which school district was Future Einsteins Of America project located at ?

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


Question: Find the city with post code 255.

SELECT city FROM addresses WHERE zip_postcode  =  255

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


Question: What are the different dorm amenity names in alphabetical order?

SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name

What are the different dorm amenity names in alphabetical order ?

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


Question: Please show the email addresses of students and the dates of their answers in descending order of dates.

SELECT T2.Email_Adress ,  T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID ORDER BY T1.Date_of_Answer DESC

Please show the email addresses of students and the dates of their answers in descending order of dates .

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


Question: How many architects are female?

SELECT count(*) FROM architect WHERE gender  =  'female'


Question: What is the total number of clubs?


Question: List the name of a building along with the name of a company whose office is in the building.

SELECT T3.name ,  T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id  =  T2.id JOIN Companies AS T3 ON T1.company_id  =  T3.id

List the name of a building along with the name of a company whose office is in the building .

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


Question: What are the first names and office of the professors who are in the history department and have a Ph.D?

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

What are the first names and office of the professors who are in the history department and have a Ph . D ?

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


Question: What is the title of the album that was released by the artist whose name has the phrase 'Led'?

SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'

What is the title of the album that was released by the artist whose name has the phrase ' Led ' ?

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


Question: Find the rank of the faculty that the fewest faculties belong to.

SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1

Find the rank of the faculty that the fewest faculties belong to .


Question: For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.

SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade

For each grade , report the grade , the number of classrooms in which it is taught and the total number of students in the grade .

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


Question: What are the first names of all students who took ACCT-211 and received a C?

SELECT T3.stu_fname FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T2.stu_num  =  T3.stu_num WHERE T1.crs_code  =  'ACCT-211' AND T2.enroll_grade  =  'C'

What are the first names of all students who took ACCT-211 and received a C ?

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


Question: Which are the cases where the subject are female. List the case number, subject status and weapon.

SELECT T1.case_number, T1.subject_statuses, T1.subject_weapon FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'

Which are the cases where the subject are female . List the case number , subject status and weapon .

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


Question: How many different countries are players from?

SELECT COUNT (DISTINCT Country) FROM player

How many different countries are players from ?


Question: Find the name of dorms that do not have any amenity

SELECT dorm_name FROM dorm WHERE dormid NOT IN (SELECT dormid FROM has_amenity)

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


Question: Which address has both members younger than 30 and members older than 40?

SELECT address FROM member WHERE age  <  30 INTERSECT SELECT address FROM member WHERE age  >  40

Which address has both members younger than 30 and members older than 40 ?

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


Question: Which papers have the substring "Database" in their titles? Show the titles of the papers.

SELECT title FROM papers WHERE title LIKE "%Database%"

Which papers have the substring " Database " in their titles ? Show the titles of the papers .

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


Question: How many percent of 'Gold' cards were issued prior to 1998?

SELECT CAST(SUM(type = 'gold' AND STRFTIME('%Y', issued) < '1998') AS REAL) * 100 / COUNT(card_id) FROM card

How many percent of ' Gold ' cards were issued prior to 1998 ?

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


Question: Which project in Brooklyn that have the highest request of resources? State the the project ID including all of the name of item requested.

SELECT T1.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_city LIKE 'Brooklyn' GROUP BY T1.item_name ORDER BY COUNT(T1.item_name) DESC LIMIT 1

Which project in Brooklyn that have the highest request of resources ? State the the project ID including all of the name of item requested .

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


Question: What are the countries for each market, ordered alphabetically?

SELECT Country FROM market ORDER BY Country ASC

What are the countries for each market , ordered alphabetically ?


Question: Which country is Mountain Cerro Chirripo located in? Give the full name of the country.

SELECT DISTINCT T1.Name FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T2.Mountain = 'Cerro Chirripo'

Which country is Mountain Cerro Chirripo located in ? Give the full name of the country .

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


Question: How many trips made by a subscriber started in August, 2013 from a station that can hold more than 20 bikes?

SELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T1.id = T2.start_station_id WHERE T2.subscription_type = 'Subscriber' AND T2.start_date LIKE '8/%/2013%' AND T1.dock_count > 20

How many trips made by a subscriber started in August , 2013 from a station that can hold more than 20 bikes ?

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


Question: What details do we have on the students who registered for courses most recently?

SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1

What details do we have on the students who registered for courses most recently ?

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


Question: How many books are there for each publisher?

SELECT publisher ,  count(*) FROM book_club GROUP BY publisher

How many books are there for each publisher ?


Question: What is the name of the organization which most of the students are enlisted in?

SELECT organ FROM ( SELECT organ, COUNT(organ) AS num FROM enlist GROUP BY organ ) T ORDER BY T.num DESC LIMIT 1

What is the name of the organization which most of the students are enlisted in ?

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


Question: Calculate the total points scored by team ID ANA and list down the coashes of the team.

SELECT SUM(T2.Pts), T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T2.tmID = T1.tmID WHERE T2.tmID = 'ANA' GROUP BY T1.coachID

Calculate the total points scored by team ID ANA and list down the coashes of the team .

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


Question: What are the names of wrestlers who have never been eliminated?

SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)

What are the names of wrestlers who have never been eliminated ?

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


Question: How many employees have obtained a doctorate?

SELECT COUNT(EmployeeID) FROM Employees WHERE TitleOfCourtesy = 'Dr.'

How many employees have obtained a doctorate ?


Question: Find the number of books that are sold more than 1000 for each publisher. List the press name as well.

SELECT count(*) ,  t2.name FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id WHERE sale_amount  >  1000 GROUP BY t2.name

Find the number of books that are sold more than 1000 for each publisher . List the press name as well .

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


Question: What are the names of the songs that have a lower rating than at least one blues song?

SELECT song_name FROM song WHERE rating  <  (SELECT max(rating) FROM song WHERE genre_is  =  "blues")

What are the names of the songs that have a lower rating than at least one blues song ?

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


Question: What is all the information about the unrated movies?

SELECT * FROM movies WHERE rating  =  'null'

What is all the information about the unrated movies ?


Question: Which category does the app id No.894384172610331000 belong to?

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

Which category does the app i d No.894384172610331000 belong to ?

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


Question: List ID, sex and date of birth of patient whose total protein (TP) below the lower range of the normal index.

SELECT DISTINCT T1.ID, T1.SEX, T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TP < 6.0

List ID , sex and date of birth of patient whose total protein ( TP ) below the lower range of the normal index .

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


Question: Please show the names of drivers and the number of races they participate in.

SELECT T1.Driver_Name ,  COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID GROUP BY T1.Driver_ID

Please show the names of drivers and the number of races they participate in .

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


Question: What is the full name of the team that the 'NBA Coach of the Year' 1992 winner coached?

SELECT name FROM teams AS T1 INNER JOIN coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN awards_coaches AS T3 ON T2.coachID = T3.coachID AND T2.year = T3.year WHERE T3.year = 1992 AND award = 'NBA Coach of the Year'

What is the full name of the team that the ' NBA Coach of the Year ' 1992 winner coached ?

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


Question: What are the locations of all the gas stations ordered by opening year?

SELECT LOCATION FROM gas_station ORDER BY open_year

What are the locations of all the gas stations ordered by opening year ?

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


Question: How many deli in Belmont have a review rating of 2 or more?

SELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'

How many deli in Belmont have a review rating of 2 or more ?

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


Question: What is the age gap between the youngest and oldest patient with a normal triglyceride recorded?

SELECT STRFTIME('%Y', MAX(T1.Birthday)) - STRFTIME('%Y', MIN(T1.Birthday)) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.TG >= 200

What is the age gap between the youngest and oldest patient with a normal triglyceride recorded ?


Question: How many players are older than Gurkeerat Singh player?

SELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh'

How many players are older than Gurkeerat Singh player ?

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


Question: What is the total number of professors with a Ph.D. ?

SELECT count(*) FROM professor WHERE prof_high_degree  =  'Ph.D.'


Question: What is the average number of actors acted in comedy movies?

SELECT AVG(T1.actor_id) FROM film_actor AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id INNER JOIN actor AS T4 ON T4.actor_id = T1.actor_id WHERE T3.name = 'comedy'

What is the average number of actors acted in comedy movies ?

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


Question: Show the pair of male and female names in all weddings after year 2014

SELECT T2.name ,  T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id WHERE T1.year  >  2014

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


Question: How many schools are there in the department?

SELECT count(DISTINCT school_code) FROM department

How many schools are there in the department ?


Question: What are the names of all of Bob's friends?

SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend  =  'Bob'

What are the names of all of Bob 's friends ?

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


Question: How many models does the VIVO phone brand released?

SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo'

How many models does the VIVO phone brand released ?

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


Question: Find all the order items whose product id is 11. What are the order item ids?

SELECT order_item_id FROM order_items WHERE product_id = 11

Find all the order items whose product i d is 11 . What are the order item ids ?

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


Question: In which cities beginning with the letter M have the Olympic Games been held?

SELECT city_name FROM city WHERE city_name LIKE 'M%'

In which cities beginning with the letter M have the Olympic Games been held ?

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


Question: What is the greatest length of the border between 2 independent countries?

SELECT MAX(T3.Length) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Independence IS NOT NULL

What is the greatest length of the border between 2 independent countries ?

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


Question: On which day did the bakery sell more than 100 dollars in total.

SELECT T3.date FROM goods AS T1 JOIN items AS T2 ON T1.id  =  T2.item JOIN receipts AS T3 ON T2.receipt  =  T3.ReceiptNumber GROUP BY T3.date HAVING sum(T1.price)  >  100

On which day did the bakery sell more than 100 dollars in total .

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


Question: From which institute is harder to graduate for a bachelor, Amridge University or Auburn University?

SELECT chronname FROM institution_details WHERE chronname IN ('Amridge University', 'Auburn University') ORDER BY grad_100_value LIMIT 1

From which institute is harder to graduate for a bachelor , Amridge University or Auburn University ?

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


Question: In which year did the Montreal Canadiens have 49 penalty minutes in the Stanley Cup finals? Was it 1924, 1923 or 1918?

SELECT T1.year FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T2.PIM = 49

In which year did the Montreal Canadiens have 49 penalty minutes in the Stanley Cup finals ? Was it 1924 , 1923 or 1918 ?

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


Question: What are the songs in volumes associated with the artist aged 32 or older?

SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  >=  32

What are the songs in volumes associated with the artist aged 32 or older ?

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


Question: List all the methods with a solution with a "636449700980488000" processed time.

SELECT DISTINCT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.ProcessedTime = 636449700980488000

List all the methods with a solution with a " 636449700980488000 " processed time .

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


Question: Please give the name of customers from the West region that bought exactly 8 items in their purchase.

SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Quantity = 8 AND T1.Region = 'West'

Please give the name of customers from the West region that bought exactly 8 items in their purchase .

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


Question: Show all locations and the total number of platforms and passengers for all train stations in each location.

SELECT LOCATION ,  sum(number_of_platforms) ,  sum(total_passengers) FROM station GROUP BY LOCATION

Show all locations and the total number of platforms and passengers for all train stations in each location .

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


Question: List all payment ids and its corresponding invoice ids and details.

SELECT payment_id ,  invoice_id ,  payment_details FROM Payments

List all payment ids and its corresponding invoice ids and details .

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


Question: How many footnotes have been made in year 1980 and what are the table names of these countries that made the footnotes?

SELECT COUNT(T2.Description) FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Year = 'YR1980' UNION ALL SELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Year = 'YR1980'

How many footnotes have been made in year 1980 and what are the table names of these countries that made the footnotes ?

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


Question: Please show the most common status of roller coasters.

SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1

Please show the most common status of roller coasters .


Question: How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division?

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

How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division ?

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


Question: Count the number of classrooms in Lamberton.

SELECT count(*) FROM classroom WHERE building  =  'Lamberton'

Count the number of classrooms in Lamberton .


Question: Among the users who are above 20, how many users use device model of ELIFE E7 Mini?

SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'ELIFE E7 Mini' AND T1.age > 20

Among the users who are above 20 , how many users use device model of ELIFE E7 Mini ?

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


Question: What is the average weight of players who have height greater than 72 inches.

SELECT AVG(weight) FROM Master WHERE height > 72

What is the average weight of players who have height greater than 72 inches .

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


Question: How many students have been absents for more than 6 months?

SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 6

How many students have been absents for more than 6 months ?


Question: How many trips did not end in San Francisco?

SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id  =  T2.id WHERE T2.city != "San Francisco"

How many trips did not end in San Francisco ?

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


Question: Compute the average profits companies make.

SELECT avg(Profits_billion) FROM Companies

Compute the average profits companies make .