Question: Please list the names of the authors of the paper "Hypermethylation of the <I>TPEF/HPP1</I> Gene in Primary and Metastatic Colorectal Cancers".

SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Hypermethylation of the <I>TPEF/HPP1</I> Gene in Primary and Metastatic Colorectal Cancers'

Please list the names of the authors of the paper " Hypermethylation of the < I > TPEF / HPP1</I > Gene in Primary and Metastatic Colorectal Cancers " .

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


Question: How many faculty members are at the university that gave the least number of degrees in 2001?

SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  t2.campus JOIN degrees AS T3 ON T1.id  =  t3.campus AND t2.year  =  t3.year WHERE t2.year  =  2001 ORDER BY t3.degrees LIMIT 1

How many faculty members are at the university that gave the least number of degrees in 2001 ?

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


Question: Describe the supplier companies, cities and products which total production amount is more than 120.

SELECT T2.CompanyName, T2.City, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock + UnitsOnOrder > 120

Describe the supplier companies , cities and products which total production amount is more than 120 .

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


Question: What was the mean humidity of a trip with id 4275?

SELECT T2.mean_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.id = 4275

What was the mean humidity of a trip with i d 4275 ?

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


Question: How many male and female assistant professors do we have?

SELECT sex ,  count(*) FROM Faculty WHERE rank  =  "AsstProf" GROUP BY sex

How many male and female assistant professors do we have ?

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


Question: How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10?

SELECT ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 6 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 )

How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10 ?

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


Question: How many films have a rental duration of over 6 days?

SELECT COUNT(film_id) FROM film WHERE rental_duration > 6

How many films have a rental duration of over 6 days ?

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


Question: What are the name, latitude, and city of the station with the lowest latitude?

SELECT name ,  lat ,  city FROM station ORDER BY lat LIMIT 1

What are the name , latitude , and city of the station with the lowest latitude ?

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


Question: Calculate the average duration of absense of disabled male students.

SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name INNER JOIN male AS T3 ON T3.name = T2.name

Calculate the average duration of absense of disabled male students .


Question: Count the number of different payment method codes used by parties.

SELECT count(DISTINCT payment_method_code) FROM parties

Count the number of different payment method codes used by parties .


Question: How many transactions had Frank-Paul Santangelo made in July, 2014?

SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'

How many transactions had Frank - Paul Santangelo made in July , 2014 ?

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


Question: List by name all the games released in the year 2010.

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 WHERE T3.release_year = '2010'

List by name all the games released in the year 2010 .

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


Question: Show agency ids and details with at least 2 clients.

SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id HAVING count(*)  >=  2

Show agency ids and details with at least 2 clients .


Question: Which different vendor has the most amount of orders? Calculate the total estimated earnings.

SELECT DISTINCT T1.productVendor, T1.MSRP - T1.buyPrice FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode GROUP BY T1.productVendor, T1.MSRP, T1.buyPrice ORDER BY COUNT(T2.quantityOrdered) DESC LIMIT 1

Which different vendor has the most amount of orders ? Calculate the total estimated earnings .

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


Question: Please list the IDs of the professors that teaches more than 3 courses.

SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id HAVING COUNT(DISTINCT T1.course_id) > 3

Please list the IDs of the professors that teaches more than 3 courses .

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


Question: What are all the instruments used?

SELECT DISTINCT instrument FROM Instruments


Question: List all the dates of the urgent orders.

SELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT'

List all the dates of the urgent orders .


Question: What are the invoice statuses for all orderes that have not been shipped out yet?

SELECT invoice_status_code FROM Invoices WHERE invoice_number NOT IN ( SELECT invoice_number FROM Shipments )

What are the invoice statuses for all orderes that have not been shipped out yet ?

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


Question: Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound.

SELECT T2.date, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T1.primary_description = 'DECEPTIVE PRACTICE' AND T1.secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'

Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound .

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


Question: Compute the average salary of the players in the team called 'Boston Red Stockings'.

SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings'

Compute the average salary of the players in the team called ' Boston Red Stockings ' .

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


Question: Show all different home cities.


Question: What is the number of SAT test takers of the schools with the highest FRPM count for K-12 students?

SELECT NumTstTakr FROM satscores WHERE cds = ( SELECT CDSCode FROM frpm ORDER BY `FRPM Count (K-12)` DESC LIMIT 1 )

What is the number of SAT test takers of the schools with the highest FRPM count for K-12 students ?

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


Question: Among the lists with at least one follower, how many were created by user who was subscriber when created the list?

SELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.user_subscriber = 1

Among the lists with at least one follower , how many were created by user who was subscriber when created the list ?

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


Question: Which film has the highest rental rate? And what is the rate?

SELECT title ,  rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1

Which film has the highest rental rate ? And what is the rate ?

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


Question: What is the average and largest salary of all employees?

SELECT avg(salary) ,  max(salary) FROM Employee

What is the average and largest salary of all employees ?


Question: How long does business number 12 in Scottsdale stay open on day number 3?

SELECT T2.closing_time - T2.opening_time AS "hour" FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.business_id = 12 AND T1.city LIKE 'Scottsdale' AND T2.day_id = 3

How long does business number 12 in Scottsdale stay open on day number 3 ?

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


Question: How many territories are there in the Eastern region?

SELECT COUNT(T1.RegionID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'

How many territories are there in the Eastern region ?


Question: Which apps have multiple genres and what is the total sentiment subjectivity of these apps?

SELECT SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres > 1

Which apps have multiple genres and what is the total sentiment subjectivity of these apps ?

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


Question: Count the number of cities in the state of Colorado.

SELECT count(*) FROM addresses WHERE state_province_county  =  "Colorado"

Count the number of cities in the state of Colorado .


Question: What is the code of the product type with an average price higher than the average price of all products?

SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price)  >  (SELECT avg(product_price) FROM products)

