question
stringlengths
23
286
db_id
stringclasses
11 values
evidence
stringlengths
0
468
SQL
stringlengths
35
1.58k
difficulty
stringclasses
3 values
question_id
int64
5
1.53k
Who is the owner of the post "Eliciting priors from experts"?
codebase_community
"Eliciting priors from experts" is the Title of post; owner refers to DisplayName
SELECT `T2`.`DisplayName` FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T1`.`Title` = 'Eliciting priors from experts'
simple
539
How many posts does the user csgillespie own?
codebase_community
"csgillespie" is the DisplayName of user
SELECT COUNT(`T1`.`id`) FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T2`.`DisplayName` = 'csgillespie'
simple
537
What is the display name of the user who last edited the post "Examples for teaching: Correlation does not mean causation"?
codebase_community
"Examples for teaching: Correlation does not mean causation" is the Title of post; user who last edited refers to LastEditorUserId
SELECT `T2`.`DisplayName` FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`LastEditorUserId` = `T2`.`Id` WHERE `T1`.`Title` = 'Examples for teaching: Correlation does not mean causation'
moderate
544
Among the posts owned by an elder user, how many of them have a score of over 19?
codebase_community
elder users refers to Age > 65; Score of over 19 refers to Score > = 20
SELECT COUNT(`T1`.`Id`) FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T1`.`Score` >= 20 AND `T2`.`Age` > 65
simple
547
From which post is the tag "bayesian" excerpted from? Please give the body of the post.
codebase_community
"bayesian" is the TagName; excerpt from refers to ExcerptPostId
SELECT `T2`.`Body` FROM `tags` AS `T1` INNER JOIN `posts` AS `T2` ON `T2`.`Id` = `T1`.`ExcerptPostId` WHERE `T1`.`TagName` = 'bayesian'
simple
549
What is the average score of the posts owned by the user csgillespie?
codebase_community
"csgillespie" is the DisplayName of user; average score refers to AVG(Score)
SELECT AVG(`T1`.`Score`) FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T2`.`DisplayName` = 'csgillespie'
simple
555
Among the posts with a score of over 5, what is the percentage of them being owned by an elder user?
codebase_community
score of over 5 refers to Score > 5; elder user refers to Age > 65; percentage = Divide (Count(Id where Age>65), Count(Id)) * 100
SELECT CAST(SUM(CASE WHEN `T2`.`Age` > 65 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`Id`) FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T1`.`Score` > 5
moderate
557
User No.3025 gave a comment at 20:29:39 on 2014/4/23 to a post, how many favorite counts did that post get?
codebase_community
user no. 3025 refers to UserId = '3025'; comment at 20:29:39 on 2014/4/23 refers to CreationDate = '2014/4/23 20:29:39.0'
SELECT `T1`.`FavoriteCount` FROM `posts` AS `T1` INNER JOIN `comments` AS `T2` ON `T1`.`Id` = `T2`.`PostId` WHERE `T2`.`CreationDate` = '2014-04-23 20:29:39.0' AND `T2`.`UserId` = 3025
moderate
563
User No.23853 gave a comment to a post at 9:08:18 on 2013/7/12, was that post well-finished?
codebase_community
user no. 23853 refers to UserId = '23853'; at 9:08:18 on 2013/7/12 refers to CreationDate = '2013-07-12 09:08:18.0'; not well-finished refers to ClosedDate IS NULL and vice versa
SELECT CASE WHEN `T2`.`ClosedDate` IS NULL THEN 'NOT well-finished' ELSE 'well-finished' END AS `resylt` FROM `comments` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`PostId` = `T2`.`Id` WHERE `T1`.`UserId` = 23853 AND `T1`.`CreationDate` = '2013-07-12 09:08:18.0'
moderate
565
For the user with the display name of "Tiago Pasqualini", how many posts did he/she own?
codebase_community
"Tiago Pasqualini" is the DisplayName;
SELECT COUNT(`T1`.`Id`) FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` WHERE `T1`.`DisplayName` = 'Tiago Pasqualini'
simple
567
Provide the display name of the user who made the vote No.6347.
codebase_community
vote no. 6347 refers to Id = '6347'
SELECT `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `votes` AS `T2` ON `T1`.`Id` = `T2`.`UserId` WHERE `T2`.`Id` = 6347
simple
568
For the user No.24, how many times is the number of his/her posts compared to his/her votes?
codebase_community
user no. 24 refers to UserId = OwnerUserId = '24'; times of his/her post than votes = Divide (Count(post.Id), Count(votes.Id))
SELECT CAST(COUNT(DISTINCT `T2`.`Id`) AS DOUBLE) / COUNT(DISTINCT `T1`.`Id`) FROM `votes` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`UserId` = `T2`.`OwnerUserId` WHERE `T1`.`UserId` = 24
moderate
571
How many views did the post titled 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer' get?
codebase_community
"Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer" is the Title of post; views refers to ViewCount
SELECT `ViewCount` FROM `posts` WHERE `Title` = 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer'
moderate
572
Write the contents of comments with a score of 17.
codebase_community
score of 17 refers to Score = 17; contents of comments refers to Text
SELECT `Text` FROM `comments` WHERE `Score` = 17
simple
573
Name the user that commented 'thank you user93!'
codebase_community
"thank you user93" is the Text of comment; user refers to DisplayName
SELECT `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `comments` AS `T2` ON `T1`.`Id` = `T2`.`UserId` WHERE `T2`.`Text` = 'thank you user93!'
simple
576
Which user made a post titled 'Understanding what Dassault iSight is doing?' and how much is the reputation of the user?
codebase_community
"Understanding what Dassault iSight is doing?" is the Title of post; user refers to DisplayName;
SELECT `T1`.`DisplayName`, `T1`.`Reputation` FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` WHERE `T2`.`Title` = 'Understanding what Dassault iSight is doing?'
moderate
578
Who is the owner of the post titled 'Open source tools for visualizing multi-dimensional data?'
codebase_community
'Open source tools for visualizing multi-dimensional data' is the Title of Post; owner refers to DisplayName;
SELECT `T2`.`DisplayName` FROM `posts` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`OwnerUserId` = `T2`.`Id` WHERE `T1`.`Title` = 'Open source tools for visualizing multi-dimensional data?'
moderate
581
Write all the comments left by users who edited the post titled 'Why square the difference instead of taking the absolute value in standard deviation?'
codebase_community
"Why square the difference instead of taking the absolute value in standard deviation?" is the Title of post;
SELECT `T2`.`Comment` FROM `posts` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`PostId` WHERE `T1`.`Title` = 'Why square the difference instead of taking the absolute value in standard deviation?'
moderate
584
Which user added a bounty amount of 50 to the post title mentioning variance?
codebase_community
bounty amount of 50 refers to BountyAmount = 50; user refers to DisplayName; title mentioning variance refers to Title include 'variance'
SELECT `T3`.`DisplayName`, `T1`.`Title` FROM `posts` AS `T1` INNER JOIN `votes` AS `T2` ON `T1`.`Id` = `T2`.`PostId` INNER JOIN `users` AS `T3` ON `T3`.`Id` = `T2`.`UserId` WHERE `T2`.`BountyAmount` = 50 AND `T1`.`Title` LIKE '%variance%'
challenging
586
Calculate the average view count of each post tagged as 'humor' and list the title and the comment of each post.
codebase_community
tagged as 'humor' refers to tag = '<humor>'; comment of the post refers to Text; average view count = AVG(ViewCount)
SELECT AVG(T2.ViewCount) AS average_view_count, T2.Title, T1.Text FROM comments AS T1 INNER JOIN posts AS T2 ON T2.Id = T1.PostId WHERE T2.Tags = '<humor>' GROUP BY T2.Title, T1.Text
moderate
587
How many users are awarded with more than 5 badges?
codebase_community
more than 5 badges refers to Count (Name) > 5; user refers to UserId
SELECT COUNT(`UserId`) FROM ( SELECT `UserId`, COUNT(`Name`) AS `num` FROM `badges` GROUP BY `UserId` ) AS `T` WHERE `T`.`num` > 5
simple
592
Which user have only one post history per post and having at least 1000 views?
codebase_community
having at least 1000 view refers to Views > = 1000; user refers to UserId
SELECT `T2`.`UserId` FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `posts` AS `T3` ON `T2`.`PostId` = `T3`.`Id` WHERE `T3`.`ViewCount` >= 1000 GROUP BY `T2`.`UserId` HAVING COUNT(DISTINCT `T2`.`PostHistoryTypeId`) = 1
moderate
595
What is the percentage difference of student badges given during 2010 and 2011?
codebase_community
student badges refers to badge's name = 'Student'; during 2010 refers to Year(Date) = 2010; during 2011 refers to Year(Date) = 2011; percentage difference = Subtract (Divide(Count(Name where Year(Date) = 2010), Count (Name)) *100, Divide(Count(Name where Year(Date) = 2011), Count(Name)) * 100)
SELECT CAST(SUM(CASE WHEN DATE_FORMAT(CAST(`Date` AS DATETIME), '%Y') = '2010' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`Id`) - CAST(SUM(CASE WHEN DATE_FORMAT(CAST(`Date` AS DATETIME), '%Y') = '2011' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`Id`) FROM `badges` WHERE `Name` = 'Student'
challenging
598
What is the average of the up votes and the average user age for users creating more than 10 posts?
codebase_community
creating more than 10 post refers to Count (UserId) > 10; average of the up votes = Divide (Sum(UpVotes), Count (UserId)); average age = Divide (Sum(Age), Count(UserId))
SELECT AVG(`T1`.`UpVotes`), AVG(`T1`.`Age`) FROM `users` AS `T1` INNER JOIN ( SELECT `OwnerUserId`, COUNT(*) AS `post_count` FROM `posts` GROUP BY `OwnerUserId` HAVING `post_count` > 10 ) AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId`
moderate
604
Calculate the ratio of votes in 2010 and 2011.
codebase_community
DIVIDE(COUNT(Id where YEAR(CreationDate) = 2010), COUNT(Id where YEAR(CreationDate) = 2011)) FROM votes;
SELECT CAST(SUM( CASE WHEN DATE_FORMAT(CAST(`CreationDate` AS DATETIME), '%Y') = '2010' THEN 1 ELSE 0 END ) AS DOUBLE) / SUM( CASE WHEN DATE_FORMAT(CAST(`CreationDate` AS DATETIME), '%Y') = '2011' THEN 1 ELSE 0 END ) FROM `votes`
simple
629
Which post by slashnick has the most answers count? State the post ID.
codebase_community
most answers count refers to MAX(AnswerCount); post by slashnick refers to DisplayName = 'slashnick';
SELECT `T2`.`PostId` FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `posts` AS `T3` ON `T2`.`PostId` = `T3`.`Id` WHERE `T1`.`DisplayName` = 'slashnick' ORDER BY `T3`.`AnswerCount` DESC LIMIT 1
moderate
633
Among posts by Harvey Motulsky and Noah Snyder, which one has higher popularity?
codebase_community
Has higher popularity means the post has higher view count ; calculation = MAX(SUM(ViewCount)) where DisplayName = 'Harvey Motulsky' OR DisplayName = 'Noah Snyder';
SELECT `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `posts` AS `T3` ON `T2`.`PostId` = `T3`.`Id` WHERE `T1`.`DisplayName` = 'Harvey Motulsky' OR `T1`.`DisplayName` = 'Noah Snyder' GROUP BY `T1`.`DisplayName` ORDER BY SUM(`T3`.`ViewCount`) DESC LIMIT 1
challenging
634
State all the tags used by Mark Meckes in his posts that doesn't have comments.
codebase_community
used by Mark Meckes refers to DisplayName = 'Mark Meckes'; Doen't have comments refers to CommentCount = 0;
SELECT `T3`.`Tags` FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `posts` AS `T3` ON `T3`.`Id` = `T2`.`PostId` WHERE `T1`.`DisplayName` = 'Mark Meckes' AND `T3`.`CommentCount` = 0
moderate
637
Based on posts posted by Community, calculate the percentage of posts that use the R language.
codebase_community
DIVIDE(COUNT(PostId WHERE TagName = 'r')), (COUNT(PostId WHERE DisplayName = 'Community')) as percentage; R language refers to tagname = 'r'
SELECT CAST(SUM(CASE WHEN `T3`.`TagName` = 'r' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`Id`) FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `tags` AS `T3` ON `T3`.`ExcerptPostId` = `T2`.`PostId` WHERE `T1`.`DisplayName` = 'Community'
challenging
639
Calculate the difference in view count from post posted by Mornington and view count from posts posted by Amos.
codebase_community
calculation = SUBTRACT(SUM(ViewCount where DisplayName = 'Mornington'), SUM(ViewCount where DisplayName = 'Amos'));
SELECT SUM(CASE WHEN `T1`.`DisplayName` = 'Mornington' THEN `T3`.`ViewCount` ELSE 0 END) - SUM(CASE WHEN `T1`.`DisplayName` = 'Amos' THEN `T3`.`ViewCount` ELSE 0 END) AS `diff` FROM `users` AS `T1` INNER JOIN `postHistory` AS `T2` ON `T1`.`Id` = `T2`.`UserId` INNER JOIN `posts` AS `T3` ON `T3`.`Id` = `T2`.`PostId`
moderate
640
What is the average monthly number of links created in 2010 for posts that have no more than 2 answers?
codebase_community
calculation = DIVIDE(COUNT(Id where YEAR(CreationDate) = 2010 and AnswerCount < = 2), 12)
SELECT CAST(COUNT(`T1`.`Id`) AS DOUBLE) / 12 FROM `postLinks` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`PostId` = `T2`.`Id` WHERE `T2`.`AnswerCount` <= 2 AND DATE_FORMAT(CAST(`T1`.`CreationDate` AS DATETIME), '%Y') = '2010'
moderate
665
When did 'chl' cast its first vote in a post?
codebase_community
DisplayName = 'chl'; cast its first vote refers to MIN(CreationDate);
SELECT `T2`.`CreationDate` FROM `users` AS `T1` INNER JOIN `votes` AS `T2` ON `T1`.`Id` = `T2`.`UserId` WHERE `T1`.`DisplayName` = 'chl' ORDER BY `T2`.`CreationDate` LIMIT 1
simple
669
What is the display name of the user who acquired the first Autobiographer badge?
codebase_community
Autobiographer is the name of the badge; acquired the first refers to MIN(Date);
SELECT `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `badges` AS `T2` ON `T1`.`Id` = `T2`.`UserId` WHERE `T2`.`Name` = 'Autobiographer' ORDER BY `T2`.`Date` LIMIT 1
simple
671
Among the users located in United Kingdom, how many users whose post have a total favorite amount of 4 or more?
codebase_community
favorite amount of 4 or more refers to FavoriteCount > = 4; Location = 'United Kingdom';
SELECT COUNT(`T1`.`Id`) FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` WHERE `T1`.`Location` = 'United Kingdom' AND `T2`.`FavoriteCount` >= 4
moderate
672
Which post by Harvey Motulsky has the most views? Please give the id and title of this post.
codebase_community
DisplayName = 'Harvey Motulsky'; the most views refer to MAX(ViewCount);
SELECT `T2`.`Id`, `T2`.`Title` FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` WHERE `T1`.`DisplayName` = 'Harvey Motulsky' ORDER BY `T2`.`ViewCount` DESC LIMIT 1
simple
678
Which is the most valuable post in 2010? Please give its id and the owner's display name.
codebase_community
the most valuable post in 2010 refers to MAX(FavoriteCount) where year(CreationDate) = 2010;
SELECT `T2`.`OwnerUserId`, `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` WHERE DATE_FORMAT(CAST(`T1`.`CreationDate` AS DATETIME), '%Y') = '2010' ORDER BY `T2`.`FavoriteCount` DESC LIMIT 1
moderate
682
What is the percentage of posts whose owners had a reputation of over 1000 in 2011?
codebase_community
percentage = DIVIDE(COUNT(Id where YEAR(CreationDate) = 2011 and Reputation > 1000), COUNT(Id) ) * 100;
SELECT CAST(SUM( CASE WHEN DATE_FORMAT(CAST(`T2`.`CreaionDate` AS DATETIME), '%Y') = '2011' AND `T1`.`Reputation` > 1000 THEN 1 ELSE 0 END ) AS DOUBLE) * 100 / COUNT(`T1`.`Id`) FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId`
moderate
683
Identify the total views on the post 'Computer Game Datasets'. Name the user who posted it last time.
codebase_community
total views refer to ViewCount; Name the user refers to DisplayName; post 'Computer Game Datasets' refers to Text = 'Computer Game Datasets';
SELECT `T2`.`ViewCount`, `T3`.`DisplayName` FROM `postHistory` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`PostId` = `T2`.`Id` INNER JOIN `users` AS `T3` ON `T2`.`LastEditorUserId` = `T3`.`Id` WHERE `T1`.`Text` = 'Computer Game Datasets'
moderate
685
How many comments were added to the post with the highest score?
codebase_community
the highest score refers to MAX(Score);
SELECT COUNT(`T2`.`Id`) FROM `posts` AS `T1` INNER JOIN `comments` AS `T2` ON `T1`.`Id` = `T2`.`PostId` GROUP BY `T1`.`Id` ORDER BY `T1`.`Score` DESC LIMIT 1
simple
687
Provide the text of the latest 10 comments to the post with the title 'Analysing wind data with R' and the display name of the user who left it.
codebase_community
the latest comment refers to MAX(CreationDate);
SELECT `T3`.`Text`, `T1`.`DisplayName` FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` INNER JOIN `comments` AS `T3` ON `T2`.`Id` = `T3`.`PostId` WHERE `T2`.`Title` = 'Analysing wind data with R' ORDER BY `T1`.`CreationDate` DESC LIMIT 10
moderate
694
Among all the posts posted by the most influential user, identify the percentage with a score above 50.
codebase_community
The higher reputation the user has the more influence; percentage = DIVIDE(COUNT(stats_posts.Id where Score > 50 and MAX(Reputation))), COUNT(stats_posts.Id where MAX(Reputation));
SELECT CAST(SUM(CASE WHEN `T2`.`Score` > 50 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`Id`) FROM `users` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`Id` = `T2`.`OwnerUserId` INNER JOIN ( SELECT MAX(`Reputation`) AS `max_reputation` FROM `users` ) AS `T3` ON `T1`.`Reputation` = `T3`.`max_reputation`
challenging
701
What is the excerpt post ID and wiki post ID of the tag named sample?
codebase_community
tag named sample refers to TagName = 'sample';
SELECT `ExcerptPostId`, `WikiPostId` FROM `tags` WHERE `TagName` = 'sample'
simple
704
Give the user's reputation and up vote number of the user that commented "fine, you win :)".
codebase_community
Text = 'fine, you win :)';
SELECT `T2`.`Reputation`, `T2`.`UpVotes` FROM `comments` AS `T1` INNER JOIN `users` AS `T2` ON `T1`.`UserId` = `T2`.`Id` WHERE `T1`.`Text` = 'fine, you win :)'
simple
705
Among the posts with views ranging from 100 to 150, what is the comment with the highest score?
codebase_community
views ranging from 100 to 150 refers to ViewCount BETWEEN 100 and 150; comment with the highest score refers to Text where MAX(Score);
SELECT `Text` FROM `comments` WHERE `PostId` IN ( SELECT `Id` FROM `posts` WHERE `ViewCount` BETWEEN 100 AND 150 ) ORDER BY `Score` DESC LIMIT 1
moderate
707
In posts with 1 comment, how many of the comments have 0 score?
codebase_community
in posts with 1 comment refers to CommentCount = 1;
SELECT COUNT(`T1`.`id`) FROM `comments` AS `T1` INNER JOIN `posts` AS `T2` ON `T1`.`PostId` = `T2`.`Id` WHERE `T2`.`CommentCount` = 1 AND `T2`.`Score` = 0
simple
710
Among the comments with scores between 5 to 10, what is the percentage of the users with 0 up votes?
codebase_community
percentage = DIVIDE(COUNT(UserId where UpVotes = 0 and Score BETWEEN 5 and 10))*100, (COUNT(UserId where Score BETWEEN 5 and 10));
SELECT CAST(SUM(CASE WHEN `T1`.`UpVotes` = 0 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`Id`) AS `per` FROM `users` AS `T1` INNER JOIN `comments` AS `T2` ON `T1`.`Id` = `T2`.`UserId` WHERE `T2`.`Score` BETWEEN 5 AND 10
moderate
716
Which are the cards that have incredibly powerful foils.
card_games
incredibly poweful foils refers to cardKingdomFoilId is not null AND cardKingdomId is not null
SELECT `id` FROM `cards` WHERE NOT `cardKingdomFoilId` IS NULL AND NOT `cardKingdomId` IS NULL
simple
340
What are the borderless cards available without powerful foils?
card_games
borderless' refers to borderColor; poweful foils refers to cardKingdomFoilId paired with cardKingdomId AND cardKingdomId is not null
SELECT `id` FROM `cards` WHERE `borderColor` = 'borderless' AND ( `cardKingdomId` IS NULL OR `cardKingdomId` IS NULL )
simple
341
List all the mythic rarity print cards banned in gladiator format.
card_games
mythic rarity printing refers to rarity = 'mythic'; card banned refers to status = 'Banned'; in gladiator format refers to format = 'gladiator';
SELECT DISTINCT `T1`.`id` FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T2`.`format` = 'gladiator' AND `T2`.`status` = 'Banned' AND `T1`.`rarity` = 'mythic'
moderate
344
For artifact type of cards that do not have multiple faces on the same card, state its legalities status for vintage play format.
card_games
Artifact type of cards refers to types = 'Artifact'; card does not have multiple faces on the same card refers to side is NULL'; vintage play format refers to format = 'vintage';
SELECT DISTINCT `T2`.`status` FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`type` = 'Artifact' AND `T2`.`format` = 'vintage' AND `T1`.`side` IS NULL
moderate
345
List all the card id and artist with unknown power which are legal for commander play format.
card_games
unknown power refers to power = '*' or POWER IS NULL; commander play format refers to format = 'commander'; legal for commander play format refers to format = 'commander' where status = 'Legal'
SELECT `T1`.`id`, `T1`.`artist` FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T2`.`status` = 'Legal' AND `T2`.`format` = 'commander' AND ( `T1`.`power` IS NULL OR `T1`.`power` = '*' )
moderate
346
Find all cards illustrated by Stephen Daniel and describe the text of the ruling of these cards. State if these cards have missing or degraded properties and values.
card_games
cards have missing or degraded properties and value refers to hasContentWarning = 1; 'Stephen Daniele' is artist; Find all cards refers to return card id
SELECT `T1`.`id`, `T2`.`text`, `T1`.`hasContentWarning` FROM `cards` AS `T1` INNER JOIN `rulings` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`artist` = 'Stephen Daniele'
moderate
347
Name the card and artist with the most ruling information. Also state if the card is a promotional printing.
card_games
with the most ruling information refers to Max(count(rulings.uuid)); the card is the promotional printing refers to isPromo = 1;
SELECT `T1`.`name`, `T1`.`artist`, `T1`.`isPromo` FROM `cards` AS `T1` INNER JOIN `rulings` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`isPromo` = 1 AND `T1`.`artist` = ( SELECT `artist` FROM `cards` WHERE `isPromo` = 1 GROUP BY `artist` HAVING COUNT(DISTINCT `uuid`) = (SELECT MAX(card_counts.max_count) FROM (SELECT COUNT(DISTINCT `uuid`) AS max_count FROM `cards` WHERE `isPromo` = 1 GROUP BY `artist`) AS card_counts))LIMIT 1
moderate
349
Calculate the percentage of the cards availabe in Chinese Simplified.
card_games
Chinese Simplified' is the language; percentage = Divide(Sum(id where language = 'Chinese Simplified'), Count(id)) *100
SELECT CAST(SUM(CASE WHEN `T2`.`language` = 'Chinese Simplified' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T1`.`uuid` = `T2`.`uuid`
moderate
352
How many cards have infinite power?
card_games
infinite power refers to power = '*';
SELECT COUNT(*) FROM `cards` WHERE `power` = '*'
simple
356
What is the border color of card "Ancestor's Chosen"?
card_games
name of card = 'Ancestor''s Chosen' ;
SELECT DISTINCT `borderColor` FROM `cards` WHERE `name` = 'Ancestor''s Chosen'
simple
358
What is the rule of playing card "Benalish Knight"?
card_games
Benalish Knight' is the name of card; rule of playing card refers to format;
SELECT `T2`.`format` FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`name` = 'Benalish Knight'
simple
366
What is the percentage of borderless cards?
card_games
borderless card refers to borderColor = 'borderless'; percentage = Divide(Count (id) where borderColor = 'borderless', Count(id)) *100
SELECT CAST(SUM(CASE WHEN `borderColor` = 'borderless' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`id`) FROM `cards`
simple
368
What is the percentage of cards whose language is French among the Story Spotlight cards?
card_games
Story Spotlight card refers to isStorySpotlight = 1; French is the language; Percentage = Divide(Count(id) where language = 'French' and isStorySpotlight = 1, Count(id) where isStorySpotlight = 1)*100
SELECT CAST(SUM(CASE WHEN `T2`.`language` = 'French' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`isStorySpotlight` = 1
challenging
371
How many cards with original type of "Summon - Angel" have subtype other than "Angel"?
card_games
subtype other than Angel refers to subtypes is not 'Angel';
SELECT COUNT(`id`) FROM `cards` WHERE `originalType` = 'Summon - Angel' AND `subtypes` <> 'Angel'
simple
377
What are the cards belong to duel deck a? List the ID.
card_games
duel deck a refers to duelDeck = a;
SELECT `id` FROM `cards` WHERE `duelDeck` = 'a'
simple
379
How many of the banned cards are white border?
card_games
banned card refers to status = 'Banned'; white border refers to borderColor = 'white';
SELECT COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T2`.`status` = 'Banned' AND `T1`.`borderColor` = 'white'
simple
383
Among the Artifact cards, which are black color and comes with foreign languague translation?
card_games
Artifact card refers to originalType = 'Artifact'; black color refers to colors = 'B'; foreign language refers to language in foreign_data
SELECT DISTINCT `T1`.`name` FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`originalType` = 'Artifact' AND `T1`.`colors` = 'B'
moderate
391
What is the mana cost of cards with a normal layout, a 2003 frame version, with a black border color, and available in paper and mtgo?
card_games
available in paper and mtgo refers to availability = 'mtgo,paper'; frameVersion = 2003;borderColor = 'black'
SELECT `manaCost` FROM `cards` WHERE `availability` = 'mtgo,paper' AND `borderColor` = 'black' AND `frameVersion` = 2003 AND `layout` = 'normal'
moderate
397
What is the percentage of Story Spotlight cards that do not have a text box? List them by their ID.
card_games
Story Spotlight cards that do not have a text box refers to isStorySpotlight = 1 and isTextless = 0; Percentage = DIVIDE(SUM(count(id) where isStorylight = 1 AND isTextless = 0 ), SUM(count(id))) * 100
SELECT CAST(SUM(CASE WHEN `isTextless` = 0 AND `isStorySpotlight` = 1 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`id`) FROM `cards`
moderate
402
How many Brazilian Portuguese translated sets are inside the Commander block?
card_games
Commander block refer to block = 'Commander'; sets refer to code = setCode; Portuguese refer to language = 'Portuguese (Brasil)'
SELECT COUNT(`T1`.`id`) FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T1`.`code` = `T2`.`setCode` WHERE `T2`.`language` = 'Portuguese (Brazil)' AND `T1`.`block` = 'Commander'
moderate
405
Lists all types of cards in German.
card_games
German refer to language; all types refer to the subtypes, supertypes; subtypes is not null AND supertypes is not null
SELECT `T1`.`subtypes`, `T1`.`supertypes` FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T2`.`language` = 'German' AND NOT `T1`.`subtypes` IS NULL AND NOT `T1`.`supertypes` IS NULL
moderate
407
How many unknown power cards contain info about the triggered ability
card_games
unknown power cards refers to power is null or power = '*';contain info about the triggered ability refers to text contains 'triggered ability'
SELECT Count(DISTINCT `T1`.`id`) FROM `cards` AS `T1` INNER JOIN `rulings` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE ( `T1`.`power` IS NULL OR `T1`.`power` = '*' ) AND `T2`.`text` LIKE '%triggered ability%'
moderate
408
Indicates the number of cards with pre-modern format, ruling text "This is a triggered mana ability." that do not have multiple faces.
card_games
pre-modern format refers to format = 'premodern' ;do not have multiple faces refers to side IS NULL
SELECT COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` INNER JOIN `rulings` AS `T3` ON `T1`.`uuid` = `T3`.`uuid` WHERE `T2`.`format` = 'premodern' AND `T3`.`text` = 'This is a triggered mana ability.' AND `T1`.`Side` IS NULL
moderate
409
What is the foreign name of the card in French of type Creature, normal layout and black border color, by artist Matthew D. Wilson?
card_games
in French refers to language = 'French'; black border color refers to borderColor = 'black'
SELECT `name` FROM `foreign_data` WHERE `uuid` IN ( SELECT `uuid` FROM `cards` WHERE `types` = 'Creature' AND `layout` = 'normal' AND `borderColor` = 'black' AND `artist` = 'Matthew D. Wilson' ) AND `language` = 'French'
moderate
412
What language is the set of 180 cards that belongs to the Ravnica block translated into?
card_games
set of 180 cards refers to baseSetSize = 180
SELECT `T2`.`language` FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T1`.`code` = `T2`.`setCode` WHERE `T1`.`block` = 'Ravnica' AND `T1`.`baseSetSize` = 180
simple
414
What percentage of cards with format commander and legal status do not have a content warning?
card_games
do not have a content warning refers to hasContentWarning = 0; percentage refers to DIVIDE(COUNT(hasContentWarning = 0),COUNT(ID))*100 where format = 'commander' AND Status = 'legal';
SELECT CAST(SUM(CASE WHEN `T1`.`hasContentWarning` = 0 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T2`.`format` = 'commander' AND `T2`.`status` = 'Legal'
challenging
415
What percentage of cards without power are in French?
card_games
in French refers to language = 'French'; cards without power refers to power IS NULL OR power = '*'; percentage = DIVIDE(COUNT(language = 'French' and power is NULL or power = '*'), COUNT( power is NULL or power = '*'))*100
SELECT CAST(SUM(CASE WHEN `T2`.`language` = 'French' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`power` IS NULL OR `T1`.`power` = '*'
challenging
416
What is the language of the card with the multiverse number 149934?
card_games
multiverse number 149934 refers to multiverseid = 149934;
SELECT `language` FROM `foreign_data` WHERE `multiverseid` = 149934
simple
422
What proportion of cards do not have a text box with a normal layout?
card_games
do not have a text box refers to isTextless = 1; proportion refers to DIVIDE(COUNT(Textless = 1 and layout = 'normal'),COUNT(Textless))*100
SELECT CAST(SUM(CASE WHEN `isTextless` = 1 AND `layout` = 'normal' THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(*) FROM `cards`
simple
424
What languages are available in the set known as Archenemy on the magic card market and having the code ARC?
card_games
known as Archenemy refers to mcmName = 'Archenemy'; having the code ARC refers to setCode = 'ARC'
SELECT `T2`.`language` FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T1`.`code` = `T2`.`setCode` WHERE `T1`.`mcmName` = 'Archenemy' AND `T2`.`setCode` = 'ARC'
moderate
427
Which foreign language used by "A Pedra Fellwar"?
card_games
"A Pedra Fellwar" refers to name = 'A Pedra Fellwar'
SELECT DISTINCT `language` FROM `foreign_data` WHERE `name` = 'A Pedra Fellwar'
simple
440
Which card costs more converted mana, "Serra Angel" or "Shrine Keeper"?
card_games
"Serra Angel" refers to name = 'Serra Angel'; "Shrine Keeper" refers to name = 'Shrine Keeper'; card costs more converted mana when the value of convertedManaCost is greater
SELECT `name` FROM `cards` WHERE `name` IN ('Serra Angel', 'Shrine Keeper') ORDER BY `convertedManaCost` DESC LIMIT 1
moderate
459
What's the Italian name of the set of cards with "Ancestor's Chosen" is in?
card_games
Italian is a language which refers to language = 'Italian'; with "Ancestor's Chosen" in the card set refers to name = 'Ancestor''s Chosen'
SELECT `translation` FROM `set_translations` WHERE `setCode` IN ( SELECT `setCode` FROM `cards` WHERE `name` = 'Ancestor''s Chosen' ) AND `language` = 'Italian'
moderate
462
For the set of cards with "Ancestor's Chosen" in it, is there a Korean version of it?
card_games
set of cards with "Ancestor''s Chosen" in it refers to name = 'Ancestor''s Chosen'; Korean version refers to language = 'Korean'
SELECT CASE WHEN SUM( CASE WHEN `T2`.`language` = 'Korean' AND NOT `T2`.`translation` IS NULL THEN 1 ELSE 0 END ) > 0 THEN 'YES' ELSE 'NO' END FROM `cards` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T2`.`setCode` = `T1`.`setCode` WHERE `T1`.`name` = 'Ancestor''s Chosen'
moderate
465
Among the cards in the set "Hauptset Zehnte Edition", how many of them are designed by Adam Rex?
card_games
card set "Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'; designed by Adam refers to artist = 'Adam Rex'
SELECT COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T2`.`setCode` = `T1`.`setCode` WHERE `T2`.`translation` = 'Hauptset Zehnte Edition' AND `T1`.`artist` = 'Adam Rex'
moderate
466
What is the Simplified Chinese translation of the name of the set "Eighth Edition"?
card_games
Eighth Edition is the name of card set which refers to name = 'Eighth Edition'; Simplified Chinese refers to language = 'Chinese Simplified'; translation of the name refers to translation
SELECT `T2`.`translation` FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T2`.`setCode` = `T1`.`code` WHERE `T1`.`name` = 'Eighth Edition' AND `T2`.`language` = 'Chinese Simplified'
moderate
468
Did the set of cards with "Angel of Mercy" appear on Magic: The Gathering Online?
card_games
card set "Angel of Mercy" refers to name = 'Angel of Mercy'; appear on Magic: The Gathering Online refers to mtgoCode is NOT NULL and vice versa
SELECT CASE WHEN NOT `T2`.`mtgoCode` IS NULL THEN 'YES' ELSE 'NO' END FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE `T1`.`name` = 'Angel of Mercy'
moderate
469
Among the sets in the block "Ice Age", how many of them have an Italian translation?
card_games
sets in the block "Ice Age" refers to block = 'Ice Age'; Italian translation refers to language = 'Italian' and translation is not null
SELECT COUNT(DISTINCT `T1`.`id`) FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T2`.`setCode` = `T1`.`code` WHERE `T1`.`block` = 'Ice Age' AND `T2`.`language` = 'Italian' AND NOT `T2`.`translation` IS NULL
moderate
472
Is the set of cards with Adarkar Valkyrie only available outside the United States?
card_games
card set Adarkar Valkyrie refers to name = 'Adarkar Valkyrie'; isForeignOnly = 1 means only available outside the United States;
SELECT CASE WHEN `isForeignOnly` = 1 THEN 'YES' ELSE 'NO' END FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE `T1`.`name` = 'Adarkar Valkyrie'
moderate
473
Among the sets of cards that have an Italian translation, how many of them have a base set number of under 100?
card_games
Italian translation refers to language = 'Italian'; have a translation means translation is not null; base set number of under 100 refers to baseSetSize < 10
SELECT COUNT(`T1`.`id`) FROM `sets` AS `T1` INNER JOIN `set_translations` AS `T2` ON `T2`.`setCode` = `T1`.`code` WHERE NOT `T2`.`translation` IS NULL AND `T1`.`baseSetSize` < 100 AND `T2`.`language` = 'Italian'
moderate
474
Which of these artists have designed a card in the set Coldsnap, Jeremy Jarvis, Aaron Miller or Chippy?
card_games
card set Coldsnap refers to name = 'Coldsnap'; Jeremy Jarvis, Aaron Miller or Chippy are the name of artists which refers to artist IN ('Jeremy Jarvis', 'Aaron Miller','Chippy');
SELECT `T1`.`artist` FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE ( `T2`.`name` = 'Coldsnap' AND `T1`.`artist` = 'Chippy' ) OR ( `T2`.`name` = 'Coldsnap' AND `T1`.`artist` = 'Aaron Miller' ) OR ( `T2`.`name` = 'Coldsnap' AND `T1`.`artist` = 'Jeremy Jarvis' ) GROUP BY `T1`.`artist`
challenging
477
Among the cards with converted mana cost higher than 5 in the set Coldsnap, how many of them have unknown power?
card_games
card set Coldsnap refers to name = 'Coldsnap'; converted mana cost higher than 5 refers to convertedManaCost > 5; unknown power refers to power = '*' or T1.power is null
SELECT SUM(CASE WHEN `T1`.`power` = '*' OR `T1`.`power` IS NULL THEN 1 ELSE 0 END) FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE `T2`.`name` = 'Coldsnap' AND `T1`.`convertedManaCost` > 5
moderate
479
What is the Italian flavor text of the card "Ancestor's Chosen"?
card_games
Italian refers to language = 'Italian'; flavor text refers to flavorText; "Ancestor''s Chosen" refers to name = 'Ancestor''s Chosen'
SELECT `T2`.`flavorText` FROM `cards` AS `T1` INNER JOIN `foreign_data` AS `T2` ON `T2`.`uuid` = `T1`.`uuid` WHERE `T1`.`name` = 'Ancestor''s Chosen' AND `T2`.`language` = 'Italian'
moderate
480
Please list the Italian text ruling of all the cards in the set Coldsnap.
card_games
card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'
SELECT DISTINCT `T1`.`text` FROM `foreign_data` AS `T1` INNER JOIN `cards` AS `T2` ON `T2`.`uuid` = `T1`.`uuid` INNER JOIN `sets` AS `T3` ON `T3`.`code` = `T2`.`setCode` WHERE `T3`.`name` = 'Coldsnap' AND `T1`.`language` = 'Italian'
moderate
483
Please list the Italian names of the cards in the set Coldsnap with the highest converted mana cost.
card_games
card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'; highest converted mana cost refers to MAX(convertedManaCost)
SELECT `T2`.`name` FROM `foreign_data` AS `T1` INNER JOIN `cards` AS `T2` ON `T2`.`uuid` = `T1`.`uuid` INNER JOIN `sets` AS `T3` ON `T3`.`code` = `T2`.`setCode` WHERE `T3`.`name` = 'Coldsnap' AND `T1`.`language` = 'Italian' ORDER BY `T2`.`convertedManaCost` DESC
moderate
484
What is the percentage of the cards with a converted mana cost of 7 in the set Coldsnap?
card_games
converted mana cost of 7 refers to convertedManaCost = 7; card set Coldsnap refers to name = 'Coldsnap'; percentage = DIVIDE(SUM(convertedManaCost = 7), SUM(convertedManaCost))*100
SELECT CAST(SUM(CASE WHEN `T1`.`convertedManaCost` = 7 THEN 1 ELSE 0 END) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE `T2`.`name` = 'Coldsnap'
moderate
486
What is the percentage of incredibly powerful cards in the set Coldsnap?
card_games
card set Coldsnap refers to name = 'Coldsnap'; foil is incredibly powerful refers to cardKingdomFoilId is not null AND cardKingdomId is not null; the percentage of incredibly powerful cards in the set refers to DIVIDE(SUM(incredibly powerful), SUM(name = 'Coldsnap'))*100
SELECT CAST(SUM( CASE WHEN NOT `T1`.`cardKingdomFoilId` IS NULL AND NOT `T1`.`cardKingdomId` IS NULL THEN 1 ELSE 0 END ) AS DOUBLE) * 100 / COUNT(`T1`.`id`) FROM `cards` AS `T1` INNER JOIN `sets` AS `T2` ON `T2`.`code` = `T1`.`setCode` WHERE `T2`.`name` = 'Coldsnap'
challenging
487
Which of the play format has the highest number of banned status? Indicate the play format and the names of all the card meet the condition.
card_games
play format refers to format; banned status refers to status = 'Banned'; the highest number of banned status refers to MAX(COUNT(status = 'Banned'))
SELECT T2.format, T1.name FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid INNER JOIN ( SELECT format FROM legalities WHERE status = 'Banned' GROUP BY format ORDER BY COUNT(*) DESC LIMIT 1 ) AS MaxBanned ON MaxBanned.format = T2.format WHERE T2.status = 'Banned'
moderate
518
Which cards are ranked 1st on EDHRec? List all of the cards name and its banned play format.
card_games
ranked 1st on EDHRec refers to edhrecRank = 1; banned refers to status = 'Banned'; play format refers to format; cards name refers to name
SELECT `T1`.`name`, `T2`.`format` FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T2`.`uuid` = `T1`.`uuid` WHERE `T1`.`edhrecRank` = 1 AND `T2`.`status` = 'Banned' GROUP BY `T1`.`name`, `T2`.`format`
moderate
522
List the names of all the cards in the set Hour of Devastation and find the formats in which these cards are legal.
card_games
the set Hour of Devastation refers to set.name = 'Hour of Devastation'; names of all the cards in the set refers to cards.name; legal cards refers to status = 'Legal'; the formats refers to format
SELECT DISTINCT `T2`.`name`, CASE WHEN `T1`.`status` = 'Legal' THEN `T1`.`format` ELSE NULL END FROM `legalities` AS `T1` INNER JOIN `cards` AS `T2` ON `T2`.`uuid` = `T1`.`uuid` WHERE `T2`.`setCode` IN ( SELECT `code` FROM `sets` WHERE `name` = 'Hour of Devastation' )
challenging
528
Find and list the names of sets which doesn't have Japanese translation but have Korean translation.
card_games
names of sets refers to name; doesn't have Japanese translation refers to language not like '%Japanese%'; have Korean translation refers to language = 'Korean'
SELECT `name` FROM `sets` WHERE `code` IN ( SELECT `setCode` FROM `set_translations` WHERE `language` = 'Korean' AND NOT `language` LIKE '%Japanese%' )
moderate
529
List all the frame styles and cards Allen Williams worked on and find any banned cards if there are any.
card_games
frame styles refers to frameVersion; cards Allen Williams worked on refers to artist = 'Allen Williams'; banned cards refers to status = 'Banned'
SELECT DISTINCT `T1`.`frameVersion`, `T1`.`name`, CASE WHEN `T2`.`status` = 'Banned' THEN `T1`.`name` ELSE 'NO' END FROM `cards` AS `T1` INNER JOIN `legalities` AS `T2` ON `T1`.`uuid` = `T2`.`uuid` WHERE `T1`.`artist` = 'Allen Williams'
moderate
530
What is the most common bond type?
toxicology
most common bond type refers MAX(COUNT(bond_type))
SELECT `T`.`bond_type` FROM ( SELECT `bond_type`, COUNT(`bond_id`) FROM `bond` GROUP BY `bond_type` ORDER BY COUNT(`bond_id`) DESC LIMIT 1 ) AS `T`
simple
195
Calculate the average number of oxygen atoms in single-bonded molecules.
toxicology
single-bonded molecules refers to bond_type = '-' ; average number of oxygen atom = AVG(element = 'o')
SELECT AVG(`oxygen_count`) FROM ( SELECT `T1`.`molecule_id`, COUNT(`T1`.`element`) AS `oxygen_count` FROM `atom` AS `T1` INNER JOIN `bond` AS `T2` ON `T1`.`molecule_id` = `T2`.`molecule_id` WHERE `T2`.`bond_type` = '-' AND `T1`.`element` = 'o' GROUP BY `T1`.`molecule_id` ) AS `oxygen_counts`
moderate
197