Question: Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.

SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'

Among the clients born between 1980 and 2000 , list the name of male clients who complained through referral .

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


Question: Who is the dumbest superhero?

SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' ORDER BY T2.attribute_value LIMIT 1


Question: Who is the customer from the East region that purchased the order with the highest profit?

SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' ORDER BY T1.Profit DESC LIMIT 1

Who is the customer from the East region that purchased the order with the highest profit ?

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


Question: What are the names of manufacturers with revenue greater than the average of all revenues?

SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)

What are the names of manufacturers with revenue greater than the average of all revenues ?

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


Question: What is the title of the course with Differential Geometry as a prerequisite?

SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id  =  T2.course_id WHERE T2.title  =  'Differential Geometry')

What is the title of the course with Differential Geometry as a prerequisite ?

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


Question: Which state is Outagamie County in? Give the full name of the state.

SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'

Which state is Outagamie County in ? Give the full name of the state .

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


Question: In which year did university ID 1 have the most students?

SELECT year FROM university_year WHERE university_id = 1 ORDER BY num_students DESC LIMIT 1

In which year did university ID 1 have the most students ?

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


Question: List the personal names and family names of all the students in alphabetical order of family name.

SELECT personal_name ,  family_name FROM Students ORDER BY family_name

List the personal names and family names of all the students in alphabetical order of family name .

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


Question: What is the name of the player who has been chosen the most times for 'Man of the Series'?

SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1

What is the name of the player who has been chosen the most times for ' Man of the Series ' ?

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


Question: Describe the full names, emails and intelligence of the students with the highest capability and salary.

SELECT f_name, l_name, email, intelligence FROM student WHERE student_id IN ( SELECT student_id FROM RA WHERE salary = 'high' AND capability = ( SELECT MAX(capability) FROM RA ) )

Describe the full names , emails and intelligence of the students with the highest capability and salary .

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


Question: Find the name and internet web of the channel that is directed by the most directors.

SELECT t1.name ,  t1.internet FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id GROUP BY t1.channel_id ORDER BY count(*) DESC LIMIT 1

Find the name and internet web of the channel that is directed by the most directors .

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


Question: How many films in the horror category were included in PG-13-rated?

SELECT COUNT(T1.film_id) 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 WHERE T3.name = 'Horror' AND T1.rating = 'PG-13'

How many films in the horror category were included in PG-13 - rated ?

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


Question: Compute the average active time span of contact channels.

SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels

Compute the average active time span of contact channels .


Question: For each zip code, return the average mean temperature of August there.

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

For each zip code , return the average mean temperature of August there .

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


Question: What is the page count for menu with page ID of 130?

SELECT T1.page_count FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.id = 130

What is the page count for menu with page ID of 130 ?

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


Question: List down the name of strategy games.

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


Question: Among the players who use the right hand as their batting hand, how many of them were born after 1985?

SELECT SUM(CASE WHEN SUBSTR(T1.DOB, 1, 4) > 1985 THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_Hand = 'Right-hand bat'

Among the players who use the right hand as their batting hand , how many of them were born after 1985 ?

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


Question: Count the number of different parties.

SELECT count(DISTINCT party_name) FROM party


Question: List the object number of railways that do not have any trains.

SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train)

List the object number of railways that do not have any trains .

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


Question: What are the names of the ships  that are from either the US or the UK?

SELECT Name FROM ship WHERE Nationality  =  "United States" OR Nationality  =  "United Kingdom"

What are the names of the ships that are from either the US or the UK ?

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


Question: How many assets does each third party company supply? List the count and the company id.

SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id

How many assets does each third party company supply ? List the count and the company i d.

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


Question: What is the year and semester with the most courses?

SELECT semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR ORDER BY count(*) DESC LIMIT 1

What is the year and semester with the most courses ?


Question: What are the names of banks that have loaned money to customers with credit scores below 100?

SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100

What are the names of banks that have loaned money to customers with credit scores below 100 ?

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


Question: What is the largest supplier's account balance?

What is the largest supplier 's account balance ?


Question: Calculate the average production rate per year from 1971 to 1980. Among them, name the cars with a weight of fewer than 1800 lbs.

SELECT CAST(COUNT(T1.ID) AS REAL) / 9 FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 UNION ALL SELECT DISTINCT T2.car_name FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 AND T2.weight < 1800

Calculate the average production rate per year from 1971 to 1980 . Among them , name the cars with a weight of fewer than 1800 lbs .

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


Question: Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press.

SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Free Press' AND STRFTIME('%Y', T1.publication_date) BETWEEN '1990' AND '2000' ORDER BY T1.num_pages DESC LIMIT 1

Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press .

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


