Question: How many stations in San Francico can hold more than 20 bikes?

SELECT SUM(CASE WHEN city = 'San Francisco' AND dock_count > 20 THEN 1 ELSE 0 END) FROM station

How many stations in San Francico can hold more than 20 bikes ?

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


Question: What is the average standard cost of product number CA-1098?

SELECT AVG(T2.StandardCost) FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductNumber = 'CA-1098'

What is the average standard cost of product number CA-1098 ?

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


Question: Please list the constructor names with 0 points at race 291.

SELECT T2.name FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.points = 0 AND T1.raceId = 291

Please list the constructor names with 0 points at race 291 .

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


Question: Show storm name with at least two regions and 10 cities affected.

SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING count(*)  >=  2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id  =  T2.storm_id GROUP BY T1.storm_id HAVING sum(T2.number_city_affected)  >=  10

Show storm name with at least two regions and 10 cities affected .

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


Question: Return the zip codes for properties not belonging to users who own two or fewer properties.

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

Return the zip codes for properties not belonging to users who own two or fewer properties .

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


Question: How many schools in Amador which the Low Grade is 9 and the High Grade is 12?

SELECT COUNT(T1.`School Name`) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Amador' AND T1.`Low Grade` = 9 AND T1.`High Grade` = 12

How many schools in Amador which the Low Grade is 9 and the High Grade is 12 ?

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


Question: How many flights operated by American Airlines Inc. on 2018/8/1 were faster than scheduled?