What is the code of the product type with an average price higher than the average price of all products ?

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


Question: Find the names of the campus which has more faculties in 2002 than every campus in Orange county.

SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND faculty  >  (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND T1.county  =  "Orange")

Find the names of the campus which has more faculties in 2002 than every campus in Orange county .

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


Question: What is the average cost of root beers purchased for more than 2 dollars and sold in bottles?

SELECT AVG(T2.PurchasePrice) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T1.ContainerType = 'Bottle' AND T2.PurchasePrice > 2

What is the average cost of root beers purchased for more than 2 dollars and sold in bottles ?

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


Question: What percentage of male patients who first presented to the hospital in 1981 were diagnosed with BEHCET?

SELECT CAST(SUM(CASE WHEN Diagnosis = 'BEHCET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(ID) FROM Patient WHERE STRFTIME('%Y', `First Date`) = '1981' AND SEX = 'M'

What percentage of male patients who first presented to the hospital in 1981 were diagnosed with BEHCET ?

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


Question: Return the number of rooms with each different room size.

SELECT room_size ,  count(*) FROM Rooms GROUP BY room_size

Return the number of rooms with each different room size .

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


Question: Among the most popular professors, how many are females?

SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' AND popularity = ( SELECT MAX(popularity) FROM prof )

Among the most popular professors , how many are females ?

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


Question: Compute the average age of the members in the club "Tennis Club".

SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid  =  t2.clubid JOIN student AS t3 ON t2.stuid  =  t3.stuid WHERE t1.clubname  =  "Tennis Club"

Compute the average age of the members in the club " Tennis Club " .

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


Question: What are the highest salary earn by the the employee and what is his/her position in the company?

SELECT Salary, Title FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )

What are the highest salary earn by the the employee and what is his / her position in the company ?

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


Question: How many dorms have amenities?

SELECT count(DISTINCT dormid) FROM has_amenity


Question: Calculate the percentage of male users among all device users.

SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age

Calculate the percentage of male users among all device users .


Question: List the last name of members with a major in environmental engineering and include its department and college name.

SELECT T2.last_name, T1.department, T1.college FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Member' AND T1.major_name = 'Environmental Engineering'

List the last name of members with a major in environmental engineering and include its department and college name .

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


Question: How many tags have post count between 5,000 to 7,000?

SELECT COUNT(Id) FROM tags WHERE Count BETWEEN 5000 AND 7000

How many tags have post count between 5,000 to 7,000 ?

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


Question: How many stars did Urijah Faber rate for Frostie?

SELECT T2.StarRating FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie'

How many stars did Urijah Faber rate for Frostie ?


Question: What is the most common type of compliments that a user has received from other users?

SELECT T2.compliment_type FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id GROUP BY T2.compliment_type ORDER BY COUNT(T2.compliment_type) DESC LIMIT 1

What is the most common type of compliments that a user has received from other users ?

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


Question: How many universities had over 30000 students in 2011?

SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 30000

How many universities had over 30000 students in 2011 ?

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


Question: Show the description for role name "Proof Reader".

SELECT role_description FROM ROLES WHERE role_name  =  "Proof Reader"

Show the description for role name " Proof Reader " .

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


Question: How many menus were created for steamship?

SELECT COUNT(*) FROM Menu WHERE venue = 'STEAMSHIP'

How many menus were created for steamship ?


Question: List the distinct police forces of counties whose location is not on east side.

SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != "East"

List the distinct police forces of counties whose location is not on east side .

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


Question: Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?

SELECT country FROM stadium WHERE capacity  >  60000 INTERSECT SELECT country FROM stadium WHERE capacity  <  50000

Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000 ?

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


Question: Which country has the University of SÃ£o Paulo?

SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'University of São Paulo'

Which country has the University of SÃ£o Paulo ?

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


Question: What are the names, cities, and states of all universities in alphabetical order (by name of the university).

SELECT university_name ,  city ,  state FROM University ORDER BY university_name

What are the names , cities , and states of all universities in alphabetical order ( by name of the university ) .

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


Question: Find the name of the person who has friends with age above 40 but not under age 30?

SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  >  40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name  =  T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age  <  30)

Find the name of the person who has friends with age above 40 but not under age 30 ?

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


Question: Which molecules have triple bonds and list all the elements they contain.

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

Which molecules have triple bonds and list all the elements they contain .

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


Question: Which product are listed in orders most frequently? List the id, product name and price.

SELECT T1.product_id ,  T1.product_name ,  T1.product_price FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id ORDER BY count(*) DESC LIMIT 1

Which product are listed in orders most frequently ? List the i d , product name and price .

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


Question: How many crew have their own nickname? List their full name along with the nickname.

SELECT COUNT(name) FROM Person WHERE nickname IS NOT NULL;

How many crew have their own nickname ? List their full name along with the nickname .

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


Question: How many goods are available for each food type?

SELECT count(*) ,  food FROM goods GROUP BY food

How many goods are available for each food type ?


Question: How many times has the student Linda Smith visited Subway?

