Question: What are the total number of students enrolled in ACCT-211?

SELECT count(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code  =  T2.class_code WHERE T1.crs_code  =  'ACCT-211'

What are the total number of students enrolled in ACCT-211 ?


Question: Provide the names and departments of the person who worked as a music editor in the "Pirates of the Caribbean: At World's End" movie.

SELECT T3.person_name, T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Music Editor'

Provide the names and departments of the person who worked as a music editor in the " Pirates of the Caribbean : At World 's End " movie .

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


Question: How many customers gave a product the best possible rating? Please list their names.

SELECT ReviewerName FROM ProductReview WHERE Rating = 5

How many customers gave a product the best possible rating ? Please list their names .

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


Question: What was the first job position that the company needed, and who was hired? Indicate his/her full name.

SELECT T1.JobTitle, T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.HireDate LIMIT 1

What was the first job position that the company needed , and who was hired ? Indicate his / her full name .

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


Question: How many games did the tallest player have ever played?

SELECT T1.GP FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.ELITEID = ( SELECT t.ELITEID FROM PlayerInfo t ORDER BY t.height DESC LIMIT 1 )

How many games did the tallest player have ever played ?


Question: What is the URL to the movie director page on Mubi of the director whose movie was critic by user 2452551 and was given 39 likes?

SELECT T2.director_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 2452551 AND T1.critic_likes = 39

What is the URL to the movie director page on Mubi of the director whose movie was critic by user 2452551 and was given 39 likes ?

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


Question: Describe the ages, genders and numbers of events participated by the users at coordinates of (-102,38).

SELECT DISTINCT T1.age, T1.gender, COUNT(T2.event_id) FROM gender_age AS T1 INNER JOIN `events` AS T2 ON T2.device_id = T1.device_id WHERE T2.longitude = -102 AND T2.latitude = 38 GROUP BY T1.age, T1.gender, T2.longitude, T2.latitude

Describe the ages , genders and numbers of events participated by the users at coordinates of ( -102,38 ) .

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


Question: List down the business ID with a star range from 3 to 4, located at Tempe.

SELECT business_id FROM Business WHERE city LIKE 'Tempe' AND stars BETWEEN 3 AND 4

List down the business ID with a star range from 3 to 4 , located at Tempe .

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


Question: Find the names of users who did not leave any review.

SELECT name FROM useracct WHERE u_id NOT IN (SELECT u_id FROM review)

Find the names of users who did not leave any review .

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


Question: What is the position of Robert King?

SELECT Title FROM Employees WHERE FirstName = 'Robert' AND LastName = 'King'


Question: How long has the "Clear Green Turtle" dish appeared on the menu, and tell me when its latest update was?

SELECT T1.last_appeared - T1.first_appeared, T2.updated_at FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle'

How long has the " Clear Green Turtle " dish appeared on the menu , and tell me when its latest update was ?

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


Question: Please give the name of the customer who has made the single order with the highest total price.

SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1

Please give the name of the customer who has made the single order with the highest total price .

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


Question: What is the difference in price between HL Mountain Frame - Black, 42 and LL Mountain Frame - Black, 42?

SELECT ( SELECT Price FROM Products WHERE Name = 'HL Mountain Frame - Black, 42' ) - ( SELECT Price FROM Products WHERE Name = 'LL Mountain Frame - Black, 42' ) AS num

What is the difference in price between HL Mountain Frame - Black , 42 and LL Mountain Frame - Black , 42 ?

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


Question: What is the flight number and its distance for the one with the maximum price?

SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1

What is the flight number and its distance for the one with the maximum price ?

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


Question: Find names of all students who took some course and got A or C.

SELECT T1.stu_fname ,  T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num WHERE T2.enroll_grade  =  'C' OR T2.enroll_grade  =  'A'

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


Question: Please list the names of all the ranking criteria of Harvard University in 2011.

SELECT T1.criteria_name 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 = 'Harvard University' AND T2.year = 2011

Please list the names of all the ranking criteria of Harvard University in 2011 .

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


Question: Show the names of buildings and the names of regions they are in.

SELECT T1.Name ,  T2.Name FROM building AS T1 JOIN region AS T2 ON T1.Region_ID  =  T2.Region_ID

Show the names of buildings and the names of regions they are in .

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


Question: What's Angela Sanders's major?

SELECT T2.major_name FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T1.first_name = 'Angela' AND T1.last_name = 'Sanders'


Question: What are the manager and sponsor of the team that has the most drivers?

SELECT t1.manager ,  t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1

What are the manager and sponsor of the team that has the most drivers ?

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


Question: What is the title of the movie that was made with the most money and resources?

SELECT title FROM movie ORDER BY budget DESC LIMIT 1

What is the title of the movie that was made with the most money and resources ?

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


Question: List the name of physicians who never took any appointment.

SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID

List the name of physicians who never took any appointment .

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


Question: What is the average bike availablility for stations not in Palo Alto?

SELECT avg(bikes_available) FROM status WHERE station_id NOT IN (SELECT id FROM station WHERE city  =  "Palo Alto")

What is the average bike availablility for stations not in Palo Alto ?

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


Question: List the names of all distinct paintings ordered by length.

SELECT DISTINCT title FROM paintings ORDER BY height_mm

List the names of all distinct paintings ordered by length .


Question: How many breweries are there in Australia?

SELECT COUNT(BreweryName) FROM rootbeerbrand WHERE Country = 'Australia'

How many breweries are there in Australia ?


Question: List the match IDs which had players out by hit wickets.

SELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket'

List the match IDs which had players out by hit wickets .

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


Question: List the event names which were budgeted for the food.

SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event WHERE T2.category = 'Food'

List the event names which were budgeted for the food .

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


Question: Show the number of transactions for different investors.

SELECT investor_id ,  COUNT(*) FROM TRANSACTIONS GROUP BY investor_id

Show the number of transactions for different investors .


Question: What is the average percentage of agriculture of GDP in countries on the African Continent?

SELECT AVG(T4.Agriculture) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Africa'

What is the average percentage of agriculture of GDP in countries on the African Continent ?

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


Question: For the examinations done after 1997/1/1, how many of them have the result of an inactivated partial prothrom bin time?

SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.Date > '1997-01-01' AND T2.APTT >= 45

For the examinations done after 1997/1/1 , how many of them have the result of an inactivated partial prothrom bin time ?

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


Question: Calculate the total payment amount by Diane Collins.

SELECT SUM(T2.amount) FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Diane' AND T1.last_name = 'Collins'

Calculate the total payment amount by Diane Collins .

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


Question: State the most popular movie? When was it released and who is the director for the movie?

SELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1

State the most popular movie ? When was it released and who is the director for the movie ?

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


Question: Provide order number, warehouse code of customers Elorac, Corp.

SELECT DISTINCT T1.OrderNumber, T1.WarehouseCode FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Elorac, Corp'

Provide order number , warehouse code of customers Elorac , Corp.

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


Question: List all book titles which have highest purchase prices .

select title from book order by purchaseprice  desc limit 1

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


Question: Among the male customers, how many of them come from a place with over 30,000 inhabitants?

SELECT COUNT(T1.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INHABITANTS_K > 30

Among the male customers , how many of them come from a place with over 30,000 inhabitants ?

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


Question: How many campuses exist are in the county of LA?

SELECT count(*) FROM campuses WHERE county  =  "Los Angeles"

How many campuses exist are in the county of LA ?


Question: List the brand names of bottled root beer whose first brewing year is no later than 1930.

SELECT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.FirstBrewedYear < '1930-01-01' AND T1.ContainerType = 'Bottle' ORDER BY T2.FirstBrewedYear LIMIT 1

List the brand names of bottled root beer whose first brewing year is no later than 1930 .

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


Question: Among the patients whose level of Hematoclit isn't normal, which patient has the highest anti-Cardiolipin antibody concentration? Please list his or her ID.

SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Examination AS T2 ON T1.ID = T2.ID INNER JOIN Laboratory AS T3 on T1.ID = T3.ID WHERE (T3.HCT >= 52 OR T3.HCT <= 29) ORDER BY T2.`aCL IgA` DESC LIMIT 1

Among the patients whose level of Hematoclit is n't normal , which patient has the highest anti - Cardiolipin antibody concentration ? Please list his or her ID .

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


Question: What is the full name of the customer who rented the highest number of movies of all time?

SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.rental_id) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1

What is the full name of the customer who rented the highest number of movies of all time ?

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


Question: What is the weight in kg of Tony Martensson?

SELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Tony Martensson'

What is the weight in kg of Tony Martensson ?

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


Question: Name all products that started selling in 2013. State its respective vendor's name.

SELECT T1.Name, T3.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE STRFTIME('%Y', T1.SellStartDate) = '2013'

Name all products that started selling in 2013 . State its respective vendor 's name .

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


Question: Among the books that cost less than 1 dollar, how many were published by Berkley Trade?

SELECT COUNT(*) FROM publisher AS T1 INNER JOIN book AS T2 ON T1.publisher_id = T2.publisher_id INNER JOIN order_line AS T3 ON T3.book_id = T2.book_id WHERE T1.publisher_name = 'Berkley' AND T3.price < 1

Among the books that cost less than 1 dollar , how many were published by Berkley Trade ?

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


Question: What are the teams that have the 5 oldest players?

SELECT Team FROM player ORDER BY Age DESC LIMIT 5

What are the teams that have the 5 oldest players ?

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


Question: Give the average number of cities within markets that had a low market estimation larger than 10000?

SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID WHERE T1.Low_Estimate  >  10000

Give the average number of cities within markets that had a low market estimation larger than 10000 ?

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


Question: Identify the percent of long reviews among all 5-star reviews given to businesses by the Yelp users.

SELECT CAST(SUM(CASE WHEN review_length = 'Long' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(review_length) FROM Reviews WHERE review_stars = 5

Identify the percent of long reviews among all 5 - star reviews given to businesses by the Yelp users .

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


Question: How much are the sales of the games in region ID 4?

SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.region_id = 4

How much are the sales of the games in region ID 4 ?

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


Question: Which department has the most people?

SELECT T1.department_name FROM department AS T1 INNER JOIN movie_crew AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(T2.department_id) DESC LIMIT 1


Question: Show all customer ids without an order.

SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Customer_orders

Show all customer ids without an order .


Question: What states have at least two representatives?

SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2

What states have at least two representatives ?


Question: Please list the dates of the flights that were cancelled due to the most serious reason.

SELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE

Please list the dates of the flights that were cancelled due to the most serious reason .

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


Question: In "maxild_playground\Playground.sln", what is the time of sampling for the method "GitHubRepo.Cli.GitHubClientWrapper.GetReleases"?

SELECT T2.SampledAt FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maxild_playgroundPlayground.sln' AND T2.Name = 'GitHubRepo.Cli.GitHubClientWrapper.GetReleases'

In " maxild_playground\Playground.sln " , what is the time of sampling for the method " GitHubRepo . Cli . GitHubClientWrapper . GetReleases " ?

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


Question: What are all the policy types of the customer that has the most policies listed?

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  =  (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id  =  t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)

What are all the policy types of the customer that has the most policies listed ?

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


Question: Find the name of the students who have more than one advisor?

SELECT T1.name FROM student AS T1 JOIN advisor AS T2 ON T1.id  =  T2.s_id GROUP BY T2.s_id HAVING count(*)  >  1

Find the name of the students who have more than one advisor ?

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


Question: Show all student IDs with the number of sports and total number of games played

SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID

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


Question: Which employees were hired after September 7th, 1987?

SELECT * FROM employees WHERE hire_date  >  '1987-09-07'

Which employees were hired after September 7th , 1987 ?


Question: List all the login names and family names of course author and tutors.

SELECT login_name ,  family_name FROM Course_Authors_and_Tutors

List all the login names and family names of course author and tutors .

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


Question: Show id and location of railways that are associated with more than one train.

SELECT T2.Railway_ID ,  T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID  =  T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*)  >  1

Show i d and location of railways that are associated with more than one train .

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


Question: What is the average number of reckless homicides that happened in a district?

SELECT CAST(COUNT(T2.report_no) AS REAL) / COUNT(DISTINCT T1.district_name) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.secondary_description = 'RECKLESS HOMICIDE'

What is the average number of reckless homicides that happened in a district ?

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


Question: Among the molecules which contain "cl" element, which of them are carcinogenic?

SELECT DISTINCT T1.molecule_id FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'cl' AND T2.label = '+'

Among the molecules which contain " cl " element , which of them are carcinogenic ?

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


Question: Count the number of subscribers who started their trips in Market at 4th.

SELECT COUNT(CASE WHEN subscription_type = 'Subscriber' AND start_station_name = 'Market at 4th' THEN id END) FROM trip

Count the number of subscribers who started their trips in Market at 4th .

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


Question: What is the school code of the accounting department?

SELECT school_code FROM department WHERE dept_name  =  "Accounting"

What is the school code of the accounting department ?

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


Question: Calculate the average salary per order for Andrew Fuller.

SELECT CAST(SUM(T1.Salary) AS REAL) / COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Andrew' AND T1.LastName = 'Fuller'

Calculate the average salary per order for Andrew Fuller .

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


Question: Please list the full names of all the superheroes with over 15 super powers.

SELECT DISTINCT T1.full_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id GROUP BY T1.full_name HAVING COUNT(T2.power_id) > 15

Please list the full names of all the superheroes with over 15 super powers .

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


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

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

What is the name of the customer who has the most orders ?


Question: What are the years of opening for tracks with seating between 4000 and 5000?

SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000

What are the years of opening for tracks with seating between 4000 and 5000 ?

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


Question: Give the id and flavor of the most expensive cake.

SELECT id ,  flavor FROM goods WHERE food  =  "Cake" ORDER BY price DESC LIMIT 1

Give the i d and flavor of the most expensive cake .

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


Question: Show me the owner of the channel with the highest rating.

SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1

Show me the owner of the channel with the highest rating .


Question: Show aircraft names and number of flights for each aircraft.

SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid

Show aircraft names and number of flights for each aircraft .

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


Question: How many bond id have element iodine?

SELECT COUNT(T3.bond_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T1.element = 'i'

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


Question: Calculate the average number of students of all universities in 2012.

SELECT AVG(num_students) FROM university_year WHERE year = 2012

Calculate the average number of students of all universities in 2012 .

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


Question: What are the names of the universities that got 98 in teaching in 2011?

SELECT T3.university_name 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 T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score = 98

What are the names of the universities that got 98 in teaching in 2011 ?

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


Question: How many voting records do we have?


Question: List the biographical data and the date of the transcript of all the students.

SELECT T1.bio_data ,  T2.date_of_transcript FROM Students AS T1 JOIN Transcripts AS T2 ON T1.student_id  =  T2.student_id

List the biographical data and the date of the transcript of all the students .

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


Question: What is the name of the medication used for the patient staying in room 111?

SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111

What is the name of the medication used for the patient staying in room 111 ?

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


Question: For the event which happened at 14:09:49 on 2016/5/6, in the location coordinate(116, 40), how many apps were active?

SELECT COUNT(T1.app_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T2.timestamp = '2016-05-06 14:09:49' AND T1.is_active = '1' AND T2.longitude = '116' AND T2.latitude = '40'

For the event which happened at 14:09:49 on 2016/5/6 , in the location coordinate(116 , 40 ) , how many apps were active ?

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


Question: Find all the songs produced by artists with first name "Marianne".

SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T2.firstname  =  "Marianne"

Find all the songs produced by artists with first name " Marianne " .

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


Question: Please list the top three patients' birthdays with the highest glutamic pylvic transaminase in the normal range.

SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT < 60 ORDER BY T2.GPT DESC LIMIT 3

Please list the top three patients ' birthdays with the highest glutamic pylvic transaminase in the normal range .

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


Question: Write down the title, summary, and air date of the episode that garnered 72 10-star votes.

SELECT T2.title, T2.summary, T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10 AND T1.votes = 72

Write down the title , summary , and air date of the episode that garnered 72 10 - star votes .

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


Question: How many students have never been absent from school?

SELECT COUNT(name) FROM longest_absense_from_school WHERE `month` = 0

How many students have never been absent from school ?


Question: Please list the countries on the European Continent that have a population growth of more than 3%.

SELECT T2.Country FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN population AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' AND T4.Population_Growth > 0.03

Please list the countries on the European Continent that have a population growth of more than 3 % .

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


Question: What is the maximum, minimum, and average amount of money outsanding for all customers?

SELECT max(amount_outstanding) ,  min(amount_outstanding) ,  avg(amount_outstanding) FROM Customers;

What is the maximum , minimum , and average amount of money outsanding for all customers ?

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


Question: Name the ID of the patient who is born on the April 1st, 1982. Is his/her alkaliphophatase (ALP) within normal range?

SELECT T1.ID , CASE WHEN T2.ALP < 300 THEN 'normal' ELSE 'abNormal' END FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T1.Birthday = '1982-04-01'

Name the ID of the patient who is born on the April 1st , 1982 . Is his / her alkaliphophatase ( ALP ) within normal range ?

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


Question: List the distinct region of clubs in ascending alphabetical order.

SELECT DISTINCT Region FROM club ORDER BY Region ASC

List the distinct region of clubs in ascending alphabetical order .


Question: Please provide contact details of all Marketing Managers. State their name and phone number.

SELECT T1.FirstName, T1.LastName, T2.PhoneNumber FROM Person AS T1 INNER JOIN PersonPhone AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.JobTitle = 'Marketing Manager'

Please provide contact details of all Marketing Managers . State their name and phone number .

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


Question: Find the student ID and middle name for all the students with at most two enrollments.

SELECT T1.student_id ,  T2.middle_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING COUNT(*)  <=  2

Find the student ID and middle name for all the students with at most two enrollments .

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


Question: Calculate the order percentage by "Carlos Miller" sales team.

SELECT CAST(SUM(CASE WHEN T2.`Sales Team` = 'Carlos Miller' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID

Calculate the order percentage by " Carlos Miller " sales team .

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


Question: How many courses does each student take? List the student id, the student biographical data and the course count.

SELECT T1.student_id ,  T1.bio_data ,  count(*) FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id

How many courses does each student take ? List the student i d , the student biographical data and the course count .

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


Question: Who is the owner of the parent document of every documents where 'Marlin' is the owner?

SELECT T2.Owner FROM Document_Objects AS T1 JOIN Document_Objects AS T2 ON T1.Parent_Document_Object_ID = T2.Document_Object_ID WHERE T1.Owner  =  'Marlin'

Who is the owner of the parent document of every documents where ' Marlin ' is the owner ?

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


Question: State the currency of Malaysia and what are the indicator code used by this country in 1970?

SELECT T1.currencyunit, T2.IndicatorCode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.TableName = 'Malaysia' AND T2.Year = 1970

State the currency of Malaysia and what are the indicator code used by this country in 1970 ?

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


Question: Show the official languages and the number of countries speaking each language.

SELECT T2.name ,  COUNT(*) FROM official_languages AS T1 JOIN languages AS T2 ON T1.language_id  =  T2.id GROUP BY T2.name

Show the official languages and the number of countries speaking each language .

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


Question: How many accounts have a savings balance above the average savings balance?

SELECT count(*) FROM savings WHERE balance  >  (SELECT avg(balance) FROM savings)

How many accounts have a savings balance above the average savings balance ?


Question: Give the Title and author's name of the books that were preprint in 1997.

SELECT DISTINCT T2.Name, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.ConferenceId = 0 AND T1.JournalId = 0 AND T1.Year = 1997 AND T1.Title <> ''

Give the Title and author 's name of the books that were preprint in 1997 .

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


Question: What are the heights of perpetrators in descending order of the number of people they injured?

SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Injured DESC

What are the heights of perpetrators in descending order of the number of people they injured ?

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


Question: What are the products that belong to the beverage category?

SELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Beverages'

What are the products that belong to the beverage category ?

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


Question: List the amount and donor name for the largest amount of donation.

SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1

List the amount and donor name for the largest amount of donation .

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


Question: Which major has the most students?

SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1


Question: In 2014, what is the name of the university which was considered a leader in the publications rank?

SELECT T3.university_name 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 T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1

In 2014 , what is the name of the university which was considered a leader in the publications rank ?

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


Question: What is Diane Collins' email address?

SELECT email FROM customer WHERE first_name = 'DIANE' AND last_name = 'COLLINS'


Question: For the user who gave the most number of long reviews, what is his/her averge ratings of all review?

SELECT CAST(SUM(T1.review_stars) AS REAL) / COUNT(T1.review_stars) FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_length LIKE 'Long' GROUP BY T1.user_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1

For the user who gave the most number of long reviews , what is his / her averge ratings of all review ?

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


Question: How many female competitors were from Iran?

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

How many female competitors were from Iran ?


Question: Which country has the most neighbors? Give the full name of the country.

SELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC LIMIT 1

Which country has the most neighbors ? Give the full name of the country .

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


Question: How many apartments do not have any facility?

SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)

How many apartments do not have any facility ?


Question: In how many different warehouses are Rocks stored within boxes?

SELECT count(DISTINCT LOCATION) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks'

In how many different warehouses are Rocks stored within boxes ?

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


Question: What was the difference in the number of crimes committed in East and North Bohemia in 1996?

SELECT SUM(IIF(A3 = 'east Bohemia', A16, 0)) - SUM(IIF(A3 = 'north Bohemia', A16, 0)) FROM district

What was the difference in the number of crimes committed in East and North Bohemia in 1996 ?

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


Question: Among the movies directed by Wolfgang Reitherman, which one of them was the most popular?

SELECT T2.movie_title FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' ORDER BY T2.total_gross DESC LIMIT 1

Among the movies directed by Wolfgang Reitherman , which one of them was the most popular ?

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


Question: display the department ID, full name (first and last name), salary for those employees who is highest salary in every department.

SELECT first_name ,   last_name ,   salary ,  department_id ,  MAX(salary) FROM employees GROUP BY department_id

display the department ID , full name ( first and last name ) , salary for those employees who is highest salary in every department .

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


Question: On which day was the most verbose complaint received?

SELECT `Date received` FROM callcenterlogs WHERE ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs )

On which day was the most verbose complaint received ?


Question: Which cities have served as host cities more than once? Return me their GDP and population.

SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1

Which cities have served as host cities more than once ? Return me their GDP and population .

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


Question: Give the name of the client who has made the most orders.

SELECT T2.name FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient GROUP BY T1.idClient ORDER BY count(*) DESC LIMIT 1

Give the name of the client who has made the most orders .

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


Question: Which delegates are from counties with population smaller than 100000?

SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id  =  T2.District WHERE T1.Population  <  100000

Which delegates are from counties with population smaller than 100000 ?

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


Question: What country is the artist who made the fewest songs from?

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

What country is the artist who made the fewest songs from ?

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


Question: With the biggest budget for the "Food", what was the remaining of it?

SELECT remaining FROM budget WHERE category = 'Food' AND amount = ( SELECT MAX(amount) FROM budget WHERE category = 'Food' )

With the biggest budget for the " Food " , what was the remaining of it ?

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


Question: Where is store 1 located?

SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE store_id  =  1


Question: Show all advisors and corresponding number of students.

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

Show all advisors and corresponding number of students .


Question: Please list the chains of the gas stations with transactions in euro.

SELECT DISTINCT T3.ChainID FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN gasstations AS T3 ON T1.GasStationID = T3.GasStationID WHERE T2.Currency = 'EUR'

Please list the chains of the gas stations with transactions in euro .

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


Question: What object class is in the X and Y coordinates of 126 and 363?

SELECT T1.IMG_ID, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 126 AND T1.Y = 363

What object class is in the X and Y coordinates of 126 and 363 ?

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


Question: How many classes are held in each department?

SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code

How many classes are held in each department ?


Question: List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.

SELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND T3.Match_Date = '2016-04-11'

List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016 .

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


Question: Return the names of all counties sorted by county name in descending alphabetical order.

SELECT County_name FROM county ORDER BY County_name DESC

Return the names of all counties sorted by county name in descending alphabetical order .

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


Question: Return the stadiums of institutions, ordered by capacity descending.

SELECT Stadium FROM institution ORDER BY Capacity DESC

Return the stadiums of institutions , ordered by capacity descending .

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


Question: How many clients does each agency have?

SELECT agency_id ,  count(*) FROM Clients GROUP BY agency_id

How many clients does each agency have ?


Question: Find the average age of the members in the club "Bootup Baltimore".

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  =  "Bootup Baltimore"

Find the average age of the members in the club " Bootup Baltimore " .

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


Question: Name the top 10 most reviewed apps.

SELECT DISTINCT App FROM playstore ORDER BY Reviews DESC LIMIT 10


Question: What is the collection name of a document owned by 'Ransom'?

SELECT T1.Collection_Name FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID JOIN Document_Objects AS T3 ON T2.Document_object_id  =  T3.Document_object_id WHERE T3.owner  =  'Ransom'

What is the collection name of a document owned by ' Ransom ' ?

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


Question: List the name of all the products with order quantities greater than or equal to 10 in the central superstore that has been shipped by the slowest delivery method.

SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class' AND T1.Quantity >= 10

List the name of all the products with order quantities greater than or equal to 10 in the central superstore that has been shipped by the slowest delivery method .

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


Question: Among the countries with the African ethnic group, how many of them has a population of over 10000000?

SELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Area > 10000000

Among the countries with the African ethnic group , how many of them has a population of over 10000000 ?

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


Question: Find the name of the customers who have at most two orders.

SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*)  <=  2

Find the name of the customers who have at most two orders .


Question: What is the name of product with the ID of 77?

SELECT ProductName FROM Products WHERE ProductID = 77

What is the name of product with the ID of 77 ?


Question: What is the number of households in the "FL-10" district?

SELECT SUM(CASE WHEN T2.district = 'FL-10' THEN 1 ELSE 0 END) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code

What is the number of households in the " FL-10 " district ?


Question: What are all the characteristic names of product "sesame"?

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

What are all the characteristic names of product " sesame " ?

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


Question: How many albums are there?


Question: How many bankrupt students are there in the Marines?

SELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'

How many bankrupt students are there in the Marines ?


Question: What are the name of rooms booked by customers whose first name has "ROY" in part?

SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE firstname LIKE '%ROY%'

What are the name of rooms booked by customers whose first name has " ROY " in part ?

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


Question: Of the arts-books and arts-design categories, which one has more podcasts and what is the numerical difference between them?

SELECT ( SELECT category FROM categories WHERE category = 'arts-books' OR category = 'arts-design' GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ) "has more podcasts" , ( SELECT SUM(CASE WHEN category = 'arts-books' THEN 1 ELSE 0 END) - SUM(CASE WHEN category = 'arts-design' THEN 1 ELSE 0 END) FROM categories ) "differenct BETWEEN arts-books and arts-design"

Of the arts - books and arts - design categories , which one has more podcasts and what is the numerical difference between them ?

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


Question: Sort the buildings in descending order of building completion year, and return the building addresses.

SELECT Address FROM building ORDER BY Completed_Year DESC

Sort the buildings in descending order of building completion year , and return the building addresses .

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


Question: Find and list the full name of employees who are from the territory, Wilton.

SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T3.TerritoryDescription = 'Wilton'

Find and list the full name of employees who are from the territory , Wilton .

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


Question: What is the topic of the series when the Total reserves minus gold (current US$) indicator of Haiti hit the value of 3,000,000 in 1961? Please include its series code and license type.

SELECT T2.Topic, T2.Seriescode, T2.LicenseType FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year = 1961 AND T1.CountryName = 'Haiti' AND T1.IndicatorName = 'Total reserves minus gold (current US$)' AND T1.Value = 3000000

What is the topic of the series when the Total reserves minus gold ( current US$ ) indicator of Haiti hit the value of 3,000,000 in 1961 ? Please include its series code and license type .

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


Question: State the name of badge that the user whose display name is "Sharpie" obtained.

SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'Sharpie'

State the name of badge that the user whose display name is " Sharpie " obtained .

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


Question: What is the number of reviews from user No. "21679"?

SELECT COUNT(review_length) FROM Reviews WHERE user_id = 21679

What is the number of reviews from user No . " 21679 " ?

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


Question: How many students live in each country?

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

How many students live in each country ?


Question: What is the name of all the sports Chin Eei Hui has competed in?

SELECT DISTINCT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T5.full_name = 'Chin Eei Hui'

What is the name of all the sports Chin Eei Hui has competed in ?

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


Question: Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s?

SELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.award = 'NBA Coach of the Year' AND T2.year BETWEEN 1970 AND 1979 AND T1.year = 1981 AND T3.name = 'Chicago Bulls'

Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s ?

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


Question: List down the movie titles that were produced in Canada.

SELECT T1.title 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 T3.COUNTry_name = 'Canada'

List down the movie titles that were produced in Canada .

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


Question: Show the minimum, average, and maximum age of all students.

SELECT min(age) ,  avg(age) ,  max(age) FROM Student

Show the minimum , average , and maximum age of all students .


Question: Name the students of the Advanced Database Systems course with the highest satisfaction.

SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Advanced Database Systems' ORDER BY T2.sat DESC LIMIT 1

Name the students of the Advanced Database Systems course with the highest satisfaction .

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


Question: Find the manager and sponsor of the team that has the most drivers.

SELECT t1.manager ,  t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id  =  t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1

Find the manager and sponsor of the team that has the most drivers .

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


Question: list all female (sex is F) candidate names in the alphabetical order.

SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t1.sex  =  'F' ORDER BY t1.name

list all female ( sex is F ) candidate names in the alphabetical order .

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


Question: List the wheels and locations of the railways.

List the wheels and locations of the railways .


Question: Give the FBI code description of case No.JB134191.

SELECT description FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.case_number = 'JB134191'

Give the FBI code description of case No . JB134191 .

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


Question: What are the episodes that have the average rating with more than 20 of 2-star votes?

SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 2 AND T2.votes > 20 AND T1.rating > 5.0 AND T1.rating <= 7.0;

What are the episodes that have the average rating with more than 20 of 2 - star votes ?

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


Question: Which states have at least two cities?

SELECT state FROM City GROUP BY state HAVING count(*)  >=  2


Question: What is the total amount of payment?

SELECT sum(Amount_Payment) FROM Payments


Question: For the quantities, what percent more did the store in Fremont sell than the store in Portland in 1993?

SELECT CAST(SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) - SUM(CASE WHEN T2.city = 'Portland' THEN qty END) AS REAL) * 100 / SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE STRFTIME('%Y', T1.ord_date) = '1993'

For the quantities , what percent more did the store in Fremont sell than the store in Portland in 1993 ?

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


Question: display the department name and number of employees in each of the department.

SELECT department_name ,  COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY department_name

display the department name and number of employees in each of the department .

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


Question: What is the last name of the artist who sang the most songs?

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

What is the last name of the artist who sang the most songs ?

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


Question: What percentage of games won, games lost and games drawn does Cittadella have as a home team in total?

SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella'

What percentage of games won , games lost and games drawn does Cittadella have as a home team in total ?

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


Question: What campuses are in Los Angeles county?

SELECT campus FROM campuses WHERE county  =  "Los Angeles"

What campuses are in Los Angeles county ?

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


Question: Show the transaction type and the number of transactions.

SELECT transaction_type ,  count(*) FROM Financial_transactions GROUP BY transaction_type

Show the transaction type and the number of transactions .


Question: On what date was the rented material for the movie BLOOD ARGONAUTS returned?

SELECT T1.rental_date FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BLOOD ARGONAUTS'

On what date was the rented material for the movie BLOOD ARGONAUTS returned ?

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


Question: List the name and phone number of all suppliers in the alphabetical order of their addresses.

SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details

List the name and phone number of all suppliers in the alphabetical order of their addresses .

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


Question: What is the average longitude of stations that never had bike availability more than 10?

SELECT avg(long) FROM station WHERE id NOT IN (SELECT station_id FROM status GROUP BY station_id HAVING max(bikes_available)  >  10)

What is the average longitude of stations that never had bike availability more than 10 ?

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


Question: What is the second-least common method of shipping?

SELECT T2.method_name FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id GROUP BY T2.method_name ORDER BY COUNT(T2.method_id) ASC LIMIT 1, 1

What is the second - least common method of shipping ?


Question: List down the revision page id of titles where "fresc" appears.

SELECT T3.revision FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'fresc'

List down the revision page i d of titles where " fresc " appears .

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


Question: What is the full official name of the current legislator that has served for the most number of terms?

SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.bioguide ORDER BY COUNT(T2.bioguide) DESC LIMIT 1

What is the full official name of the current legislator that has served for the most number of terms ?

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


Question: Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?

SELECT COUNT(COUNTCUSID) FROM ( SELECT COUNT(T1.cust_id) AS COUNTCUSID FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2017' AND T1.annual_revenue > 30000000 GROUP BY T1.cust_id HAVING COUNT(T2.ship_id) >= 1 ) T3

Among the customers having at least one shipment in 2017 , how many of them have an annual revenue of over 30000000 ?

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


Question: What are the names of all the clients, and how many times has each of them ordered?

SELECT T2.name ,  count(*) FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient GROUP BY T1.idClient

What are the names of all the clients , and how many times has each of them ordered ?

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


Question: What are the birth dates of employees living in Edmonton?

SELECT BirthDate FROM EMPLOYEE WHERE City  =  "Edmonton"

What are the birth dates of employees living in Edmonton ?

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


Question: List all the cities in the country where there is high life expectancy at birth.

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

List all the cities in the country where there is high life expectancy at birth .

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


Question: Which employees do not authorize destruction for any document? Give me their employee ids.

SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed

Which employees do not authorize destruction for any document ? Give me their employee ids .

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


Question: What are the emails of employees with null commission, salary between 7000 and 12000, and who work in department 50?

SELECT email FROM employees WHERE commission_pct  =  "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50

What are the emails of employees with null commission , salary between 7000 and 12000 , and who work in department 50 ?

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


Question: For the event which happened at 23:33:34 on 2016/5/6, how many installed apps were involved?

SELECT COUNT(T1.event_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE SUBSTR(T2.`timestamp`, 1, 10) = '2016-05-06' AND T1.is_installed = '1'

For the event which happened at 23:33:34 on 2016/5/6 , how many installed apps were involved ?

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


Question: Please show the software platforms of devices in descending order of the count.

SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC

Please show the software platforms of devices in descending order of the count .

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


Question: How much is the average build up play speed of the Heart of Midlothian team?

SELECT CAST(SUM(t2.buildUpPlaySpeed) AS REAL) / COUNT(t2.id) FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Heart of Midlothian'

How much is the average build up play speed of the Heart of Midlothian team ?

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


Question: What are the total payments of customers with no credit limit in 2003?

SELECT SUM(amount) FROM payments WHERE STRFTIME('%Y', paymentDate) = '2003' AND customerNumber IN ( SELECT customerNumber FROM customers WHERE creditLimit = 0 )

What are the total payments of customers with no credit limit in 2003 ?

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


Question: What's Lucas di Grassi's Q1 result in the race No. 345?

SELECT T1.q1 FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 345 AND T2.forename = 'Lucas' AND T2.surname = 'di Grassi'

What 's Lucas di Grassi 's Q1 result in the race No . 345 ?

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


Question: What are the most popular restaurants in San Francisco among diners?

SELECT id_restaurant, label FROM generalinfo WHERE city = 'San Francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE city = 'San Francisco' )

What are the most popular restaurants in San Francisco among diners ?

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


Question: What is the cost for the sports?

SELECT T2.StandardCost FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE '%Sport%'


Question: For project titled 'Toot Your Flute!', what is the main subject of the project materials intended for? Name the other projects with the similar focus.

SELECT T2.primary_focus_subject FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Toot Your Flute!'

For project titled ' Toot Your Flute ! ' , what is the main subject of the project materials intended for ? Name the other projects with the similar focus .

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


Question: Which was the fastest lap for Lewis Hamilton in the 2008 Australian Grand Prix?

SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T2.name = 'Australian Grand Prix' AND T2.year = 2008 AND T3.forename = 'Lewis' AND T3.surname = 'Hamilton'

Which was the fastest lap for Lewis Hamilton in the 2008 Australian Grand Prix ?

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


Question: List the number of invoices from Chicago, IL.

SELECT COUNT(*) FROM invoices WHERE billing_city  =  "Chicago" AND billing_state  =  "IL";

List the number of invoices from Chicago , IL .


Question: Find the number of female students (with F sex) living in Smith Hall

SELECT count(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid  =  T2.stuid JOIN dorm AS T3 ON T3.dormid  =  T2.dormid WHERE T3.dorm_name  =  'Smith Hall' AND T1.sex  =  'F'

Find the number of female students ( with F sex ) living in Smith Hall

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


Question: What are the dates when customers with ids between 10 and 20 became customers?

SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20

What are the dates when customers with ids between 10 and 20 became customers ?

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


Question: List down the tagline of the Polski movies.

SELECT DISTINCT T1.tagline FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Polski'

List down the tagline of the Polski movies .


Question: List down the inspection ID with the inspector's comment "A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED" and inspection category of Personnel.

SELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Personnel' AND T2.inspector_comment = 'A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served.FOUND NO CITY OF CHICAGO SANITATION CERTIFICATE POSTED OR VALID DOCUMENTATION DURING THIS INSPECTION.'

List down the inspection ID with the inspector 's comment " A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served . NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED " and inspection category of Personnel .

O O O B-COLUMN I-COLUMN O O B-COLUMN I-COLUMN I-COLUMN 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 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 O O O O B-TABLE O O O B-TABLE B-COLUMN O B-VALUE O


Question: What is the average fastest lap speed for the Monaco Grand Prix in 2008?

SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"

What is the average fastest lap speed for the Monaco Grand Prix in 2008 ?

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


Question: List the name of the rates that apply to the provinces that are in the territory that obtained the greatest increase in sales with respect to the previous year.

SELECT T2.Name FROM SalesTerritory AS T1 INNER JOIN StateProvince AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode INNER JOIN SalesTaxRate AS T3 ON T2.StateProvinceID = T3.StateProvinceID ORDER BY (T1.SalesYTD - T1.SalesLastYear) / T1.SalesLastYear DESC LIMIT 1

List the name of the rates that apply to the provinces that are in the territory that obtained the greatest increase in sales with respect to the previous year .

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


Question: In what country did the Poland Ekstraklasa take place?

SELECT name FROM Country WHERE id IN ( SELECT country_id FROM League WHERE name = 'Poland Ekstraklasa' )

In what country did the Poland Ekstraklasa take place ?

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


Question: How many cards with a 1993 frame version and available on paper have a sensitive content warning?

SELECT COUNT(id) FROM cards WHERE frameVersion = 1993 AND availability = 'paper' AND hasContentWarning = 1

How many cards with a 1993 frame version and available on paper have a sensitive content warning ?

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


Question: Which 3 affiliations had the most papers in 2009?

SELECT T3.name FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id  =  T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id  =  T3.affiliation_id WHERE T1.year  =  2009 GROUP BY T2.affiliation_id ORDER BY count(*) DESC LIMIT 3

Which 3 affiliations had the most papers in 2009 ?

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


Question: Which players had an overall rating of over 80 from 2008 to 2010? Please list player names.

SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.overall_rating > 80 AND SUBSTR(t2.`date`, 1, 4) BETWEEN '2008' AND '2010'

Which players had an overall rating of over 80 from 2008 to 2010 ? Please list player names .

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


Question: Which planet has total weight of shipment greater than 30? List planet name.

SELECT T3.Name FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID GROUP BY T2.Planet HAVING sum(T1.Weight)  >  30;

Which planet has total weight of shipment greater than 30 ? List planet name .

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


Question: Find the salaries of all distinct instructors that are less than the largest salary.

SELECT DISTINCT salary FROM instructor WHERE salary  <  (SELECT max(salary) FROM instructor)

Find the salaries of all distinct instructors that are less than the largest salary .

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


Question: In the Northeast region, what is the average household income for each city located in the state with the highest number of stores?

SELECT AVG(T2.`Household Income`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T1.Region = 'Northeast' GROUP BY T2.State ORDER BY COUNT(T2.StoreID) DESC LIMIT 1

In the Northeast region , what is the average household income for each city located in the state with the highest number of stores ?

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


Question: What are locations of the work order "35493"?

SELECT T2.Name FROM WorkOrderRouting AS T1 INNER JOIN Location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.WorkOrderID = 35493

What are locations of the work order " 35493 " ?

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


Question: How many countries have a life expectancy of 75.1?

SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1

How many countries have a life expectancy of 75.1 ?

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


Question: How many objects are there in the attribute class id with the highest number of objects?

SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_att GROUP BY IMG_ID ORDER BY COUNT(ATT_CLASS_ID) DESC LIMIT 1

How many objects are there in the attribute class i d with the highest number of objects ?

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


Question: List the states which have between 2 to 4 staffs living there.

SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;

List the states which have between 2 to 4 staffs living there .

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


Question: Which universities have more than 100,000 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 AND T1.num_students > 100000

Which universities have more than 100,000 students in 2011 ?

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


Question: What is the name of the sailor who reserved boat 102?

SELECT T1.name FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid  =  T2.sid WHERE T2.bid  =  102

What is the name of the sailor who reserved boat 102 ?

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


Question: What are the names and type codes of products?

SELECT Product_Name ,  Product_Type_Code FROM Products

What are the names and type codes of products ?


Question: Which faculty do not participate in any activity? Find their faculty ids.

SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in

Which faculty do not participate in any activity ? Find their faculty ids .

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


Question: Tell the Japanese name of the set which card "Fellwar Stone" is in it.

SELECT T2.translation FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T1.name = 'Fellwar Stone' AND T2.language = 'Japanese' AND T2.translation IS NOT NULL

Tell the Japanese name of the set which card " Fellwar Stone " is in it .

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


Question: How long does student Linda Smith spend on the restaurant in total?

SELECT sum(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith";

How long does student Linda Smith spend on the restaurant in total ?

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


Question: What are the different majors?


Question: Find the name of dorms which have TV Lounge but no Study Room as amenity.

SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid  =  T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid  =  T3.amenid WHERE T3.amenity_name  =  'Study Room'

Find the name of dorms which have TV Lounge but no Study Room as amenity .

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


Question: What is the first name of the student whose last name starts with the letter S and is taking ACCT-211?

SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num  =  T2.stu_num JOIN CLASS AS T3 ON T2.class_code  =  T3.class_code WHERE T3.crs_code  =  'ACCT-211' AND T1.stu_lname LIKE 'S%'

What is the first name of the student whose last name starts with the letter S and is taking ACCT-211 ?

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


Question: Where does the person with the BusinessEntityID "5555" live?

SELECT T3.City, T3.AddressLine1 FROM BusinessEntityAddress AS T1 INNER JOIN AddressType AS T2 ON T1.AddressTypeID = T2.AddressTypeID INNER JOIN Address AS T3 ON T1.AddressID = T3.AddressID WHERE T1.BusinessEntityID = 5555 AND T2.Name = 'Home'

Where does the person with the BusinessEntityID " 5555 " live ?


Question: Please calculate the average unit price for products of Formaggi Fortini s.r.l.

SELECT SUM(T1.UnitPrice) / COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Formaggi Fortini s.r.l.'

Please calculate the average unit price for products of Formaggi Fortini s.r.l .

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


Question: Report the name of all campuses in Los Angeles county.

SELECT campus FROM campuses WHERE county  =  "Los Angeles"

Report the name of all campuses in Los Angeles county .

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


Question: Identify the type of expenses and their total value approved for 'October Meeting' event.

SELECT T1.type, SUM(T3.cost) FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T1.event_name = 'October Meeting'

Identify the type of expenses and their total value approved for ' October Meeting ' event .

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


Question: What is the average duration of trips that ended on a foggy day?

SELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Fog'

What is the average duration of trips that ended on a foggy day ?

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


Question: What is the percentage of Hispanic patients who stopped their care plan in 2011?

SELECT CAST(SUM(CASE WHEN T2.race = 'hispanic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.stop) = '2011'

What is the percentage of Hispanic patients who stopped their care plan in 2011 ?

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


Question: How many orders have been cancelled in 2022?

SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled' AND STRFTIME('%Y', T2.status_date) = '2022'

How many orders have been cancelled in 2022 ?


Question: What is the processed time to download the repository whose files are contained in the solution with the path "jeffdik_tachy\src\Tachy.sln".

SELECT DISTINCT T2.ProcessedTime FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'jeffdik_tachysrcTachy.sln'

What is the processed time to download the repository whose files are contained in the solution with the path " jeffdik_tachy\src\Tachy.sln " .

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


Question: Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst.

SELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3;

Mention the episode ID , title and any three keywords of the episode which get the most number of votes in star classification of worst .

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


Question: Which apps have been reviewed more than 75 000 000 times and the content is suitable for teenagers?

SELECT DISTINCT App FROM playstore WHERE Reviews > 75000000 AND `Content Rating` = 'Teen'

Which apps have been reviewed more than 75 000 000 times and the content is suitable for teenagers ?

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


Question: How many drivers did not participate in the races held in 2009?

SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )

How many drivers did not participate in the races held in 2009 ?

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


Question: Is there a work order where the planned cost is different from the actual cost?

SELECT CASE WHEN ActualCost = PlannedCost THEN 'No' ELSE 'Yes' END FROM WorkOrderRouting

Is there a work order where the planned cost is different from the actual cost ?

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


Question: What is the name of all sailors whose rating is higher than all sailors named Luis?

SELECT name FROM Sailors WHERE rating  >  (SELECT max(rating) FROM Sailors WHERE name  =  'Luis')

What is the name of all sailors whose rating is higher than all sailors named Luis ?

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


Question: List the name and phone number of customers in India who have an above-average account balance.

SELECT T1.c_name, T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > ( SELECT AVG(c_acctbal) FROM customer ) ORDER BY T1.c_name

List the name and phone number of customers in India who have an above - average account balance .

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


Question: What are the planned delivery date and actual delivery date for each booking?

SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS

What are the planned delivery date and actual delivery date for each booking ?

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


Question: What are the names of the sales teams that have served to customer Apotheca, Ltd?

SELECT DISTINCT T3.`Sales Team` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T1.`Customer Names` = 'Apotheca, Ltd'

What are the names of the sales teams that have served to customer Apotheca , Ltd ?

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


Question: What are the prices on cheese products?

SELECT T2.UnitPrice FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.Description = 'Cheeses'

What are the prices on cheese products ?

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


Question: What are the titles of the podcasts whose reviews were created between 2018-08-22T11:53:16-07:00 and 2018-11-20T11:14:20-07:00?

SELECT DISTINCT T1.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2018-08-22T11:53:16-07:00' AND '2018-11-20T11:14:20-07:00'

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


Question: What are the last names of staff with email addressed containing the substring "wrau"?

SELECT last_name FROM staff WHERE email_address LIKE "%wrau%"

What are the last names of staff with email addressed containing the substring " wrau " ?

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


Question: What is the name of the category which most users belong to?

SELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id GROUP BY T1.app_id, T2.category ) AS T ORDER BY T.num DESC LIMIT 1

What is the name of the category which most users belong to ?


Question: Count the number of Annual Meeting events that took place in the region of the United Kingdom.

SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id  =  t2.region_id JOIN party_events AS t3 ON t2.party_id  =  t3.party_id WHERE t1.region_name  =  "United Kingdom" AND t3.Event_Name  =  "Annaual Meeting"

Count the number of Annual Meeting events that took place in the region of the United Kingdom .

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


Question: How many sales team were from Northeast?

SELECT SUM(CASE WHEN Region = 'Northeast' THEN 1 ELSE 0 END) FROM `Sales Team`

How many sales team were from Northeast ?


Question: What is the percentage of unemployed students who have been absent for 5 months from school?

SELECT CAST(SUM(IIF(T1.month > 5, 1, 0)) AS REAL) * 100 / COUNT(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name

What is the percentage of unemployed students who have been absent for 5 months from school ?

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


Question: Show origin and destination for flights with price higher than 300.

SELECT origin ,  destination FROM Flight WHERE price  >  300

Show origin and destination for flights with price higher than 300 .

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


Question: Please show the employee first names and ids of employees who serve at least 10 customers.

SELECT T1.FirstName ,  T1.SupportRepId FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*)  >=  10

Please show the employee first names and ids of employees who serve at least 10 customers .

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


Question: Show the name, phone, and payment method code for all customers in descending order of customer number.

SELECT customer_name ,  customer_phone ,  payment_method_code FROM customers ORDER BY customer_number DESC

Show the name , phone , and payment method code for all customers in descending order of customer number .

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


Question: List name and damage for all storms in a descending order of max speed.

SELECT name ,  damage_millions_USD FROM storm ORDER BY max_speed DESC

List name and damage for all storms in a descending order of max speed .

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


Question: Among students who have been absent for nine months, how many of them are disabled?

SELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN longest_absense_from_school AS T2 ON T2.name = T1.name WHERE T2.month = 9

Among students who have been absent for nine months , how many of them are disabled ?

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


Question: Among the releases that were released in 2000, how many of them were released as an album and tagged "pop"?

SELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.releaseType = 'album' AND T1.groupYear = 2000

Among the releases that were released in 2000 , how many of them were released as an album and tagged " pop " ?

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


Question: Who is the director of the adventure movie which was released on 2007/3/30?

SELECT T1.director FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.name WHERE T2.genre = 'Adventure' AND T2.release_date = 'Mar 30, 2007'

Who is the director of the adventure movie which was released on 2007/3/30 ?

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


Question: Please give the full names of all the active staff.

SELECT first_name, last_name FROM staff WHERE active = 1

Please give the full names of all the active staff .


Question: Please show the different statuses of cities and the average population of cities with each status.

SELECT Status ,  avg(Population) FROM city GROUP BY Status

Please show the different statuses of cities and the average population of cities with each status .

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


Question: Give the state that has the most cities.

SELECT state FROM City GROUP BY state ORDER BY count(*) DESC LIMIT 1

Give the state that has the most cities .


Question: Give the name of the driver of shipment no.1021.

SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1021'

Give the name of the driver of shipment no.1021 .

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


Question: What are the names of pilots who have flown Piper Cub but not the B-52 Bomber?

SELECT pilot_name FROM pilotskills WHERE plane_name  =  'Piper Cub' EXCEPT SELECT pilot_name FROM pilotskills WHERE plane_name  =  'B-52 Bomber'

What are the names of pilots who have flown Piper Cub but not the B-52 Bomber ?

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


Question: How many students in the Student_Club are from the College of Engineering?

SELECT COUNT(T1.member_id) FROM member AS T1 INNER JOIN major AS T2 ON T1.link_to_major = T2.major_id WHERE T2.college = 'College of Engineering'

How many students in the Student_Club are from the College of Engineering ?

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


Question: Who is the customer that is active and lives at 1795 Santiago de Compostela Way, Texas?

SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T2.address = '1795 Santiago de Compostela Way' AND T1.active = 1

Who is the customer that is active and lives at 1795 Santiago de Compostela Way , Texas ?

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


Question: Which top 4 leagues had the most games in the 2015-2016 season?

SELECT t1.name FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t2.season = '2015/2016' GROUP BY t1.name ORDER BY COUNT(t2.id) DESC LIMIT 4

Which top 4 leagues had the most games in the 2015 - 2016 season ?

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


Question: How many child documents does each parent document has? List the document id and the number.

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;

How many child documents does each parent document has ? List the document i d and the number .

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


Question: What is the percentage of Primetime Emmy nominated episodes with a rating over 7 to all the episodes that have a rating over 7?

SELECT CAST(SUM(CASE WHEN T1.award_category = 'Primetime Emmy' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating > 7 AND T1.result = 'Nominee';

What is the percentage of Primetime Emmy nominated episodes with a rating over 7 to all the episodes that have a rating over 7 ?

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


Question: Show the carriers of devices in stock at more than one shop.

SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID  =  T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*)  >  1

Show the carriers of devices in stock at more than one shop .

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


Question: How many crime cases have been classified as "Weapons Violation" by the FBI?

SELECT SUM(CASE WHEN T2.title = 'Weapons Violation' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no

How many crime cases have been classified as " Weapons Violation " by the FBI ?

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


Question: List the films' titles which were rented by Brian Wyman in July, 2005.

SELECT T4.title 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 AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'BRIAN' AND T1.last_name = 'WYMAN' AND STRFTIME('%Y', T2.rental_date) = '2005' AND STRFTIME('%m',T2.rental_date) = '7'

List the films ' titles which were rented by Brian Wyman in July , 2005 .

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


Question: What is the name and model year of the vehicle which has been rented the most times?

SELECT T2.name ,  T2.model_year FROM renting_history AS T1 JOIN vehicles AS T2 ON T1.vehicles_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1

What is the name and model year of the vehicle which has been rented the most times ?

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


Question: Return the name of the member who is in charge of the most events.

SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id  =  T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY count(*) DESC LIMIT 1

Return the name of the member who is in charge of the most events .

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


Question: List the dates of enrollment and completion of the student with family name "Zieme" and personal name "Bernie".

SELECT T1.date_of_enrolment ,  T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.family_name  =  "Zieme" AND T2.personal_name  =  "Bernie"

List the dates of enrollment and completion of the student with family name " Zieme " and personal name " Bernie " .

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


Question: Find the distinct last names of all the students who have president votes and whose advisor is 8741.

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

Find the distinct last names of all the students who have president votes and whose advisor is 8741 .

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


Question: In comments with score between 1 to 5, list down the display names of the users with 0 down votes.

SELECT T2.DisplayName FROM comments AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T1.Score BETWEEN 1 AND 5 AND T2.DownVotes = 0

In comments with score between 1 to 5 , list down the display names of the users with 0 down votes .

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


Question: How many planes are controlled by the pilots whose age is older than 40?

SELECT count(plane_name) FROM pilotskills WHERE age  >  40

How many planes are controlled by the pilots whose age is older than 40 ?

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


Question: Among the widowed female customers, give the income of those who has an level of education of 5 and below.

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

Among the widowed female customers , give the income of those who has an level of education of 5 and below .

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


Question: To whom did the company transport its heaviest shipment?

SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id ORDER BY T1.weight DESC LIMIT 1

To whom did the company transport its heaviest shipment ?


Question: How many basic and medium undergraduate courses are there?

SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_300'

How many basic and medium undergraduate courses are there ?


Question: Which university had the highest reputation in 2012?

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

Which university had the highest reputation in 2012 ?


Question: Among the menus in which the dish "Clear green turtle" had appeared, how many of them did not support taking out or booking in advance?

SELECT SUM(CASE WHEN T4.name = 'Clear green turtle' 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 T3.call_number IS NULL

Among the menus in which the dish " Clear green turtle " had appeared , how many of them did not support taking out or booking in advance ?

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


Question: What is the name of the youngest competitor?

SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1

What is the name of the youngest competitor ?


Question: Among legislators who have an Instagram account, list down their full names and nicknames who have a Thomas ID of less than 1000.

SELECT T1.official_full_name, T1.nickname_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.instagram IS NOT NULL AND T1.thomas_id < 1000

Among legislators who have an Instagram account , list down their full names and nicknames who have a Thomas ID of less than 1000 .

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


Question: List all information about college sorted by enrollment number in the ascending order.

List all information about college sorted by enrollment number in the ascending order .


Question: Where was the 'A context-based navigation paradigm for accessing Web data' paper published? State the name of the conference.

SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'A context-based navigation paradigm for accessing Web data'

Where was the ' A context - based navigation paradigm for accessing Web data ' paper published ? State the name of the conference .

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


Question: Return the maximum and minimum health scores across all countries other than Norway.

SELECT max(health_score) ,  min(health_score) FROM countries WHERE name != "Norway"

Return the maximum and minimum health scores across all countries other than Norway .

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


Question: Who has the highest average finishing rate between the highest and shortest football player?

SELECT A FROM ( SELECT AVG(finishing) result, 'Max' A FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.height = ( SELECT MAX(height) FROM Player ) UNION SELECT AVG(finishing) result, 'Min' A FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.height = ( SELECT MIN(height) FROM Player ) ) ORDER BY result DESC LIMIT 1

Who has the highest average finishing rate between the highest and shortest football player ?

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


Question: Identify the name and position of the player who has committed the most rule violations.

SELECT T2.PlayerName, T2.position_info FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.PIM = ( SELECT MAX(PIM) FROM SeasonStatus )

Identify the name and position of the player who has committed the most rule violations .

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


Question: Which director did Bill Thompson work the most with?

SELECT director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T2.`voice-actor` = 'Bill Thompson' GROUP BY director ORDER BY COUNT(director) DESC LIMIT 1

Which director did Bill Thompson work the most with ?


Question: What is the full name of the employee in charge of the Southern region who is to report to Andrew Fuller?

SELECT DISTINCT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T4.RegionDescription = 'Southern' AND T1.ReportsTo = ( SELECT EmployeeID FROM Employees WHERE FirstName = 'Andrew' AND LastName = 'Fuller' )

What is the full name of the employee in charge of the Southern region who is to report to Andrew Fuller ?

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


Question: What are the names of the movies not being shown in any theaters?

SELECT Title FROM Movies WHERE Code NOT IN (SELECT Movie FROM MovieTheaters WHERE Movie != 'null')

What are the names of the movies not being shown in any theaters ?

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