SELECT SUM(CASE WHEN T2.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'

How many flights operated by American Airlines Inc. on 2018/8/1 were faster than scheduled ?

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


Question: Give me an alphabetically ordered list of the distinct subject code for exams.

SELECT DISTINCT Subject_Code FROM Exams ORDER BY Subject_Code

Give me an alphabetically ordered list of the distinct subject code for exams .

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


Question: How many events are there?


Question: What are the different product names? What is the average product price for each of them?

SELECT Product_Name ,  avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name

What are the different product names ? What is the average product price for each of them ?

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


Question: What are the name and location of the cinema with the largest capacity?

SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1

What are the name and location of the cinema with the largest capacity ?

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


Question: What are the names of people in ascending order of weight?

SELECT Name FROM People ORDER BY Weight ASC

What are the names of people in ascending order of weight ?

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


Question: Show all artist names and the number of exhibitions for each artist.

SELECT T2.name ,  count(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id  =  T2.artist_id GROUP BY T1.artist_id

Show all artist names and the number of exhibitions for each artist .

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


Question: List down the enrolled schools and duration of student214.

SELECT school, month FROM enrolled WHERE name = 'student214'

List down the enrolled schools and duration of student214 .

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


Question: What is the keyword found on card 'Angel of Mercy'?

SELECT DISTINCT keywords FROM cards WHERE name = 'Angel of Mercy'

What is the keyword found on card ' Angel of Mercy ' ?

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


Question: Count the number of customer cards of the type Debit.

SELECT count(*) FROM Customers_cards WHERE card_type_code  =  "Debit"

Count the number of customer cards of the type Debit .

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


Question: Give the neighborhood name of West Englewood community.

SELECT T1.neighborhood_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.community_area_name = 'West Englewood'

Give the neighborhood name of West Englewood community .

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


Question: What is the attribute of the business with highest star rating?

SELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id ORDER BY T1.stars DESC LIMIT 1

What is the attribute of the business with highest star rating ?

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


Question: How many cards with unknown power that can't be found in foil is in duel deck A?

SELECT SUM(CASE WHEN power = '*' OR power IS NULL THEN 1 ELSE 0 END) FROM cards WHERE hasFoil = 0 AND duelDeck = 'a'

How many cards with unknown power that ca n't be found in foil is in duel deck A ?

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


Question: Find the team with two or more drivers and return the the manager and car owner of the team.

SELECT t1.manager ,  t1.car_owner FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id HAVING count(*)  >=  2

Find the team with two or more drivers and return the the manager and car owner of the team .

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


Question: What are the different names of sailors who reserved two or more boats ?

select distinct t1.name ,  t1.sid from sailors as t1 join reserves as t2 on t1.sid  =  t2.sid group by t2.sid having count(*)  >=  2

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


Question: What are the top 2 earpads in terms of the number of headphones using them?

SELECT earpads FROM headphone GROUP BY earpads ORDER BY count(*) DESC LIMIT 2

What are the top 2 earpads in terms of the number of headphones using them ?

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


Question: What is the list of school locations sorted in ascending order of school enrollment?

SELECT LOCATION FROM school ORDER BY Enrollment ASC

What is the list of school locations sorted in ascending order of school enrollment ?

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


Question: Show the id of each employee and the number of document destruction authorised by that employee.

SELECT Destruction_Authorised_by_Employee_ID ,  count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID

Show the i d of each employee and the number of document destruction authorised by that employee .

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


Question: Who is the head of the country where Santa Catarina district belongs?

SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.District = 'Santa Catarina'

Who is the head of the country where Santa Catarina district belongs ?

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


Question: Find the names of all instructors in computer science department

SELECT name FROM instructor WHERE dept_name  =  'Comp. Sci.'

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


Question: What is the maximum and average power for the vehicles manufactured by 'Zhuzhou'?

SELECT max(power) ,  avg(power) FROM vehicle WHERE builder  =  'Zhuzhou'

What is the maximum and average power for the vehicles manufactured by ' Zhuzhou ' ?

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


Question: Among the cars originated from Japan, what is the name of the car with the highest price?

SELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' ORDER BY T1.price DESC LIMIT 1

Among the cars originated from Japan , what is the name of the car with the highest price ?

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


Question: For the client who applied the biggest loan, what was his/her first amount of transaction after opened the account?

SELECT T3.amount FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id ORDER BY T1.amount DESC, T3.date ASC LIMIT 1

For the client who applied the biggest loan , what was his / her first amount of transaction after opened the account ?

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


Question: What are the bed type and name of all the rooms with traditional decor?

SELECT roomName ,  bedType FROM Rooms WHERE decor = "traditional";

What are the bed type and name of all the rooms with traditional decor ?

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


Question: What is the average price for products?

What is the average price for products ?


Question: What restaurant on Drive Street in San Rafael doesn't serve American food?

SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'drive' AND T1.food_type != 'american' AND T2.city = 'san rafael'

What restaurant on Drive Street in San Rafael does n't serve American food ?

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


Question: Which position is most popular among players in the tryout?

SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1

Which position is most popular among players in the tryout ?


Question: Find the zip code in which the average mean visibility is lower than 10.

SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_visibility_miles)  <  10

Find the zip code in which the average mean visibility is lower than 10 .

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


Question: Which region is the majority of the athletes from?

SELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1

Which region is the majority of the athletes from ?


Question: What is the university name with highest research point?

SELECT T1.university_name FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id  =  T2.university_id ORDER BY T2.research_point DESC LIMIT 1

What is the university name with highest research point ?

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


Question: What is the sales revenue for item number 740?

SELECT ListPrice - StandardCost FROM Product WHERE ProductID = 740

What is the sales revenue for item number 740 ?


Question: Please list all the games that have the same game genre as 3D Lemmings.

SELECT T1.game_name FROM game AS T1 WHERE T1.genre_id = ( SELECT T.genre_id FROM game AS T WHERE T.game_name = '3D Lemmings' )

Please list all the games that have the same game genre as 3D Lemmings .

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


Question: Among the male patients, who has the earliest starting date of the care plan?

SELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'M' ORDER BY T1.START LIMIT 1

Among the male patients , who has the earliest starting date of the care plan ?

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


Question: display all the information of those employees who did not have any job in the past.

SELECT * FROM employees WHERE employee_id NOT IN (SELECT employee_id FROM job_history)

display all the information of those employees who did not have any job in the past .


Question: How many times has Sunrisers Hyderabad been the toss winner of a game?

SELECT SUM(CASE WHEN Toss_Winner = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Sunrisers Hyderabad' ) THEN 1 ELSE 0 END) FROM `Match`

How many times has Sunrisers Hyderabad been the toss winner of a game ?

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


Question: Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays.

SELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T1.closing_time + 12 - T1.opening_time > 12 AND T2.day_of_week LIKE 'Sunday' GROUP BY T1.business_id

Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays .

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


Question: What is the total number of schools whose total SAT scores are greater or equal to 1500 whose mailing city is Lakeport?

SELECT COUNT(T1.cds) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.MailCity = 'Lakeport' AND (T1.AvgScrRead + T1.AvgScrMath + T1.AvgScrWrite) >= 1500

What is the total number of schools whose total SAT scores are greater or equal to 1500 whose mailing city is Lakeport ?

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


Question: How many games are there from each Franchise?

SELECT Franchise ,  COUNT(*) FROM game GROUP BY Franchise

How many games are there from each Franchise ?


Question: Count different addresses of each school.

SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code

Count different addresses of each school .


Question: Which team has the most victories as the home team in matches of the Bundesliga division?

SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1

Which team has the most victories as the home team in matches of the Bundesliga division ?

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


Question: Find and list the full name of customers who rented more family movies than Sci-Fi movies.

SELECT DISTINCT IIF(SUM(IIF(T5.name = 'Family', 1, 0)) - SUM(IIF(T5.name = 'Sci-Fi', 1, 0)) > 0, T1.first_name, 0) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film_category AS T4 ON T4.film_id = T3.film_id INNER JOIN category AS T5 ON T4.category_id = T5.category_id GROUP BY T1.customer_id

Find and list the full name of customers who rented more family movies than Sci - Fi movies .

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


Question: What are the loan amounts and loan dates of the students who have at least 2 achievements?

SELECT amount_of_loan ,  date_of_loan FROM Student_Loans WHERE student_id IN ( SELECT student_id FROM Achievements GROUP BY student_id HAVING count(*)  >=  2 )

What are the loan amounts and loan dates of the students who have at least 2 achievements ?

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


Question: What is the storm name and max speed which affected the greatest number of regions?

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

What is the storm name and max speed which affected the greatest number of regions ?

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


Question: Which county and region does the street E. El Camino Real belong to?

SELECT DISTINCT T2.county, T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'E. El Camino Real'

Which county and region does the street E. El Camino Real belong to ?

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


Question: At what Latitude and Longitude is the store that has used the WARE-PUJ1005 warehouse the fewest times?

SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.WarehouseCode = 'WARE-PUJ1005' GROUP BY T2.StoreID ORDER BY COUNT(T1.WarehouseCode) ASC LIMIT 1

At what Latitude and Longitude is the store that has used the WARE - PUJ1005 warehouse the fewest times ?

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


Question: List the 3 highest salaries of the players in 2001?

SELECT salary FROM salary WHERE YEAR  =  2001 ORDER BY salary DESC LIMIT 3;

List the 3 highest salaries of the players in 2001 ?


Question: Among the matches held in 2015, who is the winning team in the match ID 829768?

SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Date LIKE '2015%' AND T1.Match_Id = 829768

Among the matches held in 2015 , who is the winning team in the match ID 829768 ?

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


Question: List out female students that enrolled in occ school and ulca?

SELECT name FROM enrolled WHERE school IN ('occ', 'ulca') AND name NOT IN ( SELECT name FROM male )

List out female students that enrolled in occ school and ulca ?

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


Question: What is the id of the project with least number of documents?

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

What is the i d of the project with least number of documents ?

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


Question: What are the names of customers who have not taken a Mortage loan?

SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE T2.loan_type  =  'Mortgages'

What are the names of customers who have not taken a Mortage loan ?

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


Question: What is the average blood albumin level for female patients with a PLT greater than 400 who have been diagnosed with SLE?

SELECT AVG(T2.ALB) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT > 400 AND T1.Diagnosis = 'SLE' AND T1.SEX = 'F'

What is the average blood albumin level for female patients with a PLT greater than 400 who have been diagnosed with SLE ?

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


Question: What is the total revenue of all companies whose main office is at Tokyo or Taiwan?

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

What is the total revenue of all companies whose main office is at Tokyo or Taiwan ?

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


Question: List the name of the school with the smallest enrollment.

SELECT school_name FROM school ORDER BY enrollment LIMIT 1

List the name of the school with the smallest enrollment .


Question: How many suppliers are from UK?

SELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'UK'


Question: Indicate the name of all the games published for the 'SCD' platform.

SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'SCD'

Indicate the name of all the games published for the ' SCD ' platform .

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


Question: How many addresses are there in country USA?

SELECT count(*) FROM addresses WHERE country  =  'USA'

How many addresses are there in country USA ?


Question: Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China".

SELECT Industry FROM Companies WHERE Headquarters  =  "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters  =  "China"

Show the industries shared by companies whose headquarters are " USA " and companies whose headquarters are " China " .

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


Question: Show names of cities and names of counties they are in.

SELECT T1.Name ,  T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID

Show names of cities and names of counties they are in .

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


Question: Name the part which is most profitable.

SELECT T.p_name FROM ( SELECT T3.p_name , T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity AS num FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ) AS T ORDER BY T.num DESC LIMIT 1

Name the part which is most profitable .


Question: List the names of all distinct wines ordered by price.

SELECT DISTINCT Name FROM WINE ORDER BY price

List the names of all distinct wines ordered by price .

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


Question: How many books are there?


Question: Which country do most players of team Plymouth Whalers come from?

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

Which country do most players of team Plymouth Whalers come from ?

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


Question: Find the name, headquarter and founder of the manufacturer that has the highest revenue.

SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1

Find the name , headquarter and founder of the manufacturer that has the highest revenue .

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


Question: List the name of employees in Japan office and who are they reporting to.

SELECT t2.firstName, t2.lastName, t2.reportsTo FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t1.country = 'Japan'

List the name of employees in Japan office and who are they reporting to .

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


Question: What are the ids of customers who have not made an order?

SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders

What are the ids of customers who have not made an order ?


Question: What are the names of procedures physician John Wen was trained in?

SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"

What are the names of procedures physician John Wen was trained in ?

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


Question: What are the first names of all professors who teach more than one class?

SELECT T2.emp_fname FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num  =  T2.emp_num GROUP BY T1.prof_num HAVING count(*)  >  1

What are the first names of all professors who teach more than one class ?


Question: find the ids of reviewers who did not give 4 star.

SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars  =  4

find the ids of reviewers who did not give 4 star .

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


Question: What are the products that have problems reported after 1986-11-13? Give me the product id and the count of problems reported after 1986-11-13.

SELECT count(*) ,  T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id

What are the products that have problems reported after 1986 - 11 - 13 ? Give me the product i d and the count of problems reported after 1986 - 11 - 13 .

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


Question: List all tracks bought by customer Daan Peeters.

SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters";

List all tracks bought by customer Daan Peeters .

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


Question: Calculate the ratio in percentage between the average number of app users belonging to "80s Japanese comic" and "90s Japanese comic".

SELECT SUM(IIF(T1.category = '80s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J8 , SUM(IIF(T1.category = '90s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J9 FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id

Calculate the ratio in percentage between the average number of app users belonging to " 80s Japanese comic " and " 90s Japanese comic " .

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


Question: Find the country of origin for the artist who made the least number of songs?

SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1

Find the country of origin for the artist who made the least number of songs ?

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


Question: Give the review of the restaurant located in Ocean St., Santa Cruz.

SELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'santa cruz' AND T1.street_name = 'ocean st'

Give the review of the restaurant located in Ocean St. , Santa Cruz .

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


Question: What is the country ID of the movie with the title of "Pirates of the Caribbean: Dead Man's Chest"?

SELECT T2.COUNTry_id FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title LIKE 'Pirates of the Caribbean: Dead Man%s Chest'

What is the country ID of the movie with the title of " Pirates of the Caribbean : Dead Man 's Chest " ?

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


Question: Name the countries that belong in the region with comment description "furiously express accounts wake sly".

SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'furiously express accounts wake sly'

Name the countries that belong in the region with comment description " furiously express accounts wake sly " .

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


Question: How many departments offer courses?

SELECT count(DISTINCT dept_name) FROM course


Question: What is the average gpa of Ogdon Zywicki's research assistants?

SELECT SUM(T3.gpa) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'

What is the average gpa of Ogdon Zywicki 's research assistants ?

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


Question: Provide the release year of record ID 1 to 10.

SELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10

Provide the release year of record ID 1 to 10 .

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


Question: Which country has the most players in the Hall of Fame?

SELECT T1.birthCountry FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID GROUP BY T1.birthCountry ORDER BY COUNT(T1.playerID) DESC LIMIT 1

Which country has the most players in the Hall of Fame ?

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


Question: Which direction does the majority of the trains that have 3 cars are running?

SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction

Which direction does the majority of the trains that have 3 cars are running ?

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


Question: Give the years and official names of the cities of each competition.

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

Give the years and official names of the cities of each competition .

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


Question: Find the list of attribute data types possessed by more than 3 attribute definitions.

SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3

Find the list of attribute data types possessed by more than 3 attribute definitions .

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


Question: What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?

SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'

What is the percentage of Professor Ogdon Zywicki 's research assistants are taught postgraduate students ?

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


Question: Find the total values of boxes that are not in the warehouses located at Chicago.

SELECT sum(T1.value) FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location != 'Chicago'

Find the total values of boxes that are not in the warehouses located at Chicago .

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


Question: What are the distinct countries of players with earnings higher than 1200000?

SELECT DISTINCT Country FROM player WHERE Earnings  >  1200000

What are the distinct countries of players with earnings higher than 1200000 ?

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


Question: How many vehicles have each type of powertrain?

SELECT type_of_powertrain ,  count(*) FROM vehicles GROUP BY type_of_powertrain

How many vehicles have each type of powertrain ?

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


Question: Which are the 2 rivers located at Belgrade city? Which river is longer and how by much?

SELECT T1.Name, T1.Length FROM river AS T1 INNER JOIN located AS T2 ON T1.Name = T2.River INNER JOIN city AS T3 ON T3.Name = T2.City WHERE T3.Name = 'Belgrade'

Which are the 2 rivers located at Belgrade city ? Which river is longer and how by much ?

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


Question: Determine the bond type that is formed in the chemical compound containing element Carbon.

SELECT DISTINCT T2.bond_type FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'c'

Determine the bond type that is formed in the chemical compound containing element Carbon .

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


Question: Show the name and phone for customers with a mailshot with outcome code 'No Response'.

SELECT T1.customer_name ,  T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.outcome_code  =  'No Response'

Show the name and phone for customers with a mailshot with outcome code ' No Response ' .

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


Question: What was the score for University of Florida in "N and S" in 2014?

SELECT T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'University of Florida' AND T2.year = 2014 AND T1.criteria_name = 'N and S'

What was the score for University of Florida in " N and S " in 2014 ?

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


Question: What is the average total price of the transactions taken place in gas stations in the Czech Republic?

SELECT AVG(T1.Price) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE'

What is the average total price of the transactions taken place in gas stations in the Czech Republic ?

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


Question: Find the code of city where most of students are living in.

SELECT city_code FROM student GROUP BY city_code ORDER BY count(*) DESC LIMIT 1

Find the code of city where most of students are living in .


Question: What percentage of clients who sent their complaints by postal mail are age 50 and older?

SELECT CAST(SUM(CASE WHEN T1.age > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail'

What percentage of clients who sent their complaints by postal mail are age 50 and older ?

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


Question: What is the biographical information of the students who got the most common result for their behaviour monitoring details ?

select t1.bio_data from students as t1 join behaviour_monitoring as t2 on t1.student_id  =  t2.student_id where t2.behaviour_monitoring_details in ( select behaviour_monitoring_details from behaviour_monitoring group by behaviour_monitoring_details order by count(*) desc limit 1 ) except select t1.bio_data from students as t1 join behaviour_monitoring as t2 on t1.student_id  =  t2.student_id where t2.behaviour_monitoring_details not in ( select behaviour_monitoring_details from behaviour_monitoring group by behaviour_monitoring_details order by count(*) desc limit 1 )

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


Question: Find the name and nationality of the people who did not participate in any ACL conference.

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

Find the name and nationality of the people who did not participate in any ACL conference .

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


Question: Find the number of distinct gender for dorms.

Find the number of distinct gender for dorms .


Question: Count the number of documents that do not have expenses.

SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )

Count the number of documents that do not have expenses .

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


Question: How many episodes was Dell Hake not included in the credit list?

SELECT COUNT(*) FROM Credit WHERE person = 'Dell Hake' AND credited = 'false';

How many episodes was Dell Hake not included in the credit list ?

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


Question: How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018?

SELECT COUNT(FL_DATE) FROM Airlines WHERE FL_DATE LIKE '2018/8%' AND ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'San Diego, CA: San Diego International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Los Angeles, CA: Los Angeles International' )

How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018 ?

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


Question: How many "food maintenance" related violations did inspection no.1454071 have?

SELECT COUNT(T2.point_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = '1454071' AND T1.category = 'Food Maintenance'

How many " food maintenance " related violations did inspection no.1454071 have ?

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


Question: How many free or gift products are there?

SELECT COUNT(ProductID) FROM Products WHERE Price = 0

How many free or gift products are there ?


Question: List the names and prices of the cars with model 82 and mileage per gallon of greater than 30.

SELECT T2.car_name, T1.price FROM price AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.model = 82 AND T2.mpg > 30

List the names and prices of the cars with model 82 and mileage per gallon of greater than 30 .

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


Question: What are the first names for all faculty professors, ordered by first name?

SELECT Fname FROM FACULTY WHERE Rank  =  "Professor" ORDER BY Fname

What are the first names for all faculty professors , ordered by first name ?

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


Question: What is the venue for the match ID 829768?

SELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T2.match_id = 829768

What is the venue for the match ID 829768 ?

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


Question: What is the male and female ratio among the professors?

SELECT CAST(SUM(CASE WHEN gender = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender = 'Female' THEN 1 ELSE 0 END) FROM prof

What is the male and female ratio among the professors ?


Question: How many times is the number of "Women's Clothing" Yelp businesses to "Men's Clothing"?

SELECT CAST(SUM(CASE WHEN T2.category_name = 'Women''s Clothing' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.category_name = 'Men''s Clothing' THEN 1 ELSE 0 END) AS TIMES FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id

How many times is the number of " Women 's Clothing " Yelp businesses to " Men 's Clothing " ?

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


Question: What are the first names of all students who live in the dorm with the most amenities?

SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid  =  T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid  =  T5.amenid GROUP BY T3.dormid ORDER BY count(*) DESC LIMIT 1)

What are the first names of all students who live in the dorm with the most amenities ?

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


Question: Which Shakespeare story with character ID 324 has description of 'this friend of Caesar'?

SELECT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T2.id = '324' AND T2.Description = 'friend to Caesar'

Which Shakespeare story with character ID 324 has description of ' this friend of Caesar ' ?

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


Question: What is Copycat's race?

SELECT T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.superhero_name = 'Copycat'


Question: List all the issues of the complaints made by Kaitlyn Eliza Elliott.

SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott'

List all the issues of the complaints made by Kaitlyn Eliza Elliott .

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


Question: What is the percentage of "premium" against the overall segment in Country = "SVK"?

SELECT CAST(SUM(IIF(Country = 'SVK' AND Segment = 'Premium', 1, 0)) AS FLOAT) * 100 / SUM(IIF(Country = 'SVK', 1, 0)) FROM gasstations

What is the percentage of " premium " against the overall segment in Country = " SVK " ?

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


Question: What is the rating and the total Sentiment subjectivity score of "Onefootball - Soccer Scores"?

SELECT T1.Rating, SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Onefootball - Soccer Scores'

What is the rating and the total Sentiment subjectivity score of " Onefootball - Soccer Scores " ?

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


Question: What is the least common detention type? Show the type code and the description.

SELECT T1.detention_type_code ,  T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code  =  T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1

What is the least common detention type ? Show the type code and the description .

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


Question: Which submission received the highest score in acceptance result. Show me the result.

SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1

Which submission received the highest score in acceptance result . Show me the result .

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


Question: How many "servant to Timon" characters are there?

SELECT COUNT(id) FROM characters WHERE Description = 'servant to Timon'

How many " servant to Timon " characters are there ?

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


Question: In the events with more than forty incomes, list the city and country in which the event is happening.

SELECT DISTINCT T3.city, T3.county FROM income AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN zip_code AS T3 ON T3.zip_code = T2.zip WHERE T1.amount > 40

In the events with more than forty incomes , list the city and country in which the event is happening .

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


Question: List the top three popular responses to the question of the survey in 2017 with the question ID no.85.

SELECT AnswerText FROM Answer WHERE QuestionID = 85 AND SurveyID = 2017 GROUP BY AnswerText ORDER BY COUNT(AnswerText) DESC LIMIT 3

List the top three popular responses to the question of the survey in 2017 with the question ID no.85 .

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


Question: What is the total amount of sales made in the year 1997?

SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID WHERE T1.OrderDate LIKE '1997%'

What is the total amount of sales made in the year 1997 ?


Question: How many debit cards do we have?

SELECT count(*) FROM Customers_cards WHERE card_type_code  =  "Debit"


Question: Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name  (in ascending order).

SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC

Select the name and price of all products with a price larger than or equal to $ 180 , and sort first by price ( in descending order ) , and then by name ( in ascending order ) .

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


Question: What is the homepage address for paper "Energy-efficiency bounds for noise-tolerant dynamic circuits"?

SELECT T2.HomePage FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Energy-efficiency bounds for noise-tolerant dynamic circuits'

What is the homepage address for paper " Energy - efficiency bounds for noise - tolerant dynamic circuits " ?

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


Question: What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?

SELECT payment_date FROM payment WHERE amount  >  10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.first_name  =  'Elsa'

What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa ?

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


Question: What is the status of the city that has hosted the most competitions?

SELECT T1.Status FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID  =  T2.Host_city_ID GROUP BY T2.Host_city_ID ORDER BY COUNT(*) DESC LIMIT 1

What is the status of the city that has hosted the most competitions ?

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


Question: What is the first name of the legislator whose address at 1005 Longworth HOB; Washington DC 20515-1408?

SELECT T1.first_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.address = '1005 Longworth HOB Washington DC 20515-1408' GROUP BY T1.first_name

What is the first name of the legislator whose address at 1005 Longworth HOB ; Washington DC 20515 - 1408 ?

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


Question: Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.

SELECT POSITION FROM pilot WHERE Join_Year	 <  2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year	 >  2005

Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000 .

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


Question: What is the product id and product name for the cheapest Hardware type product?

SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1

What is the product i d and product name for the cheapest Hardware type product ?

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


Question: How many credits is the course that the student with the last name Smithson took, and what is its description?

SELECT T4.crs_description ,  T4.crs_credit FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code JOIN student AS T3 ON T3.stu_num  =  T2.stu_num JOIN course AS T4 ON T4.crs_code  =  T1.crs_code WHERE T3.stu_lname  =  'Smithson'

How many credits is the course that the student with the last name Smithson took , and what is its description ?

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


Question: Find the names of all reviewers who rated Gone with the Wind.

SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID JOIN Reviewer AS T3 ON T1.rID  =  T3.rID WHERE T2.title  =  'Gone with the Wind'

Find the names of all reviewers who rated Gone with the Wind .

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


Question: How many games did BMG Interactive Entertainment release in 2012?

SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = 2012

How many games did BMG Interactive Entertainment release in 2012 ?

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


Question: How many clients with the last name Alvarado are from Maryland?

SELECT COUNT(T2.client_id) FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T1.state_abbrev = T3.StateCode WHERE T2.last = 'Alvarado' AND T2.state = 'MD'

How many clients with the last name Alvarado are from Maryland ?

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


Question: What is the capital city of the country with largest population?

SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population DESC LIMIT 1

What is the capital city of the country with largest population ?

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


Question: Please show the countries and the number of climbers from each country.

SELECT Country ,  COUNT(*) FROM climber GROUP BY Country

Please show the countries and the number of climbers from each country .


Question: Show the name and service for all trains in order by time.

SELECT name ,  service FROM train ORDER BY TIME

Show the name and service for all trains in order by time .

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


Question: How many clients who live in New York City have the complaint outcome as "AGENT"?

SELECT COUNT(T2.`rand client`) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.city = 'New York City' AND T2.outcome = 'AGENT'

How many clients who live in New York City have the complaint outcome as " AGENT " ?

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


Question: Among the books published by publisher "Thomas Nelson", how many of them have over 300 pages?

SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' AND T1.num_pages > 300

Among the books published by publisher " Thomas Nelson " , how many of them have over 300 pages ?

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


Question: Sort all store names by store open date.

SELECT name FROM store ORDER BY date_opened

Sort all store names by store open date .


Question: What are names of the movies that are either made before 1980 or directed by James Cameron?

SELECT title FROM Movie WHERE director  =  "James Cameron" OR YEAR   <  1980

What are names of the movies that are either made before 1980 or directed by James Cameron ?

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


Question: Who is the sales person in charge of the territory with the id "9"? Provide their full name.

SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.TerritoryID = 9

Who is the sales person in charge of the territory with the i d " 9 " ? Provide their full name .

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


Question: List the names of institutions with at least one championship.

SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID  =  T2.Institution_ID WHERE T1.Number_of_Championships  >=  1

List the names of institutions with at least one championship .

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


Question: What is the cell phone number of the student whose address has the lowest monthly rental?

SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1

What is the cell phone number of the student whose address has the lowest monthly rental ?

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


Question: What is the ratio of students who have payment due and those who do not have payment due?

SELECT CAST(SUM(IIF(`bool` = 'pos', 1, 0)) AS REAL) / SUM(IIF(`bool` = 'neg', 1, 0)) FROM no_payment_due

What is the ratio of students who have payment due and those who do not have payment due ?

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


Question: List all the cities in a decreasing order of each city's stations' highest latitude.

SELECT city FROM station GROUP BY city ORDER BY max(lat) DESC

List all the cities in a decreasing order of each city 's stations ' highest latitude .

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


Question: Tell me the types of the policy used by the customer named "Dayana Robel".

SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id JOIN available_policies AS t3 ON t2.policy_id  =  t3.policy_id WHERE t1.customer_name  =  "Dayana Robel"

Tell me the types of the policy used by the customer named " Dayana Robel " .

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


Question: How many of the molecules are carcinogenic?

SELECT COUNT(T.molecule_id) FROM molecule AS T WHERE T.label = '+'

How many of the molecules are carcinogenic ?


Question: How many times has Mary Smith rented a film?

SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'

How many times has Mary Smith rented a film ?


Question: Give the race of the blue-haired male superhero.

SELECT T3.race FROM superhero AS T1 INNER JOIN colour AS T2 ON T1.hair_colour_id = T2.id INNER JOIN race AS T3 ON T1.race_id = T3.id INNER JOIN gender AS T4 ON T1.gender_id = T4.id WHERE T2.colour = 'Blue' AND T4.gender = 'Male'

Give the race of the blue - haired male superhero .

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


Question: What countries are the female artists who sung in the language Bangla from?

SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female" AND T2.languages  =  "bangla"

What countries are the female artists who sung in the language Bangla from ?

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


Question: What are the first names and date of birth of professors teaching course ACCT-211?

SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "ACCT-211"

What are the first names and date of birth of professors teaching course ACCT-211 ?


Question: What is the highest infant mortality rate per thousand of the countries whose inflation is under 3?

SELECT MAX(T2.Infant_Mortality) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.Inflation < 3

What is the highest infant mortality rate per thousand of the countries whose inflation is under 3 ?

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


Question: What are the names, details and data types of the characteristics which are never used by any product?

SELECT characteristic_name ,  other_characteristic_details ,  characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name ,  t1.other_characteristic_details ,  t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id  =  t2.characteristic_id

What are the names , details and data types of the characteristics which are never used by any product ?

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


Question: Calculate the percentage of countries that belong to the American region.

SELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey

Calculate the percentage of countries that belong to the American region .


Question: What are the names of all the subjects.

What are the names of all the subjects .


Question: What are the descriptions of all the project outcomes?

SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code  =  T2.outcome_code

What are the descriptions of all the project outcomes ?

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


Question: What are the procedures that cost more than 1000 or are specialized in by physician John Wen?

SELECT name FROM procedures WHERE cost  >  1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"

What are the procedures that cost more than 1000 or are specialized in by physician John Wen ?

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


Question: Among all the crimes that had happened in Central Chicago, how many of them were cases of domestic violence?

SELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' AND T1.domestic = 'TRUE'

Among all the crimes that had happened in Central Chicago , how many of them were cases of domestic violence ?

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


Question: Which team won the match of the Bundesliga division on 2020/10/2?

SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'

Which team won the match of the Bundesliga division on 2020/10/2 ?

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


Question: How many urgent orders did Clerk#000000001 handle in 1997?

SELECT COUNT(o_orderkey) FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1997' AND o_clerk = 'Clerk#000000001' AND o_orderpriority = '1-URGENT'

How many urgent orders did Clerk#000000001 handle in 1997 ?

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


Question: How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?

SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL";

How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21 , 2010 ?

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


Question: Which 5 products has the lowest amount of orders? List the product names.

SELECT t2.productName FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode GROUP BY t2.productName ORDER BY SUM(t1.quantityOrdered) ASC LIMIT 5

Which 5 products has the lowest amount of orders ? List the product names .

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


Question: Please list the names of all the dishes on page 1 of menu ID12882.

SELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.menu_id = 12882 AND T1.page_number = 1

Please list the names of all the dishes on page 1 of menu ID12882 .

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


Question: Among the cards whose version of frame style is 1997, what is the status of the card illustrated by D. Alexander Gregory in legacy play format that has sensitive content or Wizards of the Coast?

SELECT DISTINCT T2.status FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T1.frameVersion = 1997 AND T1.hasContentWarning = 1 AND T1.artist = 'D. Alexander Gregory' AND T2.format = 'legacy'

Among the cards whose version of frame style is 1997 , what is the status of the card illustrated by D. Alexander Gregory in legacy play format that has sensitive content or Wizards of the Coast ?

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


Question: Where can I find the movie list "Short and pretty damn sweet"?

SELECT list_url FROM lists WHERE list_title = 'Short and pretty damn sweet'

Where can I find the movie list " Short and pretty damn sweet " ?

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


Question: Of all the countries in which English is spoken, what percentage has English as their only language?

SELECT CAST(SUM(CASE WHEN T2.Percentage = 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'English'

Of all the countries in which English is spoken , what percentage has English as their only language ?

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


Question: Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?

SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.cmc_rank = 1

Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28 ?


Question: Calculate the average age of patients with prediabetes care plan.

SELECT CAST(SUM(CASE WHEN T1.deathdate IS NULL THEN strftime('%Y', T2.STOP) - strftime('%Y', T1.birthdate) ELSE strftime('%Y', T1.deathdate) - strftime('%Y', T1.birthdate) END) AS REAL) / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Prediabetes'

Calculate the average age of patients with prediabetes care plan .

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


Question: How many products are not made by Sony?

SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony')

How many products are not made by Sony ?


Question: Find the claimed amount in the claim with the least amount settled. Show both the settlement amount and claim amount.

SELECT Amount_Settled ,  Amount_Claimed FROM Claims ORDER BY Amount_Settled ASC LIMIT 1

Find the claimed amount in the claim with the least amount settled . Show both the settlement amount and claim amount .

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


Question: What is the total and maximum duration for all trips with the bike id 636?

SELECT sum(duration) ,  max(duration) FROM trip WHERE bike_id  =  636

What is the total and maximum duration for all trips with the bike i d 636 ?

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


Question: Give the names of people who did not participate in the candidate election.

SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)

Give the names of people who did not participate in the candidate election .

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


Question: Determine the email and Code of employee who are working at United State, state MA

SELECT T1.email, T1.employeeNumber FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.state = 'MA' AND T2.country = 'USA'

Determine the email and Code of employee who are working at United State , state MA

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


Question: Show all statement id and the number of accounts for each statement.

SELECT STATEMENT_ID ,  count(*) FROM Accounts GROUP BY STATEMENT_ID

Show all statement i d and the number of accounts for each statement .

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


Question: Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.

SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5

Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate .

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


Question: List out student IDs that have the longest absence duration from school.

SELECT name FROM longest_absense_from_school WHERE `month` = ( SELECT MAX(month) FROM longest_absense_from_school )

List out student IDs that have the longest absence duration from school .

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


Question: How many sales representitives are based in the offices in the USA?

SELECT COUNT(t1.employeeNumber) FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.country = 'USA' AND t1.jobTitle = 'Sales Rep'

How many sales representitives are based in the offices in the USA ?

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


Question: What was the phone of number of the client who made the complaint call "CR0100432" ？

SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0100432'

What was the phone of number of the client who made the complaint call " CR0100432 " ？

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


Question: What is the number of artists for each gender?

SELECT count(*) ,  gender FROM artist GROUP BY gender

What is the number of artists for each gender ?


Question: Find the count of universities whose campus fee is greater than the average campus fee.

SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees)

Find the count of universities whose campus fee is greater than the average campus fee .

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


Question: Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.

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

Which film is rented at a fee of 0.99 and has less than 3 in the inventory ? List the film title and i d.

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


Question: List down the locations of menu sponsored by Norddeutscher Lloyd Bremen.

SELECT location FROM Menu WHERE sponsor = 'Norddeutscher Lloyd Bremen'

List down the locations of menu sponsored by Norddeutscher Lloyd Bremen .

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


Question: Find all papers with titles and paper IDs written by Mckeown.

SELECT T1.title ,  T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id  =  T2.paper_id JOIN Author AS T3 ON T3.author_id  =  T2.author_id WHERE T3.name LIKE "%Mckeown%"

Find all papers with titles and paper IDs written by Mckeown .

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


Question: How many customers are living in city "Lake Geovannyton"?

SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id  =  t2.customer_id JOIN addresses AS t3 ON t2.address_id  =  t3.address_id WHERE t3.city  =  "Lake Geovannyton"

How many customers are living in city " Lake Geovannyton " ?

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


Question: How many stations in San Francisco are installed in 2014?

SELECT SUM(CASE WHEN city = 'San Francisco' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station

How many stations in San Francisco are installed in 2014 ?

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


Question: Which tourist attractions are related to royal family? Tell me their details and how we can get there.

SELECT T1.Royal_Family_Details ,  T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID  =  T2.Tourist_Attraction_ID

Which tourist attractions are related to royal family ? Tell me their details and how we can get there .

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


Question: Show the game name that has most number of hours played.

SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid  =  T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1

Show the game name that has most number of hours played .

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


Question: What are the apps with only 5,000+ installs?

SELECT DISTINCT App FROM playstore WHERE Installs = '5,000+'

What are the apps with only 5,000 + installs ?

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


Question: List the id of students who attended  statistics courses in the order of attendance date.

SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance

List the i d of students who attended statistics courses in the order of attendance date .

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


Question: What are the id and name of the mountains that have at least 2 photos?

SELECT T1.id ,  T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id  =  T2.mountain_id GROUP BY T1.id HAVING count(*)  >=  2

What are the i d and name of the mountains that have at least 2 photos ?

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


Question: Who are the employees working for publisher not located in USA? State the employee's name and publisher name.

SELECT T1.fname, T1.lname, T2.pub_name FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country != 'USA'

Who are the employees working for publisher not located in USA ? State the employee 's name and publisher name .

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


Question: Find how many school locations have the word 'NY'.

SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"

Find how many school locations have the word ' NY ' .


Question: Which user created post ID 1 and what is the reputation of this user?

SELECT T2.Id, T2.Reputation FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.PostId = 1

Which user created post ID 1 and what is the reputation of this user ?

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


Question: Please list the IDs of all the menus that are DIYs of the restaurant.

SELECT id FROM Menu WHERE sponsor IS NULL

Please list the IDs of all the menus that are DIYs of the restaurant .

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


Question: What is the total capacity of all warehouses?

What is the total capacity of all warehouses ?


Question: State the full name of accountants in the company.

SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Accountant'

State the full name of accountants in the company .


Question: Among all the DB class type citation, which word is the most frequently cited?

SELECT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T2.word_cited_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1

Among all the DB class type citation , which word is the most frequently cited ?

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


Question: What is the name of the affiliation which publishes the greatest number of papers among those whose address contains 'China'.

SELECT T1.name FROM Affiliation AS T1 JOIN Author_list AS T2 ON T1.affiliation_id  =  T2.affiliation_id WHERE T1.address LIKE "%China%" GROUP BY T1.affiliation_id ORDER BY count(*) DESC LIMIT 1

What is the name of the affiliation which publishes the greatest number of papers among those whose address contains ' China ' .

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


Question: Show all customer names with the  payment method code used by least number of customers.

SELECT customer_name FROM Customers WHERE payment_method_code  =  ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)

Show all customer names with the payment method code used by least number of customers .

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


Question: Show the nations that have both hosts older than 45 and hosts younger than 35.

SELECT Nationality FROM HOST WHERE Age  >  45 INTERSECT SELECT Nationality FROM HOST WHERE Age  <  35

Show the nations that have both hosts older than 45 and hosts younger than 35 .

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


Question: Indicate the fax of the company Blondesddsl pre et fils in Strasbourg city.

SELECT Fax FROM Customers WHERE CompanyName = 'Blondesddsl pre et fils' AND City = 'Strasbourg'

Indicate the fax of the company Blondesddsl pre et fils in Strasbourg city .

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


Question: What is the percentage of users who are in the same behavior category as "Academic Information"?

SELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id

What is the percentage of users who are in the same behavior category as " Academic Information " ?

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


Question: Among the cars produced in year 1973, how many of the cars have horsepower less than 100?

SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1973 AND T1.horsepower < 100

Among the cars produced in year 1973 , how many of the cars have horsepower less than 100 ?

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


Question: What are all meeting outcomes and purposes?

SELECT meeting_outcome ,  purpose_of_meeting FROM meetings

What are all meeting outcomes and purposes ?


Question: How many of the businesses are active?

SELECT COUNT(business_id) FROM Business WHERE active LIKE 'True'


Question: How many movies did Universal Studios release?

SELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Universal Studios'

How many movies did Universal Studios release ?

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


Question: What are the names of all authors who have more than 50 papers?

SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id  =  T2.author_id GROUP BY T1.author_id HAVING count(*)  >  50

What are the names of all authors who have more than 50 papers ?

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


Question: What is the name of the bank branch that has lended the largest total amount in loans, specifically 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 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1

What is the name of the bank branch that has lended the largest total amount in loans , specifically to customers with credit scores below 100 ?

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


Question: Among all the tweets with a positive sentiment, how many of them were posted by male users in Australia?

SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.Country = 'Australia' AND T3.Gender = 'Male' AND T1.Sentiment > 0

Among all the tweets with a positive sentiment , how many of them were posted by male users in Australia ?

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


Question: Name the country with the largest number of households in a residential area.

SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households DESC LIMIT 1

Name the country with the largest number of households in a residential area .

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


Question: How many people work in the finance department?

SELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T1.Name = 'Finance'

How many people work in the finance department ?


Question: List the the address details and the biographical information of the students.

SELECT T1.address_details ,  T3.bio_data FROM Addresses AS T1 JOIN Students_Addresses AS T2 ON T1.address_id  =  T2.address_id JOIN Students AS T3 ON T2.student_id  =  T3.student_id

List the the address details and the biographical information of the students .

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


Question: Find the number of vocal types used in song "Demon Kitty Rag"?

SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Demon Kitty Rag"

Find the number of vocal types used in song " Demon Kitty Rag " ?

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


Question: What are the first name and last name of Linda Smith's advisor?

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

What are the first name and last name of Linda Smith 's advisor ?

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


Question: What is the highest profit order in the East superstore of customers from Houston, Texas?

SELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1

What is the highest profit order in the East superstore of customers from Houston , Texas ?

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


Question: Which country produced the highest number of cars? Calculate the annual average number of cars that the said country produced from the very start to the present.

SELECT T2.country, CAST(COUNT(T1.ID) AS REAL) / COUNT(DISTINCT T1.model_year) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin GROUP BY T2.country ORDER BY COUNT(T2.country) DESC LIMIT 1

Which country produced the highest number of cars ? Calculate the annual average number of cars that the said country produced from the very start to the present .

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


Question: How many different bike ids are there?

SELECT count(DISTINCT bike_id) FROM trip


Question: Which player who showed as the third goalie in a game has the biggest weight? Give the full name of the player.

SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.stint = 3 ORDER BY T1.weight DESC LIMIT 1

Which player who showed as the third goalie in a game has the biggest weight ? Give the full name of the player .

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


Question: Calculate the percentage of the total number of current female legislators and past female legislators. State which one has the highest value.

SELECT CAST(COUNT(CASE WHEN current.gender_bio = 'F' THEN current.bioguide_id ELSE NULL END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN historical.gender_bio = 'F' THEN historical.bioguide_id ELSE NULL END) FROM historical ) FROM current

Calculate the percentage of the total number of current female legislators and past female legislators . State which one has the highest value .

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


Question: Which toxic element can be found in the molecule TR151?

SELECT DISTINCT T.element FROM atom AS T WHERE T.molecule_id = 'TR151'

Which toxic element can be found in the molecule TR151 ?

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


Question: How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters?

SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195

How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters ?

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


Question: Among the books published by Birlinn in 2008, how many books have pages around 600 to 700?

SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Birlinn' AND STRFTIME('%Y', T1.publication_date) = '2008' AND T1.num_pages BETWEEN 600 AND 700

Among the books published by Birlinn in 2008 , how many books have pages around 600 to 700 ?

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


Question: What is the phone number and extension number for the school with the zip code 95203-3704? Indicate the school's name.

SELECT Phone, Ext, School FROM schools WHERE Zip = '95203-3704'

What is the phone number and extension number for the school with the zip code 95203 - 3704 ? Indicate the school 's name .

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


Question: List out the country name of lower earning countries

SELECT DISTINCT T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Low income'


Question: List down the name of dishes from menu created in April.

SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE SUBSTR(T1.created_at, 7, 1) = '4'

List down the name of dishes from menu created in April .

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


Question: What are the addresses, towns, and county information for all customers who live in the United States?

SELECT address_line_1 ,  town_city ,  county FROM Customers WHERE Country  =  'USA'

What are the addresses , towns , and county information for all customers who live in the United States ?

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


Question: Show the starting years shared by technicians from team "CLE" and "CWS".

SELECT Starting_Year FROM technician WHERE Team  =  "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team  =  "CWS"

Show the starting years shared by technicians from team " CLE " and " CWS " .

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


Question: In which city was the game held where the oldest competitor participated?

SELECT T4.city_name FROM games_competitor AS T1 INNER JOIN games AS T2 ON T1.games_id = T2.id INNER JOIN games_city AS T3 ON T1.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id ORDER BY T1.age DESC LIMIT 1

In which city was the game held where the oldest competitor participated ?

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


Question: What are the other account details for the account with the name 338?

SELECT other_account_details FROM Accounts WHERE account_name  =  "338"

What are the other account details for the account with the name 338 ?

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


Question: What are the names of  paintings and scupltures created between 1900 and 1950?

SELECT title FROM paintings WHERE YEAR BETWEEN 1900 AND 1950 UNION SELECT title FROM sculptures WHERE YEAR BETWEEN 1900 AND 1950

What are the names of paintings and scupltures created between 1900 and 1950 ?

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


Question: How many solution path does the repository with 111 stars, 58 forks, and 111 watchers?

SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 111 AND T1.Forks = 58 AND T1.Watchers = 111

How many solution path does the repository with 111 stars , 58 forks , and 111 watchers ?

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


Question: Among the cities with alias St Thomas, provide the type of postal point for each city.

SELECT DISTINCT T2.type FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'St Thomas'

Among the cities with alias St Thomas , provide the type of postal point for each city .

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


Question: What is detail of the student who most recently registered course?

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 is detail of the student who most recently registered course ?


Question: How many tweets are in English?

SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'


Question: In which city is the sea whose depth is 4232 meters less than that of the Bay of Bengal?

SELECT T2.City FROM sea AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Sea INNER JOIN city AS T3 ON T3.Name = T2.City WHERE ( SELECT Depth FROM sea WHERE Name LIKE '%Bengal%' ) - T1.Depth = 4235

In which city is the sea whose depth is 4232 meters less than that of the Bay of Bengal ?

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


Question: Who is the supplier of the product with the highest unit price?

SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )

Who is the supplier of the product with the highest unit price ?

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


Question: Please list the names of all the products whose supplier is in Japan.

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

Please list the names of all the products whose supplier is in Japan .

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


Question: Which website should I go to if I want to know more about Anthony Davidson?

SELECT url FROM drivers WHERE forename = 'Anthony' AND surname = 'Davidson'

Which website should I go to if I want to know more about Anthony Davidson ?

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


Question: Show the name of the party that has at least two records.

SELECT Party FROM party GROUP BY Party HAVING COUNT(*)  >=  2

Show the name of the party that has at least two records .


Question: Among all the Olympic competitors from Finland, how many of them are female?

SELECT COUNT(T3.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 = 'Finland' AND T3.gender = 'F'

Among all the Olympic competitors from Finland , how many of them are female ?

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


Question: Return the unique boat ids (bid) of all reserved boats.

Return the unique boat ids ( bid ) of all reserved boats .


Question: List the name of the films that can only be found in store id 2.

SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2

List the name of the films that can only be found in store i d 2 .

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


Question: For all the games ended up with 1-1, what percentage of them are from Liga NOS division?

SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1

For all the games ended up with 1 - 1 , what percentage of them are from Liga NOS division ?

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


Question: Please list the names of the publishers of all the puzzle games.

SELECT DISTINCT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle'

Please list the names of the publishers of all the puzzle games .

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


Question: List the price of Ford cars from model 1970 to 1980.

SELECT DISTINCT T3.price FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID WHERE T1.car_name LIKE 'ford%' AND T2.model_year BETWEEN 1970 AND 1980

List the price of Ford cars from model 1970 to 1980 .

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


Question: Show all book isbns and the total amount ordered for each.

SELECT isbn ,  sum(amount) FROM Books_Order GROUP BY isbn

Show all book isbns and the total amount ordered for each .


Question: Among the employee names, what is the most common middle initial?

SELECT MiddleInitial FROM Employees GROUP BY MiddleInitial ORDER BY COUNT(MiddleInitial) DESC LIMIT 1

Among the employee names , what is the most common middle initial ?

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


Question: Which people severed as comptroller most frequently? Give me the name of the person and the frequency count.

SELECT Comptroller ,  COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1

Which people severed as comptroller most frequently ? Give me the name of the person and the frequency count .

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


Question: Find the name of airline which runs the most number of routes.

SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid  =  T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1

Find the name of airline which runs the most number of routes .

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


Question: How many donors in Los Angeles donated to school in another city?

SELECT COUNT(T2.schoolid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_city = 'Los Angeles' AND T2.school_city NOT LIKE 'Los Angeles'

How many donors in Los Angeles donated to school in another city ?

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


Question: What are the names of the collections that are not the parent of the other collections?

SELECT Collection_Name FROM Collections EXCEPT SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID;

What are the names of the collections that are not the parent of the other collections ?

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


Question: Give all the bounding boxes for image 2222 whose object classes are feathers.

SELECT T2.X, T2.Y, T2.H, T2.W FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2222 AND T1.OBJ_CLASS = 'feathers'

Give all the bounding boxes for image 2222 whose object classes are feathers .

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


Question: List all budget type codes and descriptions.

SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes

List all budget type codes and descriptions .

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


Question: Among the seafood products, which product have the highest total production of the production?

SELECT T1.ProductName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.CategoryName = 'Seafood' ORDER BY T1.UnitsInStock + T1.UnitsOnOrder DESC LIMIT 1

Among the seafood products , which product have the highest total production of the production ?

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


Question: Who is the vendor of the resources needed by the project that had the highest cost of optional tip?

SELECT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T2.total_price_including_optional_support - T2.total_price_including_optional_support DESC LIMIT 1

Who is the vendor of the resources needed by the project that had the highest cost of optional tip ?

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


Question: How many people were not credited at the end of the "Admissions" episode?

SELECT COUNT(T2.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Admissions' AND T2.credited = 'false'

How many people were not credited at the end of the " Admissions " episode ?

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


Question: What is the savings balance of the account belonging to the customer with the highest checking balance?

SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance DESC LIMIT 1

What is the savings balance of the account belonging to the customer with the highest checking balance ?

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


Question: What are the average rhythm scores for the songs in each different language?

SELECT avg(T2.rhythm_tempo) ,  T1.language FROM songs AS T1 JOIN performance_score AS T2 ON T2.songs_id  =  T1.id GROUP BY T1.language

What are the average rhythm scores for the songs in each different language ?

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


Question: Among the patients have blood clots in veins, how many of them have a normal level of complement 4?

SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.C4 > 10 AND T1.Diagnosis = 'APS'

Among the patients have blood clots in veins , how many of them have a normal level of complement 4 ?

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


Question: Show the provinces that have both institutions founded before 1920 and institutions founded after 1950.

SELECT Province FROM institution WHERE Founded  <  1920 INTERSECT SELECT Province FROM institution WHERE Founded  >  1950

Show the provinces that have both institutions founded before 1920 and institutions founded after 1950 .

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


Question: List all races in 2017 and the hosting country order by date of the event.

SELECT DISTINCT T2.name, T1.country FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2017 ORDER BY T2.date ASC

List all races in 2017 and the hosting country order by date of the event .

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


Question: Return the description of the document type name 'Film'.

SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"

Return the description of the document type name ' Film ' .

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


Question: What are all the different contents stored in boxes in New York?

SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE LOCATION  =  'New York'

What are all the different contents stored in boxes in New York ?

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


Question: How many attribute classes are there for image id 5?

SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 5

How many attribute classes are there for image i d 5 ?

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


Question: How many rooms whose capacity is less than 50 does the Lamberton building have?

SELECT count(*) FROM classroom WHERE building  =  'Lamberton' AND capacity  <  50

How many rooms whose capacity is less than 50 does the Lamberton building have ?

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


Question: What are the names of enzymes who does not produce 'Heme'?

SELECT name FROM enzyme WHERE product != 'Heme'

What are the names of enzymes who does not produce ' Heme ' ?

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


Question: Find the number of distinct types of contents in each warehouse.

SELECT count(DISTINCT CONTENTS) ,  warehouse FROM boxes GROUP BY warehouse

Find the number of distinct types of contents in each warehouse .


Question: What is the average enrollment of schools?

What is the average enrollment of schools ?


Question: What are the average amount purchased and value purchased for the supplier who supplies the most products.

SELECT avg(total_amount_purchased) ,  avg(total_value_purchased) FROM Product_Suppliers WHERE supplier_id  =  (SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id ORDER BY count(*) DESC LIMIT 1)

What are the average amount purchased and value purchased for the supplier who supplies the most products .

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


Question: Show the start dates and end dates of all the apartment bookings.

SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings

Show the start dates and end dates of all the apartment bookings .


Question: How many matches have Mumbai Indians won?

SELECT SUM(CASE WHEN T2.Team_Name = 'Mumbai Indians' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner

How many matches have Mumbai Indians won ?


Question: What are the names of all instructors with a higher salary than any of the instructors in the Biology department?

SELECT name FROM instructor WHERE salary  >  (SELECT max(salary) FROM instructor WHERE dept_name  =  'Biology')

What are the names of all instructors with a higher salary than any of the instructors in the Biology department ?

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


Question: What is the average of English books among all books published by Carole Marsh Mysteries?

SELECT CAST(SUM(CASE WHEN T1.language_name = 'English' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T3.publisher_name = 'Carole Marsh Mysteries'

What is the average of English books among all books published by Carole Marsh Mysteries ?

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


Question: What are the ids of all students and number of hours played?

SELECT Stuid ,  sum(hours_played) FROM Plays_games GROUP BY Stuid

What are the ids of all students and number of hours played ?

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


Question: Find the number of headphones with a price higher than 200 for each class.

SELECT count(*) ,  CLASS FROM headphone WHERE price  >  200 GROUP BY CLASS

Find the number of headphones with a price higher than 200 for each class .

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