SELECT count(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway";

How many times has the student Linda Smith visited Subway ?

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


Question: How many docks were left at the end station for trip ID4069?

SELECT SUM(T2.docks_available) FROM trip AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.end_station_id WHERE T1.ID = 4069

How many docks were left at the end station for trip ID4069 ?

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


Question: How many eliminations did each team have?

SELECT Team ,  COUNT(*) FROM elimination GROUP BY Team

How many eliminations did each team have ?


Question: Show names of companies and that of employees in descending order of number of years working for that employee.

SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID ORDER BY T1.Year_working

Show names of companies and that of employees in descending order of number of years working for that employee .

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


Question: Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?

SELECT SUM(CASE WHEN T1.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 end)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'

Among the trains that run in the east direction , how many of them have at least one car in a non - regular shape ?

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


Question: Among the films directed by directors who direct the best, how many of them have an average rating of over 3.5?

SELECT COUNT(*) FROM ( SELECT DISTINCT T2.movieid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.d_quality = 5 GROUP BY T2.movieid HAVING AVG(T3.rating) > 3.5 ) AS T1

Among the films directed by directors who direct the best , how many of them have an average rating of over 3.5 ?

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


Question: What are the total and average enrollment of all schools?

SELECT sum(enrollment) ,  avg(enrollment) FROM school

What are the total and average enrollment of all schools ?


Question: Which user added a bounty amount of 50 to the post title mentioning variance?

SELECT T3.DisplayName, T1.Title FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId INNER JOIN users AS T3 ON T3.Id = T2.UserId WHERE T2.BountyAmount = 50 AND T1.Title LIKE '%variance%'

Which user added a bounty amount of 50 to the post title mentioning variance ?

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


Question: Of the 10 products with the highest unit price, identify by their ID the ones that have generated the least satisfaction.

SELECT ProductID FROM Products ORDER BY ReorderLevel ASC, UnitPrice DESC LIMIT 1

Of the 10 products with the highest unit price , identify by their ID the ones that have generated the least satisfaction .

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


Question: How many of the crimes that happened in the street have FBI title "Homicide 1st & 2nd Degree"?

SELECT SUM(CASE WHEN T2.location_description = 'STREET' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'

How many of the crimes that happened in the street have FBI title " Homicide 1st & 2nd Degree " ?

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


Question: Name all students enlisted in the foreign legion.

SELECT name FROM enlist WHERE organ = 'foreign_legion'

Name all students enlisted in the foreign legion .

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


Question: Find the numbers of different majors and cities.

SELECT count(DISTINCT major) ,  count(DISTINCT city_code) FROM student

Find the numbers of different majors and cities .


Question: How many staff does each project has? List the project id and the number in an ascending order.

SELECT T1.project_id ,  count(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id ORDER BY count(*) ASC

How many staff does each project has ? List the project i d and the number in an ascending order .

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


Question: What are the names of the technicians aged either 36 or 37?

SELECT Name FROM technician WHERE Age  =  36 OR Age  =  37

What are the names of the technicians aged either 36 or 37 ?

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


Question: List at least 15 phone models released under the OPPO brand.

SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15

List at least 15 phone models released under the OPPO brand .

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


Question: How many menus sponsored by Krogs Fiske Restaurant were created in April 2015?

SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant'

How many menus sponsored by Krogs Fiske Restaurant were created in April 2015 ?

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


Question: How many games were sold on the DS platform on average in the 4 different regions?

SELECT SUM(T1.num_sales) * 100000 / 4 FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T3.platform_name = 'DS'

How many games were sold on the DS platform on average in the 4 different regions ?

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


Question: Show the ministers and the time they took and left office, listed by the time they left office.

SELECT minister ,  took_office ,  left_office FROM party ORDER BY left_office

Show the ministers and the time they took and left office , listed by the time they left office .

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


Question: What are the first name and last name of the players whose death record is empty?

SELECT name_first ,  name_last FROM player WHERE death_year = '';

What are the first name and last name of the players whose death record is empty ?

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


Question: Find the receipt numbers where both Cake and Cookie were bought.

SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cake" INTERSECT SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item  =  T2.id WHERE T2.food  =  "Cookie"

Find the receipt numbers where both Cake and Cookie were bought .

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


Question: Describe the inspection types and violation descriptions under moderate risk category for ART's CAFÉ.

SELECT DISTINCT T2.type, T1.description FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'ART''S CAFÉ' AND T1.risk_category = 'Moderate Risk'

Describe the inspection types and violation descriptions under moderate risk category for ART 's CAFÉ .

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


Question: Which course is more difficult, Intro to BlockChain or Computer Network?

SELECT name FROM course WHERE name = 'Intro to BlockChain' OR name = 'Computer Network' ORDER BY diff DESC LIMIT 1

Which course is more difficult , Intro to BlockChain or Computer Network ?

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


Question: Look for the movie title with the keyword of "angel".

SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'angel'

Look for the movie title with the keyword of " angel " .

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


Question: How many different instructors have taught some course?

How many different instructors have taught some course ?


Question: Among the female customers with an level of education of 3 and below, list their income.

SELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND SEX = 'Female' )

Among the female customers with an level of education of 3 and below , list their income .

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


Question: What was the overall rating for Aaron Mooy on 2016/2/4?

SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-02-04' AND t1.player_name = 'Aaron Mooy'

What was the overall rating for Aaron Mooy on 2016/2/4 ?

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


Question: Find the team of the player of the highest age.

SELECT Team FROM player ORDER BY Age DESC LIMIT 1

Find the team of the player of the highest age .

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


Question: List the name and gender for all artists who released songs in March.

SELECT T1.artist_name ,  T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T2.releasedate LIKE "%Mar%"

List the name and gender for all artists who released songs in March .

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


Question: What are the functions of the pair of genes that have the lowest expression correlation score?a

SELECT T1.Function FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 ORDER BY T2.Expression_Corr ASC LIMIT 1

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


Question: Who is the eldest player and where did he/she come from?

SELECT T1.Player_Name, T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id ORDER BY T1.DOB LIMIT 1

Who is the eldest player and where did he / she come from ?


Question: Calculate the average number of repetitions in the pairs of words in which the first word id is number 34.

SELECT CAST(SUM(CASE WHEN w1st = 34 THEN 1 ELSE 0 END) AS REAL) / COUNT(w1st) FROM biwords

Calculate the average number of repetitions in the pairs of words in which the first word i d is number 34 .

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


Question: Please list any three airports with their codes.

SELECT Code, Description FROM Airports LIMIT 3

Please list any three airports with their codes .


Question: What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?

SELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state

What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186 ?

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


Question: Return the description of the product called "Chocolate".

SELECT product_description FROM products WHERE product_name  =  "Chocolate"

Return the description of the product called " Chocolate " .


Question: Find the names of Japanese constructors that have once earned more than 5 points?

SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5

Find the names of Japanese constructors that have once earned more than 5 points ?

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


Question: What is the name of the brand of the beer with the shortest brewed history?

SELECT BrandName FROM rootbeerbrand ORDER BY FirstBrewedYear DESC LIMIT 1

What is the name of the brand of the beer with the shortest brewed history ?

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


Question: List the authors of submissions in ascending order of scores.

SELECT Author FROM submission ORDER BY Scores ASC

List the authors of submissions in ascending order of scores .

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


Question: What are the name and phone of the customer with the most ordered product quantity?

SELECT  T1.customer_name ,  T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T3.order_id  =  T2.order_id GROUP BY T1.customer_id ORDER BY sum(T3.order_quantity) DESC LIMIT 1

What are the name and phone of the customer with the most ordered product quantity ?

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


Question: What is the number of child documents for each parent document, and what are the ids of the parent documents?

SELECT T2.Document_Object_ID ,  count(*) FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID GROUP BY T2.Document_Object_ID;

What is the number of child documents for each parent document , and what are the ids of the parent documents ?

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


Question: Find the parties associated with the delegates from district 1. Who served as governors of the parties?

SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party  =  T2.Party_ID WHERE T1.District  =  1

Find the parties associated with the delegates from district 1 . Who served as governors of the parties ?

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


Question: Show the season, the player, and the name of the country that player belongs to.

SELECT T2.Season ,  T2.Player ,  T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country

Show the season , the player , and the name of the country that player belongs to .

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


Question: What was the average overall rating for Marko Arnautovic from 2007/2/22 to 2016/4/21?

SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_fifa_api_id = t2.player_fifa_api_id WHERE t1.player_name = 'Marko Arnautovic' AND SUBSTR(t2.`date`, 1, 10) BETWEEN '2007-02-22' AND '2016-04-21'

What was the average overall rating for Marko Arnautovic from 2007/2/22 to 2016/4/21 ?

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


Question: Return the id and full name of the customer who has the fewest accounts.

SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) ASC LIMIT 1

Return the i d and full name of the customer who has the fewest accounts .

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


Question: Find the headphone class that does not contain more than two headphones.

SELECT CLASS FROM headphone GROUP BY CLASS HAVING count(*)  >  2

Find the headphone class that does not contain more than two headphones .

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


Question: How many flights departed on time on 8/1/2018?

SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0

How many flights departed on time on 8/1/2018 ?


Question: Name the shipper which had the most shipments in first quarter of 1998.

SELECT T1.CompanyName FROM Shippers AS T1 INNER JOIN Orders AS T2 ON T1.ShipperID = T2.ShipVia WHERE STRFTIME('%Y', T2.ShippedDate) = '1998' GROUP BY T1.CompanyName ORDER BY COUNT(T2.OrderID) DESC LIMIT 1

Name the shipper which had the most shipments in first quarter of 1998 .


Question: Count the number of courses in the Physics department.

SELECT count(DISTINCT course_id) FROM course WHERE dept_name  =  'Physics'

Count the number of courses in the Physics department .


Question: How many assessment notes are there in total?

How many assessment notes are there in total ?


Question: What are the genres of Sky Captain and the World of Tomorrow?

SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.title = 'Sky Captain and the World of Tomorrow'

What are the genres of Sky Captain and the World of Tomorrow ?

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


Question: Which drivers who were born in 1971 and has the fastest lap time on the race? Give id and code of these drivers.

SELECT T2.driverId, T2.code FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE STRFTIME('%Y', T2.dob) = '1971' AND T1.fastestLapTime IS NOT NULL

Which drivers who were born in 1971 and has the fastest lap time on the race ? Give i d and code of these drivers .

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


Question: What types of vocals are used in the song "Badlands"?

SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands"

What types of vocals are used in the song " Badlands " ?

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


Question: How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?

SELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0

How many ingredients are there in the recipe that is best in helping your body 's natural defence against illness and infection ?

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


Question: Which country is University of Veterinary Medicine Vienna located in? Give its country id.

SELECT country_id FROM university WHERE university_name = 'University of Veterinary Medicine Vienna'

Which country is University of Veterinary Medicine Vienna located in ? Give its country i d.

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


Question: Who are the actors starred in the film "Bound Cheaper"?

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

Who are the actors starred in the film " Bound Cheaper " ?

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


Question: List three countries which are the origins of the least players.

SELECT birth_country FROM player GROUP BY birth_country ORDER BY count(*) ASC LIMIT 3;

List three countries which are the origins of the least players .

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


Question: List the official name and status of the city with the largest population.

SELECT Official_Name ,  Status FROM city ORDER BY Population DESC LIMIT 1

List the official name and status of the city with the largest population .

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


Question: What keyword can the user use to search for the movie Finding Nemo?

SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.title = 'Finding Nemo'

What keyword can the user use to search for the movie Finding Nemo ?

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


Question: the names of models that launched between 2002 and 2004.

SELECT Model_name FROM chip_model WHERE Launch_year BETWEEN 2002 AND 2004;

the names of models that launched between 2002 and 2004 .


Question: List the name of England players.

SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'England'


Question: What is the lowest supply cost for the part "hot spring dodger dim light"?

SELECT MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'

What is the lowest supply cost for the part " hot spring dodger dim light " ?

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


Question: Give the reorder level for the products from the supplier "Nord-Ost-Fisch Handelsgesellschaft mbH".

SELECT T1.ReorderLevel FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Nord-Ost-Fisch Handelsgesellschaft mbH'

Give the reorder level for the products from the supplier " Nord - Ost - Fisch Handelsgesellschaft mbH " .

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


Question: Find the states or counties where the stores with marketing region code "CA" are located.

SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID  =  T2.Address_ID WHERE T2.Marketing_Region_Code  =  "CA"

Find the states or counties where the stores with marketing region code " CA " are located .

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


Question: What is the region of the client with the id 3541 from?

SELECT T1.A3 FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T2.client_id = 3541

What is the region of the client with the i d 3541 from ?

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


Question: What are the payment method codes that have been used by more than 3 parties?

SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*)  >  3

