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