Question: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.

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

Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance .

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


Question: What are the maximum and minimum points of drivers.

SELECT max(Points) ,  min(Points) FROM driver

What are the maximum and minimum points of drivers .


Question: What is the most widely used shipping company in the United States of America?

SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.ShipCountry = 'USA' GROUP BY T2.CompanyName ORDER BY COUNT(T2.CompanyName) DESC LIMIT 1

What is the most widely used shipping company in the United States of America ?

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


Question: Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".

SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_ID) > 2

Please list the IDs of all the images with more than 2 pairs of object samples with the relation " parked on " .

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


Question: What is the area of Egypt as a percentage of Asia?

SELECT T1.Area * 100 / T3.Area FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt'

What is the area of Egypt as a percentage of Asia ?

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


Question: How many Jewish legislators do not have facebook?

SELECT COUNT(T3.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NULL GROUP BY T1.bioguide_id ) T3

How many Jewish legislators do not have facebook ?


Question: Show the names of regions that have more than one building.

SELECT T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID GROUP BY T1.Region_ID HAVING COUNT(*)  >  1

Show the names of regions that have more than one building .

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


Question: Please list all display names of users who are adults.

SELECT DisplayName FROM users WHERE Age BETWEEN 19 AND 65

Please list all display names of users who are adults .

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


Question: How many teachers does the student named CHRISSY NABOZNY have?

SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY"

How many teachers does the student named CHRISSY NABOZNY have ?

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


Question: Which friend of Zach has the longest-lasting friendship?

SELECT friend FROM PersonFriend WHERE name =  'Zach' AND YEAR  =  (SELECT max(YEAR) FROM PersonFriend WHERE name =  'Zach')

Which friend of Zach has the longest - lasting friendship ?


Question: Give id of the instructor who advises students in the History department.

SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id  =  T2.id WHERE T2.dept_name  =  'History'

Give i d of the instructor who advises students in the History department .

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


Question: How many competitors were there who participated in 2000 Summer with age 31?

SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2000 Summer' AND T2.age = 31

How many competitors were there who participated in 2000 Summer with age 31 ?

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


Question: Based on all user compliments, find the percentage of low number of compliments on all compliments ID.