What are the payment method codes that have been used by more than 3 parties ?

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


Question: What is the total number of short cars on all the trains that run in the east direction?

SELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'

What is the total number of short cars on all the trains that run in the east direction ?

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


Question: What is the genre of the game "Grand Theft Auto V"?

SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Grand Theft Auto V'

What is the genre of the game " Grand Theft Auto V " ?

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


Question: How many clients opened their accounts in Jesenik branch were women?

SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T2.A2 = 'Jesenik'

How many clients opened their accounts in Jesenik branch were women ?


Question: How many male users are in the age group of M32-38?

SELECT COUNT(gender) FROM gender_age WHERE gender = 'M' AND `group` = 'M32-38'

How many male users are in the age group of M32 - 38 ?

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


Question: How many departments does the college has?

SELECT count(DISTINCT dept_name) FROM department

How many departments does the college has ?


Question: What is the ids of sailors that haven’t reserved a boat?

SELECT sid FROM Sailors EXCEPT SELECT sid FROM Reserves

What is the ids of sailors that have n’t reserved a boat ?

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


Question: Please list the full names of all the actors that have starred in the film with the highest replacement cost.

SELECT first_name, last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id ORDER BY T3.replacement_cost DESC LIMIT 1

Please list the full names of all the actors that have starred in the film with the highest replacement cost .

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


