Dataset Viewer
Auto-converted to Parquet Duplicate
question_id
int64
11
9.42k
db_id
stringclasses
67 values
grading_method
stringclasses
9 values
question
stringlengths
28
330
evidence
stringlengths
0
576
SQL
stringlengths
41
1.18k
11
movie_platform
set
For all ratings which are rated in year 2020, name the titles of the movies which has the rating scored 4 and above.
ratings in year 2020 refers to rating_timestamp_utc like '%2020%'; rating_score > = 4;
SELECT DISTINCT m.`movie_title` FROM `ratings` r JOIN `movies` m ON r.`movie_id` = m.`movie_id` WHERE SUBSTR(r.`rating_timestamp_utc`,1,4) = '2020' AND r.`rating_score` >= 4;
17
movie_platform
set
What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012?
URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc BETWEEN '2012-1-1' AND '2012-12-31';
SELECT list_url FROM lists WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2
33
movie_platform
set
Among the lists created by user 4208563, which ones have the highest number of followers? Indicate the list ids, how many followers they have, and whether the users were a subscriber or not when they created the lists.
User 4208563 refers to user_id;highest number of followers refers to MAX(list_followers); user_subscriber = 1 means that the user was a subscriber when he created the list; user_subscriber = 0 means the user was not a subscriber when he created the list (to replace); return 1 if the user was a subscriber when the list ...
SELECT T2.list_id, T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 AND T1.list_followers = (SELECT MAX(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND...
37
movie_platform
set
How many users rated the movie "The Magnificent Ambersons" and gave a rating score of no more than 2?
The Magnificent Ambersons refers to movie_title; rating score of no more than 2 refers to rating_score<2
SELECT COUNT(DISTINCT r.`user_id`) AS users_with_low_rating FROM `movies` AS m JOIN `ratings` AS r ON m.`movie_id` = r.`movie_id` WHERE m.`movie_title` = 'The Magnificent Ambersons' AND r.`rating_score` <= 2
38
movie_platform
set
Among users who created a list in the February of 2016 and were eligible for trial when they created the list, which user has the most number of followers in their list in February of 2016? Indicate their ids.
created a list in the February of 2016 refer to list_creation_date_utc BETWEEN 2/1/2016 and 2/29/2016; eligible for trial refers to user_eligible_for_trial = 1;
WITH eligible_users AS (SELECT l.user_id AS user_id, l.list_followers AS list_followers FROM `lists` AS l JOIN `lists_users` AS lu ON l.list_id = lu.list_id AND l.user_id = lu.user_id WHERE lu.list_creation_date_utc BETWEEN '2016-02-01' AND '2016-02-29' AND user_el...
40
movie_platform
set
For each director who have directed at least 10 movies between 1960 and 1985, among the movies directed by this director between 1960 and 1985, which movie received the highest amount of 5 rating score? List the movie titles and the amount of 5 rating scores they received.
directed at least 10 movies refers to count(direct_name)>=10; 1960 to 1985 refer to movie_release_year
WITH qualifying_directors AS ( SELECT `director_id` FROM `movies` WHERE `movie_release_year` BETWEEN 1960 AND 1985 GROUP BY `director_id` HAVING COUNT(*) >= 10 ), qualifying_movies AS ( SELECT m.movie_id, m.director_id, m.movie_title FROM movies m JOIN qualifying_directors qd ON m.direc...
50
movie_platform
set
How many movie lists were still updated more than 10 years after it was created?
updated more than 10 years after it was created refers to list_update_timestamp_utc > (list_creation_timestamp_utc+10);
SELECT COUNT(*) FROM lists WHERE SUBSTR(list_update_timestamp_utc, 1, 4) - SUBSTR(list_creation_timestamp_utc, 1, 4) > 10
53
movie_platform
set
Among the movie lists created after 2010/1/1, how many of them have over 200 followers?
created after 2010/1/1 refers to list_creation_timestamp_utc>'2010/1/1'; over 200 followers refers to list_followers>200;
SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_creation_timestamp_utc > '2010-01-01'
78
movie_platform
set
How many ratings on the movie "A Way of Life" are made after the year 2011?
A Way of Life' is movie_title; rating after the year 2011 refers to rating_timestamp_utc > '2011';
SELECT COUNT(DISTINCT T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_timestamp_utc >= '2012-01-01'
80
movie_platform
set
Please list the movies rated by the user who created the movie list "250 Favourite Films".
250 Favourite Films' is list_title; movies refers to movie_title;
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T3.list_title = '250 Favourite Films'
81
movie_platform
set
What's the average rating score of the movie "A Way of Life"?
A Way of Life' is movie_title; average rating score = Divide (Sum(rating_score), Count(rating_id));
SELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life'
94
movie_platform
set
Please list the names of the top three movies in the total number of likes related to the critic made by the user rating the movie.
likes related to the critic made by the user rating the movie refers to critic_likes; top refers to Max(critic_likes);
SELECT m.`movie_title` FROM `movies` m JOIN `ratings` r ON r.`movie_id` = m.`movie_id` GROUP BY m.`movie_id` ORDER BY SUM(r.`critic_likes`) DESC LIMIT 3;
119
movie_platform
set
What's the number of users gave the movie "Downfall" a rating of "4"?
movie "Downfall" refers to movie_title = 'Downfall'; rating of "4" refers to rating_score = 4
SELECT COUNT(DISTINCT T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Downfall' AND T1.rating_score = 4
157
movie_platform
set
Who is the director that directed the highest number of movies in the 70s? If there are multiple directors with the same amount of movies, list all of their names and indicate the highest rating score that those movies got from the users.
highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979
WITH movies_70s AS ( SELECT `movie_id`, `director_id`, `director_name` FROM `movies` WHERE `movie_release_year` BETWEEN 1970 AND 1979 ), counts AS ( SELECT `director_id`, `director_name`, COUNT(*) AS num_movies FROM movies_70s GROUP BY `director_id` ), max_cnt AS ( SELECT MAX(num_movies) AS max_num FROM c...
166
movie_platform
set
What are the top 10 oldest movies and what are the average rating score for each movie? Indicate the ids of the movies, the average rating scores, the name of the director, and when the movies were released. For movies with the same release year, order by title alphabetically.
the average rating score refers to AVG(T2.rating_score); oldest movies refers to MIN(movie_release_year)
SELECT m.`movie_id`, AVG(r.`rating_score`) AS avg_rating, m.`director_name`, m.`movie_release_year` FROM `movies` AS m LEFT JOIN `ratings` AS r ON r.`movie_id` = m.`movie_id` WHERE m.movie_release_year IS NOT NULL GROUP BY m.`movie_id`, m.`director_name`, m.`movie_release_year` ORDER BY m.`movie_...
177
book_publishing_company
set
List the name of the store with the highest quantity in sales? What is the least quantity title from the store's sale?
qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)
WITH top_store AS ( SELECT `stor_id` FROM `sales` GROUP BY `stor_id` HAVING SUM(`qty`) = ( SELECT SUM(qty) FROM sales GROUP BY stor_id ORDER BY SUM(qty) DESC LIMIT 1) ), top_store_title_quantity AS ( SELECT st.stor_name stor_name, st.stor_id stor_id, ti.title title, SUM(sa.`qty`) title_qty FROM `sales...
209
book_publishing_company
set
Please give more detailed note information about the first four books that sell the best.
qty is abbreviation for quantity; sells the best mean with the most sales quantity; MAX(SUM(qty))
SELECT t.notes FROM `titles` t JOIN ( SELECT `title_id`, SUM(`qty`) AS total_qty FROM `sales` GROUP BY `title_id` ORDER BY total_qty DESC LIMIT 4 ) s ON t.`title_id` = s.`title_id`;
227
book_publishing_company
set
How many sales did the store in Remulade make?
Remulade is a city; sales in the store refers to ord_num
SELECT COUNT(DISTINCT T1.ord_num) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE T2.city = 'Remulade'
230
book_publishing_company
list
Find and list the full name of employees who were hired between 1990 and 1995. Also, arrange them in the descending order of job level.
job level refers to job_lvl; YEAR(hire_date) between 1990 and 1995; full name refers to fname, minit, and lname
SELECT fname, minit, lname FROM employee WHERE STRFTIME('%Y', hire_date) BETWEEN '1990' AND '1995' ORDER BY job_lvl DESC
239
book_publishing_company
list
Name the top five titles that sold more than average and list them in descending order of the number of sales in California stores?
qty is abbreviation for quantity; sold more than average refers to qty > AVG(qty); california refers to state = 'CA"
WITH ca_sales AS ( SELECT s.title_id, SUM(s.qty) AS total_qty FROM sales s JOIN stores st ON s.stor_id = st.stor_id WHERE st.state = 'CA' GROUP BY s.title_id ), avg_ca AS ( SELECT AVG(total_qty) AS avg_qty FROM ca_sales ) SELECT t.title FROM ca_sales cs JOIN avg_ca a JOIN titles t ON ...
248
retail_complains
set
What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL?
full names = first, middle, last; on 2017/3/27 refers to "Date received" = '2017-03-27'; MICHAL refers to server = 'MICHAL';
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.`Date received` = '2017-03-27' AND T2.server = 'MICHAL'
263
retail_complains
set
How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?
days delay for the complaint = SUBTRACT("date sent to company", "Date received"); Mr refers to sex = 'Male'; on 2012/5/18 refers to "Date received" = '2012-05-18';
SELECT CAST( julianday(e.`Date sent to company`) - julianday(e.`Date received`) AS INT) AS days_delay FROM events AS e JOIN client AS c ON c.client_id = e.`Client_ID` WHERE e.`Date received` = '2012-05-18' AND c.first = 'Brantley' AND c.middle = 'Julian' AND c.last = 'Stanley' AND c.s...
273
retail_complains
set
Please list the full name, date of birth, and email id of the elderly clients in descending order of age.
full name = first, middle, last; date of birth = year, month, day; elderly clients refers to age > 65;
SELECT first, middle, last, year, month , day, email FROM client WHERE age > 65 ORDER BY age DESC
282
retail_complains
set
Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.
born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to "Submitted via";
SELECT DISTINCT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'
283
retail_complains
set
What is the medium through which most complaints are registered in Florida?
medium refers to "Submitted via"; most complaints refers to MAX(Complaint ID); Florida refers to state = 'florida';
SELECT E.`Submitted via` FROM `events` AS E JOIN `client` AS C ON E.`Client_ID` = C.`client_id` WHERE C.`state` = 'FL' GROUP BY E.`Submitted via` HAVING COUNT(*) = ( SELECT COUNT(*) FROM `events` AS E JOIN `client` AS C ON E.`Client_ID` = C.`client_id` WHERE C.`state` = 'FL' GROUP BY E.`Submitted via` ORD...
286
retail_complains
set
Find the number of service members who complained in Syracuse.
service members refers to client.client_id; Syracuse refers to city = 'Syracuse';
SELECT COUNT(DISTINCT T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Servicemember' AND T1.city = 'Syracuse'
314
retail_complains
set
What percentage of clients who sent their complaints by postal mail are age 50 and older?
percentage = MULTIPLY(DIVIDE(SUM("Submitted via" = 'Postal mail'), COUNT(client_id)), 1.0); sent their complaints by refers to "Submitted via"; age >= 50;
WITH postal_clients AS ( SELECT DISTINCT c.client_id, c.age FROM events e JOIN client c ON c.client_id = e.Client_ID WHERE e.`Submitted via` = 'Postal mail' ) SELECT 100.0 * SUM(CASE WHEN age >= 50 THEN 1 ELSE 0 END) / COUNT(*) AS pct_clients_50_plus FROM postal_clients
321
retail_complains
set
How long was Kendall Allen's complaint about her credit card?
how long refers to ser_time; credit card refers to Product = 'Credit Card';
SELECT T3.ser_time FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN callcenterlogs AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.first = 'Kendall' AND T2.last = 'Allen' AND T2.sex = 'Female' AND T1.Product = 'Credit card'
324
retail_complains
set
Among all the clients who complained about their credit cards, what is the percentage of male clients?
percentage = MULTIPLY(DIVIDE(SUM(sex = 'Male'), COUNT(client_id)), 1.0); male refers to sex = 'Male'; credit cards refers to Product = 'Credit card';
SELECT 100.0 * SUM(CASE WHEN c.sex = 'Male' THEN 1 ELSE 0 END) / COUNT(*) AS pct_male FROM ( SELECT DISTINCT Client_ID FROM events WHERE Product = 'Credit card' ) cc JOIN client c ON c.client_id = cc.Client_ID;
330
retail_complains
set
List the full names of all clients who live in the Pacific division.
full name refers to first, middle, and last
SELECT T2.first, T2.middle, T2.last FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.division = 'Pacific'
333
retail_complains
set
What is the address of the client who made a complaint via postal mail on March 14, 2012?
address refers to address_1, address_2; via postal mail refers to Submitted via = 'Postal mail'; March 14 2012 refers to Date received = '2012-03-14'
SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-03-14' AND T2.`Submitted via` = 'Postal mail'
340
retail_complains
set
Compute the average time in minute for each age group
teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age > 65; average time per complaint = max(divide(sum(ser_time), count(ser_time)))
SELECT CAST(SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60.0 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END) AS teenagerAverageMins, CAST(SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 60 * st...
385
retail_complains
set
Which state has the most cities?
state refers to state_abbrev; most cities refers to max(count(city))
SELECT state_abbrev FROM district GROUP BY state_abbrev HAVING COUNT(DISTINCT city) = ( SELECT COUNT(DISTINCT city) FROM district GROUP BY state_abbrev ORDER BY COUNT(DISTINCT city) DESC LIMIT 1)
388
retail_complains
set
In 2012, how many complaints about Credit card product came from clients in Omaha?
in 2012 refers to Date received LIKE'2012%'; in Omaha refers to city = 'Omaha'
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Omaha' AND strftime('%Y', T2.`Date received`) = '2012' AND T2.Product = 'Credit card'
402
retail_complains
set
List the products involved in the complaints received on March 2017 via TOVA server.
on March 2017 refers to Date received LIKE '%03%' AND Date received LIKE '2017%'
SELECT DISTINCT T2.Product FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.server = 'TOVA' AND T2.`Date received` LIKE '2017-03%'
440
movies_4
set
How many crew are named John Young?
SELECT COUNT(DISTINCT p.`person_id`) FROM `person` p JOIN `movie_crew` mc ON p.`person_id` = mc.`person_id` WHERE p.`person_name` = 'John Young';
454
movies_4
set
How many horror movies are there?
horror movies refers to genre_name = 'Horror'
SELECT COUNT(DISTINCT T1.movie_id) FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id WHERE T2.genre_name = 'Horror'
457
movies_4
set
In Movie No. 19, how many people are there in Department No. 7? Please also show their jobs in the second column as a comma separated list.
Movie No. 19 refers to movie_id = 19; Department No. 7 refers to department_id = 7
SELECT COUNT(DISTINCT person_id) AS num_people, GROUP_CONCAT(DISTINCT job) AS jobs FROM movie_crew WHERE movie_id = 19 AND department_id = 7;
518
movies_4
set
What is the average number of crews for a movie?
average number of crews = divide(count(person_id), COUNT(movie_id))
SELECT AVG(crew_cnt) AS avg_crew_per_movie FROM ( SELECT `movie_id`, COUNT(DISTINCT `person_id`) AS crew_cnt FROM `movie_crew` GROUP BY `movie_id` );
535
movies_4
set
What percentage of films are made in the US?
films' and 'movies' are synonyms; made in the US refers to country_iso_code = 'US'; percentage = divide(sum(country_id) when country_iso_code = 'US', count(country_id)) * 100 as percentage
SELECT 100.0 * COUNT(DISTINCT CASE WHEN c.`country_iso_code` = 'US' THEN COALESCE(pc.`movie_id`, m.`movie_id`) END) / COUNT(DISTINCT COALESCE(pc.`movie_id`, m.`movie_id`)) AS us_movie_percentage FROM `movie` AS m FULL JOIN `production_country` pc ON m.`movie_id` = pc.`movie_id` LEFT JOIN `country` c ...
536
movies_4
set
What is the average ratio between female and male characters in a movie?
female refers to gender = 'Female'; male refers to gender = 'Male'; average ratio = divide(sum(gender_id) when gender = 'Female', sum(gender_id) when gender = 'Male')
SELECT AVG(1.0 * female_cnt / male_cnt) AS avg_female_male_ratio FROM ( SELECT mc.movie_id, SUM(CASE WHEN g.gender = 'Female' THEN 1 ELSE 0 END) AS female_cnt, SUM(CASE WHEN g.gender = 'Male' THEN 1 ELSE 0 END) AS male_cnt FROM movie_cast mc JOIN gender g ON mc.gender_id = g.gender_id GROUP ...
559
movies_4
set
What is the role of Mark Hammel?
role refers to job
SELECT T2.job FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Mark Hammel'
563
movies_4
set
What is the proportion of horror movies among all movies genre?
horror movies refers to genre_name = 'horror'; average number = divide(sum(movie_id) when genre_name = 'horror', count(movie_id))*100
SELECT CAST(COUNT(DISTINCT CASE WHEN T3.genre_name = 'Horror' THEN T1.movie_id ELSE NULL END) AS REAL) * 100.0 / COUNT(DISTINCT T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id
566
codebase_comments
set
How many English language codes whose comments for the method are in the XML format?
English language refers to Lang = 'en'; the comments for this method is XML format refers to CommentIsXml = 1;
SELECT COUNT(Lang) FROM Method WHERE Lang = 'en' AND CommentIsXml = 1
575
codebase_comments
set
Which repository has the longest amount of processed time of downloading? Indicate whether the solution paths in the repository can be implemented without needs of compilation, Yes or No
longest amount of processed time refers to max(ProcessedTime); the repository can be implemented without needs of compilation refers to WasCompiled = 1 for all solutions;
SELECT r.Id AS RepoId, CASE WHEN MIN(CASE WHEN s.WasCompiled = 1 THEN 1 ELSE 0 END) = 1 THEN 'Yes' ELSE 'No' END AS CanRunWithoutCompilation FROM Repo r LEFT JOIN Solution s ON s.RepoId = r.Id WHERE r.ProcessedTime = (SELECT MAX(ProcessedTime) FROM Repo) GROUP BY r.Id;
579
codebase_comments
set
How many solution paths are there inside the 2nd most popular repository?
more watchers mean that this repository is more popular; most popular repository refers to max(Watchers);
SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT Watchers FROM Repo ORDER BY Watchers DESC LIMIT 1, 1 )
588
codebase_comments
set
Are the comments for the method "HtmlSharp.HtmlParser.Feed" in XML format? Yes or No.
the comment for this method is not XML refers to CommentsXML = 0; the comments for this method is XML refers to CommentsXML = 1
SELECT CASE WHEN CommentIsXml = 0 THEN 'No' WHEN CommentIsXml = 1 THEN 'Yes' END isXMLFormat FROM Method WHERE Name = 'HtmlSharp.HtmlParser.Feed'
594
codebase_comments
set
Which solution contains files within a more popular repository, the solution ID18 or solution ID19?
more watchers mean that this repository is more popular;
SELECT CASE WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) > SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'solution ID18' WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) < SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'solution ID19' END isMorePopular FROM Repo AS T1 IN...
596
codebase_comments
set
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_tachy\src\Tachy.sln'
617
codebase_comments
set
Give the number of watchers that the repository of the solution No. 326689 have.
number of watchers refers to Watchers; solution number refers to Solution.Id;
SELECT T1.Watchers FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 326689
618
codebase_comments
set
For each repository that got 189 Stars, how many solutions that needs to be compiled does it contain? List the repository ids and the number of mentioned solutions, respsectively.
repository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;
SELECT r.Id AS RepoId, COUNT(s.Id) AS NumSolutionsNeedingCompile FROM Repo r LEFT JOIN Solution s ON r.Id = s.RepoId AND s.WasCompiled = 0 WHERE r.Stars = 189 GROUP BY r.Id;
624
codebase_comments
set
For the solution of the most 'sw' methods, what is its path?
solution refers to SolutionId; sw refers to Lang = 'sw'; solution with the most 'sw' methods refers to MAX(COUNT(Lang = 'sw'));
WITH sw_counts AS (SELECT `SolutionId`, COUNT(*) AS cnt FROM `Method` WHERE `Lang` = 'sw' GROUP BY `SolutionId`), max_cnt AS (SELECT MAX(cnt) AS max_cnt FROM sw_counts) SELECT `S`.`Path` FROM `Solution` AS `S` JOIN sw_counts AS `C` ON `C`.`SolutionId` = `S`.`Id` JOIN max_cnt AS `M` ON `C`.`cnt` = `M`.`max_cnt`;
656
codebase_comments
set
Among the english methods, please list the tokenized names of methods whose solutions does not need to be compiled.
english methods refers to lang = 'en'; tokenized name refers to NameTokenized; solution needs to be compiled refers to WasCompiled = 0;
SELECT NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE Lang = 'en' AND WasCompiled = 1
670
codebase_comments
set
How many methods in the same repository share a tokenized name that begins with "query language..."?
tokenized name refers to NameTokenized; NameTokenized LIKE 'query language%';
SELECT SUM(cnt) FROM ( SELECT s.`RepoId` AS RepoId, COUNT(*) AS cnt FROM `Method` m JOIN `Solution` s ON s.`Id` = m.`SolutionId` WHERE m.`NameTokenized` LIKE 'query language%' GROUP BY s.`RepoId` HAVING COUNT(*) > 1 );
743
movie
set
How much longer in percentage is the screen time of the most important character in Batman than the least important one?
most important character refers to max(screentime); least important character refers to min(screentime); movie Batman refers to title = 'Batman'; percentage = divide(subtract(max(screentime) , min(screentime)) , min(screentime)) * 100%
WITH t AS ( SELECT a.Name Name, CAST(substr(c.`screentime`,1,instr(c.`screentime`,':')-1) AS REAL) * 3600 + CAST(substr(c.screentime, -5, 2) AS REAL) * 60 + CAST(substr(c.screentime, -2, 2) AS REAL) total_seconds FROM movie m join characters c on m.MovieID = c.MovieID join actor a on a.ActorID = c.ActorID where m.`Tit...
747
movie
set
Who were the actors that played in the movie "Batman" with the longest screentime?
movie "Batman" refers to Title = 'Batman'; longest screentime refers to max(screentime)
WITH t AS ( SELECT a.Name Name, CAST(substr(c.`screentime`,1,instr(c.`screentime`,':')-1) AS INTEGER) hours, CAST(substr(c.screentime, -5, 2) AS INTEGER) minutes, CAST(substr(c.screentime, -2, 2) AS INTEGER) seconds FROM movie m join characters c on m.MovieID = c.MovieID join actor a on a.ActorID = c.ActorID where m.`...
748
movie
set
How many movies has the highest networth actor acted in?
highest networth refers to max(networth)
SELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T2.NetWorth, ',', ''), '$', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(REPLACE(NetWorth, ',', ''), '$', '') AS REAL)) FROM actor)
765
movie
set
What are the genres of PG rated movies starred by the actors with highest net worth?
PG rated refers to MPAA Rating = 'PG';  highest net worth refers to max(NetWorth)
SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' AND CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) = (SELECT MAX(CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL)) FROM movi...
774
movie
set
Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%
SELECT 100.0 * COUNT(DISTINCT CASE WHEN CAST(REPLACE(REPLACE(`actor`.`NetWorth`, ',', ''), '$', '') AS REAL) > 400000000 THEN `actor`.`ActorID` END) / COUNT(DISTINCT `actor`.`ActorID`) AS percentage FROM `movie` JOIN `characters` ON `movie`.`MovieID` = `characters`.`MovieID` JOIN `actor` ON `actor`.`ActorID` = `charact...
851
social_media
set
Among all the tweets sent by male users in Argentina, what is the text of the one with the most number of likes?
male user refers to Gender = 'Male'; 'Argentina' is the Country; most number of likes refers to Max(Likes)
SELECT T2.text FROM user AS T1 INNER JOIN twitter AS T2 ON T1.UserID = T2.UserID INNER JOIN location AS T3 ON T2.LocationID = T3.LocationID WHERE T3.Country = 'Argentina' AND T1.Gender = 'Male' AND T2.Likes = (SELECT MAX(T5.Likes) FROM user AS T4 INNER JOIN twitter AS T5 ON T4.UserID = T5.UserID INNER JOIN location AS ...
862
cs_semester
set
Please list the full names of all the students who took the course Machine Learning Theory.
full name refers to f_name and l_name;
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 = 'Machine Learning Theory'
866
cs_semester
set
Which student is more satisfied with the course Machine Learning Theory, Willie Rechert or Laughton Antonio?
sat refers to student's satisfaction degree with the course; more satisfied refers to MAX(sat);
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 (T1.f_name = 'Laughton' OR T1.f_name = 'Willie') AND (T1.l_name = 'Antonio' OR T1.l_name = 'Rechert') AND T3.name = 'Machine Learning Theory' ORDER B...
869
cs_semester
set
Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name.
research assistant refers to the student who serves for research where the abbreviation is RA; prof_id refers to professor’s ID; full name refers to f_name and l_name;
SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Willie' AND T3.l_name = 'Rechert'
905
cs_semester
set
How many students taking a bachelor's degree received an A in all of the courses that they took?
bachelor's degree is an undergraduate degree in which type = 'UG'; A refers to an excellent grade in which grade = 'A';
SELECT COUNT(*) FROM `student` AS s WHERE s.`type` = 'UG' AND EXISTS (SELECT 1 FROM `registration` AS r1 WHERE r1.`student_id` = s.`student_id`) AND NOT EXISTS ( SELECT 1 FROM `registration` AS r2 WHERE r2.`student_id` = s.`student_id` AND (r2.`grade` IS...
908
cs_semester
set
Name the professor who got graduation from the University of Boston.
Name the professor refers to full name which includes f_name and l_name;
SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'
916
cs_semester
set
Among students registered for the most difficult course, list the students' full names who got grade A.
difficulty refers to diff; most difficult course refers to MAX(diff); student's full names = f_name, l_name;
SELECT DISTINCT s.`f_name`, s.`l_name` FROM `student` AS s JOIN `registration` AS r ON s.`student_id` = r.`student_id` JOIN `course` AS c ON r.`course_id` = c.`course_id` WHERE c.`diff` = (SELECT MAX(`diff`) FROM `course`) AND r.`grade` = 'A';
930
cs_semester
set
Among the students with high salary, what is total number of students with a GPA higher than 3?
high salary refers to salary = 'high'; GPA higher than 3 refers to gpa > 3;
SELECT COUNT(DISTINCT T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T2.gpa > 3
945
cs_semester
set
Among the students with less than four intelligence, list the full name and phone number of students with a greater than 3 GPA.
intelligence < 4; full name = f_name, l_name; gpa > 3;
SELECT f_name, l_name, phone_number FROM student WHERE gpa > 3 AND intelligence < 4
955
cs_semester
set
Calculate the difference in average satisfaction between students with 'high' salaries and those with 'free' salaries, based on each student's mean satisfaction score.
average satisfaction difference = SUBTRACT(AVG(sat where salary = 'high')), (AVG(sat where salary = 'free')); satisfaction refers to sat; no salary refers to salary = 'free';
WITH ra_flag AS ( SELECT `student_id`, MAX(CASE WHEN `salary` = 'high' THEN 1 END) AS high_flag, MAX(CASE WHEN `salary` = 'free' THEN 1 END) AS free_flag FROM `RA` GROUP BY `student_id` ), student_sat AS ( SELECT `student_id`, AVG(`sat`) AS avg_sat FROM `registration` GROUP...
956
cs_semester
set
Find the university from which the professor who advised most undergraduate students graduated.
university from which the professor graduated refers to graduate_from; undergraduate students refers to type = 'UG';
SELECT T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.type = 'UG' GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1
957
cs_semester
set
Among the professors with more than average teaching ability, list the full name and email address of the professors who advise two or more students.
more than average teaching ability refers to teachingability > AVG(teachingability); full_name of the professor = first_name, last_name; email address of the professor refers to email; advises two or more students refers to COUNT(student_id) > = 2;
SELECT T2.first_name, T2.last_name, T2.email FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability > ( SELECT AVG(teachingability) FROM prof ) GROUP BY T2.prof_id HAVING COUNT(T1.student_id) >= 2
964
cs_semester
set
List the student's first and last name that got a C in the course named "Applied Deep Learning".
student's first name refers to f_name; student's last name refers to l_name; got a C refers to grade = 'C';
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 = 'Applied Deep Learning ' AND T2.grade = 'C'
972
computer_student
set
Provide the ID of professors who are teaching high-level or harder undergraduate course.
ID of professors refers to taughtBy.p_id; high-level or harder undergraduate course refers to courseLevel = 'Level_400'
SELECT DISTINCT tb.`p_id` FROM `taughtBy` tb JOIN `course` c ON c.`course_id` = tb.`course_id` JOIN `person` p ON p.`p_id` = tb.`p_id` WHERE c.`courseLevel` = 'Level_400' AND p.`professor` = 1;
1,000
computer_student
set
What is the average number of courses taught by a professor?
professor refers to professor = 1; average number of courses = divide(count(taughtBy.course_id), count(taughtBy.p_id) where professor = 1 )
SELECT CAST(SUM(CASE WHEN tb.course_id IS NULL THEN 0 ELSE 1 END) AS REAL) / COUNT(*) AS avg_courses_per_prof FROM person p LEFT JOIN taughtBy tb ON p.p_id = tb.p_id WHERE p.professor = 1;
1,018
computer_student
set
Which professors taught the least amount of courses?
professor refers to taughtBy.p_id; least amount of courses refers to min(count(course_id))
SELECT t.`p_id` FROM `taughtBy` t JOIN `person` p ON p.`p_id` = t.`p_id` WHERE p.`professor` = 1 GROUP BY t.`p_id` HAVING COUNT(*) = (SELECT MIN(cnt) FROM (SELECT COUNT(*) AS cnt FROM `taughtBy` t2 JOIN `person` p2 ON p2.`p_id` = t2.`p_id` WHERE p2.`professor` = 1 GROUP BY t2.`p_id`))
1,024
computer_student
set
How many professors teaches no more than two high-level or harder undergraduate courses?
professors refers to taughtBy.p_id; high-level or harder undergraduate courses  refers to courseLevel = 'Level_400' ; no more than two refers to count(taughtBy.course_id) < = 2
SELECT COUNT(*) FROM ( SELECT p.`p_id` FROM `person` AS p LEFT JOIN `taughtBy` AS tb ON p.`p_id` = tb.`p_id` LEFT JOIN `course` AS c ON tb.`course_id` = c.`course_id` AND c.`courseLevel` = 'Level_400' WHERE p.`professor` = 1 GROUP BY p.`p_id` HAVING COUNT(DISTINCT c.`c...
1,027
computer_student
set
What year in the program do the students with more than 2 advisors are in?
students refers to student = 1; more than 2 advisors refers to count(p_id_dummy) > 2
SELECT T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T2.p_id HAVING COUNT(T2.p_id) > 2
1,028
computer_student
set
How many professors teaches basic or medium undergraduate courses?
professors refers to taughtBy.p_id; basic or medium undergraduate courses refers to couresLevel = 'Level_300'
SELECT COUNT(DISTINCT tb.`p_id`) FROM `taughtBy` AS tb JOIN `course` AS c ON c.`course_id` = tb.`course_id` JOIN `person` AS p ON p.`p_id` = tb.`p_id` WHERE c.`courseLevel` = 'Level_300' AND p.`professor` = 1;
1,045
talkingdata
set
What is the name of the category which most users belong to?
most users belong to refers to MAX(COUNT(app_id)); name of category refers to category;
WITH category_cnt AS ( SELECT T2.category, COUNT(DISTINCT 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 T2.category ) SELECT category FROM category_cnt WHERE num = (SELECT MAX(num) FROM category_cnt)
1,046
talkingdata
set
What are the models of the oldest users' devices?
model of the device refers to device_model; oldest user refers to MAX(age);
SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T2.age = ( SELECT MAX(age) FROM gender_age );
1,050
talkingdata
set
What is the age of the oldest active user that participated in the event held on 5/2/2016 at coordinates 120, 32?
oldest user refers to MAX(age); active user refers to is_active = 1; on 5/6/2016 refers to timestamp LIKE '2016-05-06%'; coordinates 121, 31 refers to longitude = 120 AND latitude = 32;
SELECT T3.age FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.device_id = T3.device_id WHERE T1.is_active = 1 AND T2.longitude = 120 AND T2.latitude = 32 AND SUBSTR(T2.timestamp, 1, 10) = '2016-05-02' ORDER BY T3.age DESC LIMIT 1
1,055
talkingdata
set
How many users belong to the MOBA category?
SELECT COUNT(DISTINCT T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'MOBA'
1,061
talkingdata
set
What is the ratio of male and female users in 27-28 age group?
ratio = DIVIDE(COUNT(device_id WHERE gender = 'M' AND `group` = 'M27-28'), COUNT(device_id WHERE gender = 'F' AND `group` = 'F27-28')); 27-28 age group refers to `group` = 'F27-28';
SELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1.0, 0.0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1.0, 0.0)) AS r FROM gender_age
1,067
talkingdata
set
Describe the ages, genders and numbers of events participated by the users at coordinates of (-102,38).
coordinates of (-102,38) refers to longitude = -102, latitude = 38;
SELECT ga.age, ga.gender, COUNT(e.event_id) AS num_events FROM gender_age AS ga JOIN events AS e ON e.`device_id` = ga.`device_id` WHERE e.`longitude` = -102 AND e.`latitude` = 38 GROUP BY ga.`device_id`;
1,098
talkingdata
set
Among all the users who use a vivo device, what is the percentage of the users in the M23-26 user group?
vivo device refers to phone_brand = 'vivo'; percentage = MULTIPLY(DIVIDE(COUNT(phone_brand = 'vivo WHERE group = 'M23-26), COUNT(phone_brand = 'vivo)), 100); M23-26 user group refers to group = 'M23-26';
SELECT SUM(IIF(T.`group` = 'M23-26', 1.0, 0)) / COUNT(T.device_id) * 100 AS per FROM ( SELECT T1.`group`, T1.device_id FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' GROUP BY T1.device_id) T
1,104
talkingdata
set
What is the age of the youngest female user of the app?
youngest user refers to MIN(age); female refers to gender = 'F';
SELECT MIN(age) FROM gender_age WHERE gender = 'F'
1,144
talkingdata
set
Among the devices with an event occurring in 2016, how many of them are owned by a user in the M23-26 user group?
in 2016 refers to year(timestamp) = 2016; M23-26 user group refers to `group` = 'M23-26';
SELECT COUNT(DISTINCT T1.device_id) FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE STRFTIME('%Y', T2.timestamp) = '2016' AND T1.`group` = 'M23-26'
1,154
talkingdata
set
Among all users who have at least one event on their device, what are the event IDs that occurred on the device of the oldest user? Please list those event IDs.
oldest user refers to MAX(age);
SELECT T2.event_id FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE T1.age = ( SELECT MAX(T3.age) FROM gender_age AS T3 INNER JOIN events AS T4 ON T3.device_id = T4.device_id)
1,156
talkingdata
set
Among the devices on which an event happened on 2016/5/1, how many of them are used by a male user?
on 2016/5/1 refers to timestamp = '2016-05-01'; male refers to gender = 'M';
SELECT COUNT(DISTINCT e.device_id) FROM `events` AS e JOIN `gender_age` AS g ON e.device_id = g.device_id WHERE date(e.`timestamp`) = '2016-05-01' AND g.gender = 'M';
1,175
talkingdata
set
How many OPPO users participated in events which were held around 12 AM on 1st May,2016?
OPPO refers to phone_brand = 'OPPO'; around 12 AM on 1st May, 2016 refers to a timestamp starting with '2016-05-01 00'
SELECT COUNT(DISTINCT e.device_id) AS oppo_users_midnight FROM events e JOIN phone_brand_device_model2 p ON e.device_id = p.device_id WHERE p.phone_brand = 'OPPO' AND STRFTIME('%Y-%m-%d', e.`timestamp`) = '2016-05-01' AND STRFTIME('%H', e.`timestamp`) = '00'
1,183
talkingdata
set
How many active users are there in the event?
active refers to is_active = 1;
SELECT COUNT(DISTINCT app_id) FROM app_events WHERE is_active = 1
1,187
talkingdata
set
What is the age group of users who use phone brand of vivo?
age group refers to group;
SELECT DISTINCT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'
1,192
talkingdata
set
Mention the group of age of users who use phone brand of LG.
group of age refers to group;
SELECT DISTINCT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'LG'
1,220
talkingdata
subset,=,3
Please list the ids of any three devices that are owned by female users.
female refers to gender = 'F';
SELECT device_id FROM gender_age WHERE gender = 'F'
1,234
talkingdata
set
What is the percentage of users who are in the same behavior category as "Academic Information"?
percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 100.0); behavior category refers to category; category = 'Academic Information';
WITH selected_app_ids AS ( SELECT DISTINCT app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id AND T1.category = 'Academic Information' ) SELECT (SELECT COUNT(*) FROM selected_app_ids) * 100 / (SELECT COUNT(DISTINCT app_id) FROM app_labels)
1,235
talkingdata
set
Among users who experienced an event on the 3rd of May 2016, what is the percentage of device users in the F27-28 age group?
percentage = MULTIPLY(DIVIDE(SUM(`group` = 'F27-28'), COUNT(device_id)), 100.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%';
WITH device_on_day AS ( SELECT DISTINCT `device_id` FROM `events` WHERE SUBSTR(`timestamp`,1,10) = '2016-05-03' ) SELECT 100.0 * SUM(CASE WHEN ga.`group` = 'F27-28' THEN 1 ELSE 0 END) / COUNT(*) AS percentage_F27_28 FROM device_on_day d JOIN gender_age ga ON ga.`device_id` = d.`device_id`;
1,244
talkingdata
set
What percentage of vivo devices belong to users with no information?
percentage = MULTIPLY(DIVIDE(SUM(gender = NULL and age = NULL and `group` = NULL), COUNT(device_id)), 100.0); vivo devices refers to phone_brand = 'vivo'; no information refers to gender = NULL AND age = NULL AND `group` = NULL;
SELECT SUM(CASE WHEN GA.`gender` IS NULL AND GA.`age` IS NULL AND GA.`group` IS NULL THEN 1 ELSE 0 END)*100.0/COUNT(*) AS percentage_no_info FROM `phone_brand_device_model2` P LEFT JOIN `gender_age` GA ON GA.`device_id` = P.`device_id` WHERE P.`phone_brand` = 'vivo';
1,269
law_episode
set
How many times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode?
"Refuge: Part 1" episode refers to title = 'Refuge: Part 1'; "Shield" episode refers to title = 'Shield'; times = divide(count(keyword where title = 'Refuge: Part 1'), count(keyword where title = 'Shield'))
SELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id
1,290
law_episode
set
What is the title of the episode that has the highest number of crews in the Art Department?
the highest number of crews refers to max(count(person_id)); in the Art Department refers to category = 'Art Department'
SELECT E.`title` FROM `Episode` AS E JOIN `Credit` AS C ON C.`episode_id` = E.`episode_id` WHERE C.`category` = 'Art Department' GROUP BY E.`episode_id` HAVING COUNT(*) = ( SELECT MAX(cnt) FROM ( SELECT COUNT(*) AS cnt FROM `Credit` WHERE `category` = 'Art Department' GROUP BY `e...
1,296
law_episode
set
Who is the person who appeared the most in the series? Calculate in percentage of episodes he or she appeared.
who refers to name; appear the most refers to max(count(person_id)); percentage = divide(count(person_id where max(count(person_id))), count(episode)) * 100%; "appeared" refers to `category` = 'Cast'
SELECT p.`name`, 100.0 * COUNT(*) / (SELECT COUNT(*) FROM `Episode`) AS appearance_pct FROM `Credit` c JOIN `Person` p ON p.`person_id` = c.`person_id` WHERE c.category = 'Cast' GROUP BY p.`person_id` HAVING COUNT(*) = (SELECT MAX(cnt) FROM (SELECT COUNT(*) AS cnt FROM `Credit` WHERE category = 'Cast' GROUP BY `person_...
End of preview. Expand in Data Studio

BIRD-Platinum-Hard

BIRD-Platinum-Hard is a 689-question subset of the BIRD-Platinum training questions, across 67 databases. It keeps the questions that strong models most often failed to solve on every attempt early in reinforcement-learning training. A pass over it samples about a third as many questions as an epoch over the full 2,064-question training split.

How the questions were selected

We trained four models with our text-to-SQL recipe: GLM-5.3 Flash, Kimi K2.6, DeepSeek V4.1 Flash and Qwen3.8-27B. Each training question was attempted 16 times on its first visit. A question is in BIRD-Platinum-Hard if fewer than three of the four models answered all 16 attempts correctly.

Models that solved it 16/16 Questions Included
0 362 yes
1 127 yes
2 200 yes
3 368 no
4 1,007 no

One first visit is a noisy measurement: two runs of the same model agree on about 87–91% of the questions they solve 16/16. Read the set as "often not fully solved", not "never solved".

In our experiments, training on this subset improved faster early on and plateaued sooner than training on the full split.

Fields

The records are exactly the rows our recipe trained on: the ReViSQL authors' verified release of BIRD-Platinum (bird-verified-train.json in the ReViSQL repository). That release corrects some records of the candidate file published as uiuc-kang-lab/bird-platinum. Within this subset, 11 questions, 17 evidence texts and 15 gold queries differ from the candidate file, and 627 questions carry a different grading method (mostly set where the candidate file says multiset). Question 1104 differs from the authors' file itself, in its grading annotation only; we publish the value we trained with.

  • question_id: the BIRD question id, also BIRD-Platinum's id
  • db_id: the BIRD training database the question runs against
  • question, evidence, SQL: the question, its external knowledge and the gold query
  • grading_method: how query results are compared (for example set, or subset,=,5)

The databases are BIRD's training databases, available from the BIRD benchmark. They are not included here.

The split config

The BIRD-Platinum candidate file has 2,463 records and no partition. Our recipe uses the train/validation partition from the ReViSQL authors' verified release: 2,064 training and 398 validation questions (1 upstream record is in neither). The split config lists each question_id with its side. Every BIRD-Platinum-Hard question is on the training side.

Usage

from datasets import load_dataset

hard = load_dataset("scottfitz/BIRD-Platinum-Hard", split="train")
partition = load_dataset("scottfitz/BIRD-Platinum-Hard", "split", split="train")

License and attribution

CC BY-SA 4.0. This dataset is a subset of the ReViSQL authors' verified release of BIRD-Platinum (Zhu et al., 2026), which is derived from BIRD (Li et al., 2023). BIRD and BIRD-Platinum are licensed CC BY-SA 4.0. Changes: we selected a subset of questions; the records are as we trained on them, described under Fields.

Citation

@article{zhu2026revisql,
  title   = {Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering},
  author  = {Zhu, Yuxuan and Jin, Tengjun and Choi, Yoojin and Kang, Daniel},
  journal = {arXiv preprint arXiv:2603.20004},
  year    = {2026}
}

@inproceedings{li2023bird,
  title     = {Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs},
  author    = {Li, Jinyang and others},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2023}
}
Downloads last month
83

Paper for scottfitz/BIRD-Platinum-Hard