SELECT CAST(SUM(CASE WHEN number_of_compliments = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users_compliments

Based on all user compliments , find the percentage of low number of compliments on all compliments ID .

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


Question: What are the details of the project that is producing both patents and papers as outcomes?

SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id WHERE T2.outcome_code  =  'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id WHERE T2.outcome_code  =  'Patent'

What are the details of the project that is producing both patents and papers as outcomes ?

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


Question: Which major has between 2 and 30 number of students? List major and the number of students.

SELECT Major ,  count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;

Which major has between 2 and 30 number of students ? List major and the number of students .

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


Question: Show the first year and last year of parties with theme "Spring" or "Teqnology".

SELECT First_year ,  Last_year FROM party WHERE Party_Theme  =  "Spring" OR Party_Theme  =  "Teqnology"

Show the first year and last year of parties with theme " Spring " or " Teqnology " .

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


Question: What is the age of the tallest person?

SELECT Age FROM people ORDER BY Height DESC LIMIT 1


Question: How many students are from each city, and which cities have more than one cities?

SELECT count(*) ,  city_code FROM student GROUP BY city_code HAVING count(*)  >  1

How many students are from each city , and which cities have more than one cities ?

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


Question: What is the last name of the musician that have produced the most number of songs?

SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1

What is the last name of the musician that have produced the most number of songs ?

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


Question: List all the name of customers who have orders that are still processing.

SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process'

List all the name of customers who have orders that are still processing .

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


Question: What are the paper IDs of papers presented in conferences has a homepage starts with "http://www.informatik.uni-trier.de/~ley/db/conf/"?

SELECT T1.Id FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.HomePage LIKE 'http://www.informatik.uni-trier.de/~ley/db/conf/%'

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


Question: Calculate the percentage of female students.

SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name

Calculate the percentage of female students .


Question: What is the organization(s) that has 'National Society' as member type.

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 WHERE T2.Type = 'National Society'

What is the organization(s ) that has ' National Society ' as member type .

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


Question: What is the postal code of the address 692 Joliet Street?

SELECT postal_code FROM address WHERE address = '692 Joliet Street'

What is the postal code of the address 692 Joliet Street ?

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


Question: Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.

SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'

Among the clients born between 1980 and 2000 , list the name of male clients who complained through referral .

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


Question: Who is the dumbest superhero?

SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' ORDER BY T2.attribute_value LIMIT 1


Question: Who is the customer from the East region that purchased the order with the highest profit?

SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' ORDER BY T1.Profit DESC LIMIT 1

Who is the customer from the East region that purchased the order with the highest profit ?

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


Question: What are the names of manufacturers with revenue greater than the average of all revenues?

SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers)

What are the names of manufacturers with revenue greater than the average of all revenues ?

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


Question: What is the title of the course with Differential Geometry as a prerequisite?

SELECT title FROM course WHERE course_id IN (SELECT T1.course_id FROM prereq AS T1 JOIN course AS T2 ON T1.prereq_id  =  T2.course_id WHERE T2.title  =  'Differential Geometry')

What is the title of the course with Differential Geometry as a prerequisite ?

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


Question: Which state is Outagamie County in? Give the full name of the state.

SELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'

Which state is Outagamie County in ? Give the full name of the state .

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


Question: In which year did university ID 1 have the most students?

SELECT year FROM university_year WHERE university_id = 1 ORDER BY num_students DESC LIMIT 1

In which year did university ID 1 have the most students ?

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


Question: List the personal names and family names of all the students in alphabetical order of family name.

SELECT personal_name ,  family_name FROM Students ORDER BY family_name

List the personal names and family names of all the students in alphabetical order of family name .

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


Question: What is the name of the player who has been chosen the most times for 'Man of the Series'?

SELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1

What is the name of the player who has been chosen the most times for ' Man of the Series ' ?

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


Question: Describe the full names, emails and intelligence of the students with the highest capability and salary.

SELECT f_name, l_name, email, intelligence FROM student WHERE student_id IN ( SELECT student_id FROM RA WHERE salary = 'high' AND capability = ( SELECT MAX(capability) FROM RA ) )

Describe the full names , emails and intelligence of the students with the highest capability and salary .

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


Question: Find the name and internet web of the channel that is directed by the most directors.

SELECT t1.name ,  t1.internet FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id GROUP BY t1.channel_id ORDER BY count(*) DESC LIMIT 1

Find the name and internet web of the channel that is directed by the most directors .

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


Question: How many films in the horror category were included in PG-13-rated?

SELECT COUNT(T1.film_id) 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 WHERE T3.name = 'Horror' AND T1.rating = 'PG-13'

How many films in the horror category were included in PG-13 - rated ?

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


Question: Compute the average active time span of contact channels.

SELECT avg(active_to_date - active_from_date) FROM customer_contact_channels

Compute the average active time span of contact channels .


Question: For each zip code, return the average mean temperature of August there.

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

For each zip code , return the average mean temperature of August there .

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


Question: What is the page count for menu with page ID of 130?

SELECT T1.page_count FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.id = 130

What is the page count for menu with page ID of 130 ?

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


Question: List down the name of strategy games.

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


Question: Among the players who use the right hand as their batting hand, how many of them were born after 1985?

SELECT SUM(CASE WHEN SUBSTR(T1.DOB, 1, 4) > 1985 THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_Hand = 'Right-hand bat'

Among the players who use the right hand as their batting hand , how many of them were born after 1985 ?

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


Question: Count the number of different parties.

SELECT count(DISTINCT party_name) FROM party


Question: List the object number of railways that do not have any trains.

SELECT ObjectNumber FROM railway WHERE Railway_ID NOT IN (SELECT Railway_ID FROM train)

List the object number of railways that do not have any trains .

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


Question: What are the names of the ships  that are from either the US or the UK?

SELECT Name FROM ship WHERE Nationality  =  "United States" OR Nationality  =  "United Kingdom"

What are the names of the ships that are from either the US or the UK ?

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


Question: How many assets does each third party company supply? List the count and the company id.

SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id

How many assets does each third party company supply ? List the count and the company i d.

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


Question: What is the year and semester with the most courses?

SELECT semester ,  YEAR FROM SECTION GROUP BY semester ,  YEAR ORDER BY count(*) DESC LIMIT 1

What is the year and semester with the most courses ?

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


Question: What are the names of banks that have loaned money to customers with credit scores below 100?

SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100

What are the names of banks that have loaned money to customers with credit scores below 100 ?

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


Question: What is the largest supplier's account balance?

What is the largest supplier 's account balance ?


Question: Calculate the average production rate per year from 1971 to 1980. Among them, name the cars with a weight of fewer than 1800 lbs.

SELECT CAST(COUNT(T1.ID) AS REAL) / 9 FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 UNION ALL SELECT DISTINCT T2.car_name FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 AND T2.weight < 1800

Calculate the average production rate per year from 1971 to 1980 . Among them , name the cars with a weight of fewer than 1800 lbs .

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


Question: Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press.

SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Free Press' AND STRFTIME('%Y', T1.publication_date) BETWEEN '1990' AND '2000' ORDER BY T1.num_pages DESC LIMIT 1

Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press .

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


Question: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.

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

Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance .

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


Question: What are the maximum and minimum points of drivers.

SELECT max(Points) ,  min(Points) FROM driver

What are the maximum and minimum points of drivers .


Question: What is the most widely used shipping company in the United States of America?

SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.ShipCountry = 'USA' GROUP BY T2.CompanyName ORDER BY COUNT(T2.CompanyName) DESC LIMIT 1

What is the most widely used shipping company in the United States of America ?

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


Question: Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".

SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_ID) > 2

Please list the IDs of all the images with more than 2 pairs of object samples with the relation " parked on " .

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


Question: What is the area of Egypt as a percentage of Asia?

SELECT T1.Area * 100 / T3.Area FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt'

What is the area of Egypt as a percentage of Asia ?

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


Question: How many Jewish legislators do not have facebook?

SELECT COUNT(T3.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NULL GROUP BY T1.bioguide_id ) T3

How many Jewish legislators do not have facebook ?


Question: Show the names of regions that have more than one building.

SELECT T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID GROUP BY T1.Region_ID HAVING COUNT(*)  >  1

Show the names of regions that have more than one building .

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


Question: Please list all display names of users who are adults.

SELECT DisplayName FROM users WHERE Age BETWEEN 19 AND 65

Please list all display names of users who are adults .

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


Question: How many teachers does the student named CHRISSY NABOZNY have?

SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY"

How many teachers does the student named CHRISSY NABOZNY have ?

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


Question: Which friend of Zach has the longest-lasting friendship?

SELECT friend FROM PersonFriend WHERE name =  'Zach' AND YEAR  =  (SELECT max(YEAR) FROM PersonFriend WHERE name =  'Zach')

Which friend of Zach has the longest - lasting friendship ?


Question: Give id of the instructor who advises students in the History department.

SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id  =  T2.id WHERE T2.dept_name  =  'History'

Give i d of the instructor who advises students in the History department .

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


Question: How many competitors were there who participated in 2000 Summer with age 31?

SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2000 Summer' AND T2.age = 31

How many competitors were there who participated in 2000 Summer with age 31 ?

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


Question: Based on all user compliments, find the percentage of low number of compliments on all compliments ID.

SELECT CAST(SUM(CASE WHEN number_of_compliments = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users_compliments

Based on all user compliments , find the percentage of low number of compliments on all compliments ID .

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


Question: What are the details of the project that is producing both patents and papers as outcomes?

SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id WHERE T2.outcome_code  =  'Paper' INTERSECT SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id WHERE T2.outcome_code  =  'Patent'

What are the details of the project that is producing both patents and papers as outcomes ?

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


Question: Which major has between 2 and 30 number of students? List major and the number of students.

SELECT Major ,  count(*) FROM Student GROUP BY Major HAVING count(Major) BETWEEN 2 AND 30;

Which major has between 2 and 30 number of students ? List major and the number of students .

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


Question: Show the first year and last year of parties with theme "Spring" or "Teqnology".

SELECT First_year ,  Last_year FROM party WHERE Party_Theme  =  "Spring" OR Party_Theme  =  "Teqnology"

Show the first year and last year of parties with theme " Spring " or " Teqnology " .

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


Question: What is the age of the tallest person?

SELECT Age FROM people ORDER BY Height DESC LIMIT 1


Question: How many students are from each city, and which cities have more than one cities?

SELECT count(*) ,  city_code FROM student GROUP BY city_code HAVING count(*)  >  1

How many students are from each city , and which cities have more than one cities ?

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


Question: What is the last name of the musician that have produced the most number of songs?

SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1

What is the last name of the musician that have produced the most number of songs ?

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


Question: List all the name of customers who have orders that are still processing.

SELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process'

List all the name of customers who have orders that are still processing .

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


Question: What are the paper IDs of papers presented in conferences has a homepage starts with "http://www.informatik.uni-trier.de/~ley/db/conf/"?

SELECT T1.Id FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.HomePage LIKE 'http://www.informatik.uni-trier.de/~ley/db/conf/%'

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


Question: Calculate the percentage of female students.

SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name

Calculate the percentage of female students .


Question: What is the organization(s) that has 'National Society' as member type.

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 WHERE T2.Type = 'National Society'

What is the organization(s ) that has ' National Society ' as member type .

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


Question: What is the postal code of the address 692 Joliet Street?

SELECT postal_code FROM address WHERE address = '692 Joliet Street'

What is the postal code of the address 692 Joliet Street ?

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