Question: List first name and last name of customers that have more than 2 payments.

SELECT T2.first_name ,  T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >  2;

List first name and last name of customers that have more than 2 payments .

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


Question: Show all hardware product names with price higher than the average price of hardware type products.

SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" AND product_price  >  (SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Hardware")

Show all hardware product names with price higher than the average price of hardware type products .

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


Question: Which year has the most number of video game releases?

SELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1

Which year has the most number of video game releases ?


Question: What are the names of drivers and the names of the races they took part in?

SELECT T1.Driver_Name ,  T2.Race_Name FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID  =  T2.Driver_ID

What are the names of drivers and the names of the races they took part in ?


Question: List down the product IDs and names that include the word "Outdoor".

SELECT ProductID, T FROM ( SELECT ProductID , CASE  WHEN `Product Name` LIKE '%Outdoor%' THEN `Product Name` ELSE NULL END AS T FROM Products ) WHERE T IS NOT NULL ORDER BY T DESC

List down the product IDs and names that include the word " Outdoor " .

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


Question: Please list the codes of the schools with a total enrollment of over 500.

SELECT T2.CDSCode FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.`Enrollment (K-12)` + T2.`Enrollment (Ages 5-17)` > 500

Please list the codes of the schools with a total enrollment of over 500 .

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


Question: Among the menus in which the dish "Clear green turtle" had appeared, how many of them used the dollar as their currency?

SELECT SUM(CASE WHEN T3.currency = 'Dollars' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle'

Among the menus in which the dish " Clear green turtle " had appeared , how many of them used the dollar as their currency ?

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


Question: Please list all first and last names of clients who live in New York city.

SELECT first, last FROM client WHERE city = 'New York City'

Please list all first and last names of clients who live in New York city .

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


Question: Average cost of purchase orders made during the first six months of 2012.

SELECT CAST(SUM(ActualCost) AS REAL) / COUNT(TransactionID) FROM TransactionHistoryArchive WHERE TransactionType = 'P' AND TransactionDate >= '2012-01-01' AND TransactionDate < '2012-07-01'

Average cost of purchase orders made during the first six months of 2012 .

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


Question: How many orders have asked for the product Tofu?

SELECT COUNT(T2.OrderID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Tofu'

How many orders have asked for the product Tofu ?

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


Question: List the phone number of the customer who placed orders with a total price of more than $300,000.

SELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000

List the phone number of the customer who placed orders with a total price of more than $ 300,000 .

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


Question: How many documents can one grant have at most? List the grant id and number.

SELECT grant_id ,  count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1

How many documents can one grant have at most ? List the grant i d and number .

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


Question: List the names of camera supervisors in the crew.

SELECT T1.person_name FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T2.job = 'Camera Supervisor'

List the names of camera supervisors in the crew .

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


Question: List the customer's ID and last name of the customer that purchased a product with a quantity greater than 90% of the average quantity of all listed products.

SELECT T2.CustomerID, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity > ( SELECT AVG(Quantity) FROM Sales ) * 0.9

List the customer 's ID and last name of the customer that purchased a product with a quantity greater than 90 % of the average quantity of all listed products .

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


Question: What are the names of the products that were discountinued?

SELECT ProductName FROM Products WHERE Discontinued = 1

What are the names of the products that were discountinued ?


Question: What is the minimum salary in each department?

SELECT MIN(salary) ,  department_id FROM employees GROUP BY department_id

What is the minimum salary in each department ?


Question: Which customer is a regular customer in this shop and what are the products category that he mostly buy?

SELECT T1.CustomerID, T4.CategoryName FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID INNER JOIN Categories AS T4 ON T3.CategoryID = T4.CategoryID ORDER BY T1.CustomerID DESC, T4.CategoryName DESC

Which customer is a regular customer in this shop and what are the products category that he mostly buy ?

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


Question: Which nations have a 100% Spanish-speaking population?

SELECT Country FROM language WHERE Name = 'Spanish' AND Percentage = 100

Which nations have a 100 % Spanish - speaking population ?

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


Question: When did event number 2 happen and how many users were active?

SELECT COUNT(T1.app_id) AS num FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 2 AND T1.is_active = 1 GROUP BY T2.timestamp

When did event number 2 happen and how many users were active ?

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


Question: Which school have the highest student enrollment? How many of those students are filed for bankruptcy?

SELECT T.school, num FROM ( SELECT T1.school, COUNT(T2.name) AS num FROM enrolled AS T1 LEFT JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name GROUP BY T1.school ) T ORDER BY T.num DESC LIMIT 1

Which school have the highest student enrollment ? How many of those students are filed for bankruptcy ?

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


Question: Who is the player who won the first ever "man of the match" award?

SELECT Player_Name FROM Player WHERE Player_Id = ( SELECT Man_of_the_Match FROM `Match` ORDER BY match_date ASC LIMIT 1 )

Who is the player who won the first ever " man of the match " award ?

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


Question: Show the shop addresses ordered by their opening year.

SELECT address FROM shop ORDER BY open_year

Show the shop addresses ordered by their opening year .


Question: What are names of stations that have average bike availability above 10 and are not located in San Jose city?

SELECT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id  =  T2.station_id GROUP BY T2.station_id HAVING avg(bikes_available)  >  10 EXCEPT SELECT name FROM station WHERE city  =  "San Jose"

What are names of stations that have average bike availability above 10 and are not located in San Jose city ?

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


Question: Provide the country, population, capital city, and official language of the country with the smallest surface area.

SELECT T1.Name, T1.Population, T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.SurfaceArea LIMIT 1

Provide the country , population , capital city , and official language of the country with the smallest surface area .

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


Question: When did Mrs. Joye Homenick receive her most recent influenza seasonal vaccine?

SELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza  seasonal  injectable  preservative free' AND T1.first = 'Joye' AND T1.last = 'Homenick' ORDER BY T2.DATE DESC LIMIT 1

When did Mrs. Joye Homenick receive her most recent influenza seasonal vaccine ?


Question: Find the id and title of the papers that are never cited by others.

SELECT paper_id ,  title FROM Paper WHERE paper_id NOT IN (SELECT cited_paper_id FROM Citation)

Find the i d and title of the papers that are never cited by others .

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


Question: Count the number of ships.


Question: How many title's crew members are working from Casting Department?

SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.category = 'Casting Department';

How many title 's crew members are working from Casting Department ?


Question: Please check if student 124 is disabled male.

SELECT IIF(T2.name IS NULL, 'female', 'male') FROM male AS T1 LEFT JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.name = 'student124'

Please check if student 124 is disabled male .

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


Question: What is the id and family name of the driver who has the longest laptime?

SELECT T1.driverid ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1

What is the i d and family name of the driver who has the longest laptime ?

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


Question: For users with average ratings of 3, what kind of tip length they mostly left?

SELECT T2.tip_length FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T1.user_average_stars = 3 GROUP BY T2.tip_length ORDER BY COUNT(T2.tip_length) DESC LIMIT 1

For users with average ratings of 3 , what kind of tip length they mostly left ?

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


Question: What are the alias of the cities with 0 population in 2010?

SELECT DISTINCT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 = 0

What are the alias of the cities with 0 population in 2010 ?

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


Question: What are the id of songs whose format is mp3.

SELECT f_id FROM files WHERE formats  =  "mp3"

What are the i d of songs whose format is mp3 .

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


Question: What is the examination date of the patient whose albumin is the highest in the normal range?

SELECT Date FROM Laboratory WHERE ALB > 3.5 AND ALB < 5.5 ORDER BY ALB DESC LIMIT 1

What is the examination date of the patient whose albumin is the highest in the normal range ?

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


Question: Who is the Sales Agent for the company 'Eastern Connection'?

SELECT ContactName FROM Customers WHERE CompanyName = 'Eastern Connection' AND ContactTitle = 'Sales Agent'

Who is the Sales Agent for the company ' Eastern Connection ' ?

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


Question: Show all product names and the number of customers having an order on each product.

SELECT T2.product_name ,  count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T3.order_id  =  T1.order_id GROUP BY T2.product_name

Show all product names and the number of customers having an order on each product .

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


Question: How many customers does Steve Johnson support?

SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";

How many customers does Steve Johnson support ?

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


Question: Find the name of the movie that is played in the most number of theaters.

SELECT T1.title FROM movies AS T1 JOIN movietheaters AS T2 ON T1.code  =  T2.movie GROUP BY T1.title ORDER BY count(*) DESC LIMIT 1

Find the name of the movie that is played in the most number of theaters .

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


Question: Show last names for all student who are on scholarship.

SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y'

Show last names for all student who are on scholarship .

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


Question: What is the name of the university with the most international students in 2011?

SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.pct_international_students DESC LIMIT 1

What is the name of the university with the most international students in 2011 ?

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


Question: List the films' titles which were rented on 24th May,2005.

SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE SUBSTR(T3.rental_date, 1, 10) = '2005-05-24'

List the films ' titles which were rented on 24th May,2005 .

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


Question: How many countries uses the 1968 System of National Accounts methodology?

SELECT COUNT(CountryCode)  FROM Country WHERE SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.'

How many countries uses the 1968 System of National Accounts methodology ?

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


Question: Which supplier can provide the most number of "hot spring dodger dim light"? Please give the supplier's phone number.

SELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T2.ps_availqty DESC LIMIT 1

Which supplier can provide the most number of " hot spring dodger dim light " ? Please give the supplier 's phone number .

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


Question: What are all the employees without a department number?

SELECT * FROM employees WHERE department_id  =  "null"

What are all the employees without a department number ?


Question: Show each state and the number of addresses in each state.

SELECT state_province_county ,  count(*) FROM addresses GROUP BY state_province_county

Show each state and the number of addresses in each state .


Question: List the countries having more than 4 addresses listed.

SELECT country FROM addresses GROUP BY country HAVING count(address_id)  >  4

List the countries having more than 4 addresses listed .


Question: Among sales teams in Midwest region, which sales team has an order quantity greater than 5?

SELECT DISTINCT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'Midwest' AND T1.`Order Quantity` > 5

Among sales teams in Midwest region , which sales team has an order quantity greater than 5 ?

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


Question: How many films are there under the category of "Horror"?

SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Horror'

How many films are there under the category of " Horror " ?

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


Question: Calculate ratio between the highest unit cost and the lowest unit cost?

SELECT ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) / ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') ASC LIMIT 1 ) ORDER BY REPLACE(`Unit Cost`, ',', '') ASC LIMIT 1 )

Calculate ratio between the highest unit cost and the lowest unit cost ?

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


Question: How many users were from New York?

SELECT COUNT(Id) FROM users WHERE Location = 'New York'


Question: Return the party email that has used party services the greatest number of times.

SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id  =  t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1

Return the party email that has used party services the greatest number of times .

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


Question: What is the name of the race held most recently?

SELECT name FROM races ORDER BY date DESC LIMIT 1

What is the name of the race held most recently ?


Question: What are the order details of the products with price higher than 2000?

SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID  =  T2.Product_ID WHERE T2.Product_price  >  2000

What are the order details of the products with price higher than 2000 ?

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


Question: Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.

SELECT order_shipping_charges ,  customer_id FROM customer_orders WHERE order_status_code  =  'Cancelled' OR order_status_code  =  'Paid'

Show the shipping charge and customer i d for customer orders with order status Cancelled or Paid .

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


Question: How many businesses that are registered in the database can be attributed to 'Good for Kids'?

SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'Good for Kids' AND T2.attribute_value = 'true'

How many businesses that are registered in the database can be attributed to ' Good for Kids ' ?

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


Question: What are the average access counts of documents that have the functional area description "Acknowledgement"?

SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code  =  t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code  =  t3.functional_area_code WHERE t3.functional_area_description  =  "Acknowledgement"

What are the average access counts of documents that have the functional area description " Acknowledgement " ?

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


Question: For the order with the total price of 218195.43, which supplier handled the returned item? Give the supplier id.

SELECT T2.l_suppkey FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_totalprice = 218195.43 AND T2.l_returnflag = 'R'

For the order with the total price of 218195.43 , which supplier handled the returned item ? Give the supplier i d.

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


Question: List the resource types available at Sax Arts & Crafts.

SELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Sax Arts & Crafts'

List the resource types available at Sax Arts & Crafts .


Question: Which item was shipped on 3/4/2013 and scheduled for same day delivery in the South region?

SELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2013-03-04' AND T2.Region = 'South' AND T1.`Order Date` = '2013-03-04'

Which item was shipped on 3/4/2013 and scheduled for same day delivery in the South region ?

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


Question: What is the area code of the city with the largest land area?

SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.land_area = ( SELECT MAX(land_area) FROM zip_data )

What is the area code of the city with the largest land area ?

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


Question: Among the lists created by user 4208563, which one has the highest number of followers? Indicate how many followers it has and whether the user was a subscriber or not when he created the list.

SELECT T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 ORDER BY T1.list_followers DESC LIMIT 1

Among the lists created by user 4208563 , which one has the highest number of followers ? Indicate how many followers it has and whether the user was a subscriber or not when he created the list .

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


Question: For the driver who set the fastest lap speed, what is his nationality?

SELECT T1.nationality FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId ORDER BY T2.fastestLapSpeed DESC LIMIT 1

For the driver who set the fastest lap speed , what is his nationality ?

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


Question: State the genre of the movie title with a runtime of only 14 minutes.

SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.runtime = 14

State the genre of the movie title with a runtime of only 14 minutes .

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


Question: For document subset named 'Best for 2000', List all document id that in this subset.

SELECT DISTINCT T1.Document_Object_ID FROM Document_Subset_Members AS T1 JOIN Document_Subsets AS T2 ON T1.Document_Subset_ID =  T2.Document_Subset_ID WHERE T2.Document_Subset_Name = "Best for 2000";

For document subset named ' Best for 2000 ' , List all document i d that in this subset .

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


Question: For each movie that received more than 3 reviews, what is the average rating?

SELECT mID ,  avg(stars) FROM Rating GROUP BY mID HAVING count(*)  >=  2

For each movie that received more than 3 reviews , what is the average rating ?


Question: What are the names of different music genres?

What are the names of different music genres ?


Question: What is the code of the course which the student whose last name is Smithson took?

SELECT T1.crs_code 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 WHERE T3.stu_lname  =  'Smithson'

What is the code of the course which the student whose last name is Smithson took ?

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


Question: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.

SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"

Find all first - grade students who are NOT taught by OTHA MOYER . Report their first and last names .

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


Question: List the hardware model name and company name for the phone whose screen mode type is "Graphics."

SELECT T2.Hardware_Model_name ,  T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics";

List the hardware model name and company name for the phone whose screen mode type is " Graphics . "

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


Question: How many orders were shipped to GREAL via United Package?

SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.CustomerID = 'GREAL' AND T2.CompanyName = 'United Package'

How many orders were shipped to GREAL via United Package ?

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


Question: What are the name and result of the cyclists not from 'Russia' ?

SELECT name ,  RESULT FROM cyclist WHERE nation != 'Russia'

What are the name and result of the cyclists not from ' Russia ' ?

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


Question: The movie 'Gojira ni-sen mireniamu' is from which country?

SELECT T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T1.title = 'Gojira ni-sen mireniamu'

The movie ' Gojira ni - sen mireniamu ' is from which country ?

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


Question: Provide the ranking system name for the "Quality of Education Rank" criteria.

SELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'

Provide the ranking system name for the " Quality of Education Rank " criteria .

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


Question: What are the names of the stations that are located in Palo Alto but have never been the ending point of the trips

SELECT name FROM station WHERE city  =  "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*)  >  100

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


Question: In the database, how many times is the number of Indian cities to the South African cities?

SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id

In the database , how many times is the number of Indian cities to the South African cities ?

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


Question: What are the names of departments that have at least one employee.

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

What are the names of departments that have at least one employee .

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


Question: What is the description of the chapter with the longest number of paragraphs?

SELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id ORDER BY T1.ParagraphNum DESC LIMIT 1

What is the description of the chapter with the longest number of paragraphs ?

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


Question: Count the number of different directors.

SELECT COUNT (DISTINCT director) FROM movie

Count the number of different directors .


Question: Show all student ids who are older than 20.

SELECT StuID FROM Student WHERE age  >  20

Show all student ids who are older than 20 .


Question: What is the average age of Norwalk clients?

SELECT CAST(SUM(T1.age) AS REAL) / COUNT(T1.age) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Norwalk'

What is the average age of Norwalk clients ?


Question: What is the sex of the candidate who had the highest unsure rate?

SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1

What is the sex of the candidate who had the highest unsure rate ?

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


Question: How many affiliations do we have?


Question: Among products comments with 0 score, what is the total number of users ages 40 years old?

SELECT COUNT(DISTINCT T1.id) FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Score = 0 AND T2.Age = 40

Among products comments with 0 score , what is the total number of users ages 40 years old ?

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


Question: Which "music" podcast has the longest title?

SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1

Which " music " podcast has the longest title ?


Question: Show distinct managers of branches.


Question: Show the names of journalists and the number of events they reported.

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

Show the names of journalists and the number of events they reported .

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


Question: What is the average life expentancy of countries that speak Arabic?

SELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'

What is the average life expentancy of countries that speak Arabic ?


Question: How many female actresses appeared in the movie 2312852, what country was it in, and what was it's running time?

SELECT SUM(IIF(T1.a_gender = 'F', 1, 0)) , T3.country, T3.runningtime FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T2.movieid = 2312852 GROUP BY T3.country, T3.runningtime

How many female actresses appeared in the movie 2312852 , what country was it in , and what was it 's running time ?

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


Question: What are the captions of all the self-relation relationship prediction classes?

SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN pred_classes AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID GROUP BY T2.PRED_CLASS

What are the captions of all the self - relation relationship prediction classes ?

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


Question: How many foodborne illness investigations were done in 2014?

SELECT COUNT(business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2014' AND type = 'Foodborne Illness Investigation'

How many foodborne illness investigations were done in 2014 ?


Question: Show the client name who has the most total amount of books ordered.

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

Show the client name who has the most total amount of books ordered .

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


Question: How many percent of customers were inactive?

SELECT CAST(SUM(IIF(active = 0, 1, 0)) AS REAL) * 100 / COUNT(customer_id) FROM customer

How many percent of customers were inactive ?


Question: What is the name of the airline with the highest number of non-cancelled flights?

SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLED = 0 GROUP BY T2.Description ORDER BY COUNT(T1.CANCELLED) DESC LIMIT 1

What is the name of the airline with the highest number of non - cancelled flights ?

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


Question: In what year does the Brown University score the highest?

SELECT T1.year FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' ORDER BY T1.score DESC LIMIT 1

In what year does the Brown University score the highest ?

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


Question: What are the sources for the data of children who finished primary school education in North American countries?

SELECT DISTINCT T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T1.Region = 'North America' AND T2.IndicatorName = 'Out-of-school children of primary school age, both sexes (number)'

What are the sources for the data of children who finished primary school education in North American countries ?

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


Question: What is the average age of all the club leaders?

SELECT avg(T2.age) FROM club_leader AS T1 JOIN member AS T2 ON T1.member_id  =  T2.member_id

What is the average age of all the club leaders ?

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


Question: Which club name contains the string 'state'?

SELECT club_name FROM club WHERE club_name LIKE '%state%'

Which club name contains the string ' state ' ?


Question: How many customers with a canceled shipment have a credit limit greater than 115,000?

SELECT COUNT(T1.customerNumber) FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.status = 'Cancelled' AND T1.creditLimit > 115000

How many customers with a canceled shipment have a credit limit greater than 115,000 ?

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


Question: How many schools have students playing in goalie and mid-field positions?

SELECT COUNT(*) FROM (SELECT cName FROM  tryout WHERE pPos  =  'goalie' INTERSECT SELECT cName FROM  tryout WHERE pPos  =  'mid')

How many schools have students playing in goalie and mid - field positions ?

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


Question: How many users received high compliment type in photo?

SELECT COUNT(T1.user_id) FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.number_of_compliments LIKE 'High' AND T2.compliment_id = 1

How many users received high compliment type in photo ?