1sf/bird-sql-dev-xresults huggingface dataset:
Database: codebase_community
Question: What is the average number of posts voted by the oldest users?
Evidence: average number of posts voted refers to AVG(PostId) FROM votes; the oldest users refer to MAX(Age);
SQL: SELECT AVG(PostId) FROM votes WHERE UserId IN ( SELECT Id FROM users WHERE Age = ( SELECT MAX(Age) FROM users ) )
Database: codebase_community
Question: Who has the highest reputation? Please give the display name.
Evidence: the highest reputation refers to MAX(Reputation);
SQL: SELECT DisplayName FROM users WHERE Reputation = ( SELECT MAX(Reputation) FROM users )
Database: codebase_community
Question: How many users whose reputations are higher than 2000 and the number of views is higher than 1000?
Evidence: reputations are higher than 2000 refer to Reputation > 2000; number of views is higher than 1000 refers to Views > 1000;
SQL: SELECT COUNT(id) FROM users WHERE Reputation > 2000 AND Views > 1000
Database: codebase_community
Question: Please list all display names of users who are adults.
Evidence: adults refer to users where Age BETWEEN 19 and 65;
SQL: SELECT DisplayName FROM users WHERE Age BETWEEN 19 AND 65
Database: codebase_community
Question: How many posts did Jay Stevens have in 2010?
Evidence: DisplayName = 'Jay Stevens'; in 2010 refers to YEAR(CreationDate) = 2010;
SQL: SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T2.CreaionDate) = '2010' AND T1.DisplayName = 'Jay Stevens'
Database: codebase_community
Question: Which post by Harvey Motulsky has the most views? Please give the id and title of this post.
Evidence: DisplayName = 'Harvey Motulsky'; the most views refer to MAX(ViewCount);
SQL: 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
Database: codebase_community
Question: Which post has the highest score? Please give its id and title's name.
Evidence: the highest score refers to MAX(Score); owner's name refers to DisplayName;
SQL: SELECT T1.Id, T2.Title FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId ORDER BY T2.Score DESC LIMIT 1
Database: codebase_community
Question: What is the average score of Stephen Turner's posts?
Evidence: DisplayName = 'Stephen Turner'; average score refers to AVG(Score);
SQL: SELECT AVG(T2.Score) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Stephen Turner'
Database: codebase_community
Question: Please list the users' display names whose posts had over 20000 views in 2011.
Evidence: had over 20000 views in 2011 refers to ViewCount > 20000 where YEAR(CreationDate) = 2011;
SQL: SELECT T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE STRFTIME('%Y', T2.CreaionDate) = '2011' AND T2.ViewCount > 20000
Database: codebase_community
Question: Which is the most valuable post in 2010? Please give its id and the owner's display name.
Evidence: the most valuable post in 2015 refers to MAX(FavoriteCount) where year(CreationDate) = 2010;
SQL: 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
Database: codebase_community
Question: What is the percentage of posts whose owners had a reputation of over 1000 in 2011?
Evidence: percentage = DIVIDE(COUNT(Id where YEAR(CreationDate) = 2011 and Reputation > 1000), COUNT(Id) ) * 100;
SQL: 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
Database: codebase_community
Question: Identify the percentage of teenage users.
Evidence: DIVIDE(COUNT(Id where Age BETWEEN 13 and 18), COUNT(Id)) as percentage;
SQL: SELECT CAST(SUM(IIF(Age BETWEEN 13 AND 18, 1, 0)) AS REAL) * 100 / COUNT(Id) FROM users
Database: codebase_community
Question: Identify the total views on the post 'Computer Game Datasets'. Name the user who posted it last time.
Evidence: total views refer to ViewCount; Name the user refers to DisplayName; post 'Computer Game Datasets' refers to Text = 'Computer Game Datasets';
SQL: 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'
Database: codebase_community
Question: Identify the total number of posts with views above average.
Evidence: views above average refer to ViewCount > AVG(ViewCount);
SQL: SELECT Id FROM posts WHERE ViewCount > ( SELECT AVG(ViewCount) FROM posts )
Database: codebase_community
Question: How many comments were added to the post with the highest score?
Evidence: the highest score refers to MAX(Score);
SQL: SELECT COUNT(T2.Id) FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId GROUP BY T1.Id ORDER BY SUM(T1.Score) DESC LIMIT 1
Database: codebase_community
Question: Identify the number of posts that have been viewed over 35000 times but have received no comments from other users.
Evidence: have been viewed over 35000 times refers to ViewCount > 35000; received no comments refers to CommentCount = 0;
SQL: SELECT COUNT(Id) FROM posts WHERE ViewCount > 35000 AND CommentCount = 0
Database: codebase_community
Question: Identify the display name and location of the user, who was the last to edit the post with ID 183.
Evidence: last to edit refers to MAX(LastEditDate);
SQL: SELECT T2.DisplayName, T2.Location FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Id = 183 ORDER BY T1.LastEditDate DESC LIMIT 1
Database: codebase_community
Question: Identify the latest badge awarded to the user with the display name Emmett.
Evidence: the latest badge refers to Name FROM badges where MAX(Date);
SQL: SELECT T1.Name FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'Emmett' ORDER BY T1.Date DESC LIMIT 1
Database: codebase_community
Question: Identify the number of adult users who have cast over 5000 upvotes.
Evidence: adult users refer to Age BETWEEN 19 and 65; over 5000 upvotes refer to UpVotes > 5000;
SQL: SELECT COUNT(Id) FROM users WHERE Age BETWEEN 19 AND 65 AND UpVotes > 5000
Database: codebase_community
Question: How long did it take the user, known by his or her display name 'Zolomon' to get the badge? Count from the date the user's account was created.
Evidence: SUBTRACT(Date from stats_badges, CreationDate) where DisplayName = 'Zolomon';
SQL: SELECT T1.Date - T2.CreationDate FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'Zolomon'
Database: codebase_community
Question: Identify the number of posts and comments left by the user, who has the latest created user account.
Evidence: the latest created user account refers to MAX(CreationDate);
SQL: SELECT COUNT(T2.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T3.PostId = T2.Id ORDER BY T1.CreationDate DESC LIMIT 1
Database: codebase_community
Question: 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.
Evidence: the latest comment refers to MAX(CreationDate);
SQL: 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
Database: codebase_community
Question: How many users were awarded with 'Citizen Patrol' badge?
Evidence: Citizen Patrol' is the name of the badge;
SQL: SELECT COUNT(id) FROM badges WHERE `Name` = 'Citizen Patrol'
Database: codebase_community
Question: Count the number of posts with a tag specified as 'careers'.
Evidence: tag specified as 'careers' refers to TagName = 'careers';
SQL: SELECT COUNT(Id) FROM tags WHERE TagName = 'careers'
Database: codebase_community
Question: When did the user known as 'IrishStat' create his or her account?
Evidence: DisplayName = 'IrishStat'; when create his or her account refers to CreationDate;
SQL: SELECT CreationDate FROM users WHERE DisplayName = 'IrishStat'
Database: card_games
Question: State the alternative languages available for card named Annul numbered 29.
Evidence: annul refers to name = 'annul'; numbered 29 refers to number = '29';
SQL: SELECT T2.language FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Annul' AND T1.number = 29
Database: card_games
Question: Name all the cards which have alternative language in Japanese.
Evidence: Japanese' is the language;
SQL: SELECT T1.name FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Japanese'
Database: card_games
Question: Calculate the percentage of the cards availabe in Chinese Simplified.
Evidence: Chinese Simplified' is the language; percentage = Divide(Sum(id where language = 'Chinese Simplified'), Count(id)) *100
SQL: 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
Database: card_games
Question: List all the sets available in Italian translation. State the total number of cards per set.
Evidence: Italian translation refers to language = 'Italian'; total number of card per set refers to totalSetSize;
SQL: SELECT T1.name, T1.totalSetSize FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Italian'
Database: card_games
Question: How many types of cards does the artist Aaron Boyd illustrated about card art?
Evidence: Aaron Boyd' is artist;
SQL: SELECT COUNT(type) FROM cards WHERE artist = 'Aaron Boyd'
Database: card_games
Question: What is the keyword found on card 'Angel of Mercy'?
Evidence: Angel of Mercy' is the name of card;
SQL: SELECT DISTINCT keywords FROM cards WHERE name = 'Angel of Mercy'
Database: card_games
Question: How many cards have infinite power?
Evidence: infinite power refers to power = '*';
SQL: SELECT COUNT(*) FROM cards WHERE power = '*'
Database: card_games
Question: What type of promotion is of card 'Duress'?
Evidence: card Duress refers to name = 'Duress'; type of promotion refers to promoTypes;
SQL: SELECT promoTypes FROM cards WHERE name = 'Duress' AND promoTypes IS NOT NULL
Database: card_games
Question: What is the border color of card "Ancestor's Chosen"?
Evidence: name of card  = 'Ancestor''s Chosen' ;
SQL: SELECT DISTINCT borderColor FROM cards WHERE name = 'Ancestor''s Chosen'
Database: card_games
Question: What is the type of the card "Ancestor's Chosen" as originally printed?
Evidence: Ancestor's Chosen' is the name of card; type of the card as originally printed refers to originaltype;
SQL: SELECT originalType FROM cards WHERE name = 'Ancestor''s Chosen' AND originalType IS NOT NULL
Database: card_games
Question: cards are not directly linked to language but through table 'set'. you need to add set in covered table & rephrase your question
What are the languages available for the set that card 'Angel of Mercy' is in?
Evidence: Angel of Mercy' is the name of card;
SQL: SELECT language FROM set_translations WHERE id IN ( SELECT id FROM cards WHERE name = 'Angel of Mercy' )
Database: card_games
Question: How many cards of legalities whose status is restricted have text boxes?
Evidence: restricted refers to status = 'restricted'; have text boxes refers to is Textless = 0;
SQL: SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.status = 'Restricted' AND T1.isTextless = 0
Database: card_games
Question: What is the description about the ruling of card "Condemn"?
Evidence: Ancestor's Chosen' is the name of card; description about the ruling refers to text;
SQL: SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Condemn'
Database: card_games
Question: How many cards of legalities whose status is restricted are found in a starter deck?
Evidence: restricted refers to status = 'restricted'; found in the starter deck refers to isStarter = 1;
SQL: SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.status = 'Restricted' AND T1.isStarter = 1
Database: card_games
Question: What is the status of card "Cloudchaser Eagle"?
Evidence: Cloudchaser Eagle is the name of card;
SQL: SELECT DISTINCT T2.status FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Cloudchaser Eagle'
Database: card_games
Question: What is the type of card "Benalish Knight"?
Evidence: Benalish Knight' is the name of card;
SQL: SELECT DISTINCT T1.type FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Benalish Knight'
Database: card_games
Question: What is the rule of playing card "Benalish Knight"?
Evidence: Benalish Knight' is the name of card; rule of playing card refers to format;
SQL: SELECT T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Benalish Knight'
Database: card_games
Question: Please provide the names of the artists who illustrated the card art in Phyrexian.
Evidence: Phyrexian' is the language; name of artists refers to artist;
SQL: SELECT T1.artist FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Phyrexian'
Database: card_games
Question: What is the percentage of borderless cards?
Evidence: borderless card refers to borderColor = 'borderless'; percentage = Divide(Count (id) where borderColor = 'borderless', Count(id)) *100
SQL: SELECT CAST(SUM(CASE WHEN borderColor = 'borderless' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(id) FROM cards
Database: card_games
Question: How many cards that illusrtated in German have been reprinted?
Evidence: German' is the language; reprinted refers to isReprint = 1;
SQL: SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'German' AND T1.isReprint = 1
Database: card_games
Question: How many borderless cards are illustrated in Russian?
Evidence: borderless card refers to borderColor = 'borderless'; 'Russian' is the language;
SQL: SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.borderColor = 'borderless' AND T2.language = 'Russian'
Database: card_games
Question: What is the percentage of cards whose language is French among the Story Spotlight cards?
Evidence: 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
SQL: 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
Database: card_games
Question: How many cards are there with toughness of 99?
SQL: SELECT COUNT(id) FROM cards WHERE toughness = 99
Database: card_games
Question: Name the cards that were illustrated by Aaron Boyd.
Evidence: Aaron Boyd' is artist;
SQL: SELECT DISTINCT name FROM cards WHERE artist = 'Aaron Boyd'
Database: card_games
Question: How many black border cards are only available on mtgo?
Evidence: black border card refers to borderColor = black; available on mtgo refers to availability = mtgo;

add quotes for string = 'black' and = 'mtgo'
SQL: SELECT COUNT(id) FROM cards WHERE availability = 'mtgo' AND borderColor = 'black'
Database: card_games
Question: List down all the card IDs with converted mana cost of 0.
Evidence: converted mana cost of 0 refers to covertedManaCost = 0;
SQL: SELECT id FROM cards WHERE convertedManaCost = 0
Database: card_games
Question: How many cards with original type of "Summon - Angel" have subtype other than "Angel"?
Evidence: subtype other than Angel refers to subtypes is not 'Angel';
SQL: SELECT COUNT(id) FROM cards WHERE originalType = 'Summon - Angel' AND subtypes != 'Angel'
Database: card_games
Question: What are the foiled cards that are incredibly powerful when paired with non foiled cards? List the IDs.
Evidence: Incredibly powerful refers to both cardKingdomFoilId and cardKingdomId IS NOT Null;
SQL: SELECT id FROM cards WHERE cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL
Database: card_games
Question: What are the cards belong to duel deck a? List the ID.
Evidence: duel deck a refers to duelDeck = a;
SQL: SELECT id FROM cards WHERE duelDeck = 'a'
Database: card_games
Question: List the edhrecRank for cards with frame version 2015.
SQL: SELECT edhrecRank FROM cards WHERE frameVersion = 2015
Database: card_games
Question: List down the name of artists for cards in Chinese Simplified.
Evidence: Chinese Simplified' is the language;
SQL: SELECT T1.artist FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Chinese Simplified'
Database: card_games
Question: What are the cards that only available in paper and Japanese language?
Evidence: available in paper refers to availability = 'paper'; 'Japanese is the language;
SQL: SELECT T1.name FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.availability = 'paper' AND T2.language = 'Japanese'
Database: card_games
Question: How many of the banned cards are white border?
Evidence: banned card refers to status = 'Banned'; white border refers to borderColor = 'white';
SQL: 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'
Database: card_games
Question: List down the uuid for legacy cards and the foreign language of these cards.
Evidence: legacy card refers to format = 'legacy'; foreign language refers to language in foreign_data
SQL: SELECT T1.uuid, T3.language FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid INNER JOIN foreign_data AS T3 ON T1.uuid = T3.uuid WHERE T2.format = 'legacy'
Database: card_games
Question: Write down the ruling of Beacon of Immortality.
Evidence: Beacon of Immortality' is the name of card;
SQL: SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Beacon of Immortality'
Database: card_games
Question: How many cards are having future frame version and what are the legality status of these cards?
Evidence: future frame version refers to frameVersion = 'future'; legility status refers to status = 'legal';
SQL: SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.frameVersion = 'future'
Database: card_games
Question: What are the cards for set OGW? State the colour for these cards.
Evidence: set OGW refers to setCode = 'OGW';
SQL: SELECT id, colors FROM cards WHERE id IN ( SELECT id FROM set_translations WHERE setCode = 'OGW' )
Database: card_games
Question: What are the cards in set 10E with converted mana of 5 have translation and what are the languages?
Evidence: set 10E refers to setCode = '10E'; converted mana of 5 refers to convertedManaCost = 5;
SQL: SELECT id, language FROM set_translations WHERE id = ( SELECT id FROM cards WHERE convertedManaCost = 5 ) AND setCode = '10E'
Database: card_games
Question: List down the name of cards with original types of Creature - Elf and the date of rulings for these cards.
Evidence: Creature - Elf is the originalType;
SQL: SELECT T1.id, T2.date FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.originalType = 'Creature - Elf'
Database: card_games
Question: What are the colors of cards from ID 1-20? What are the format of these cards?
Evidence: ID 1-20 refers to id BETWEEN 1 and 20;
SQL: SELECT T1.colors, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.id BETWEEN 1 AND 20
Database: card_games
Question: Among the Artifact cards, which are black color and comes with foreign languague translation?
Evidence: Artifact card refers to originalType = 'Artifact'; black color refers to colors = 'B'; foreign language refers to language in foreign_data
SQL: 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'
Database: card_games
Question: Pick 3 cards with rarity of uncommon, list down name these cards according to ascending order of it's ruling date.
Evidence: uncommon refers to rarity = 'uncommon';
SQL: SELECT DISTINCT T1.name FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'uncommon' ORDER BY T2.date ASC LIMIT 3
Database: card_games
Question: On how many cards designed by John Avon is its foil non-powerful?
Evidence: John Avon refer to artist; foil poweful foils refers to cardKingdomId and cardKingdomFoildId is NOT NULL 

SQL: SELECT COUNT(id) FROM cards WHERE (cardKingdomId IS NULL OR cardKingdomFoilId IS NULL) AND artist = 'John Avon'
Database: card_games
Question: How many white bordered cards are powerful?
Evidence: white bordered cards refer to borderColor = 'white'; powerful cards refers to cardKingdomFoilId is not null AND cardKingdomId is not null (replace)
SQL: SELECT COUNT(id) FROM cards WHERE borderColor = 'white' AND cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL
Database: card_games
Question: How many cards designed by UDON and available in mtgo print type has a starting maximum hand size of -1?
Evidence: UDON refer to artist; availabe in mtgo refers to availability = 'mtgo'; starting maximum hand size of -1 refers to hand = -1
SQL: SELECT COUNT(id) FROM cards WHERE hAND = '-1' AND artist = 'UDON' AND Availability = 'mtgo'
Database: card_games
Question: How many cards with a 1993 frame version and available on paper have a sensitive content warning?
Evidence: sensitive content warning refer to hasContentWarning = 1; available on paper refer to availability = 'paper' 1993 refer to frameVersion
SQL: SELECT COUNT(id) FROM cards WHERE frameVersion = 1993 AND availability = 'paper' AND hasContentWarning = 1
Database: card_games
Question: 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?
Evidence: available in paper and mtgo refers to availability = 'mtgo,paper'; frameVersion = 2003;borderColor = 'black'
SQL: SELECT manaCost FROM cards WHERE availability = 'mtgo,paper' AND borderColor = 'black' AND frameVersion = 2003 AND layout = 'normal'
Database: card_games
Question: What is the  unconverted mana do all the cards created by Rob Alexander cost in total?
Evidence: unconverted mana refer to manaCost; Rob Alexander refer to artist
SQL: SELECT manaCost FROM cards WHERE artist = 'Rob Alexander'
Database: card_games
Question: Lists all types of cards available in arena.
Evidence: all types refer to subtypes and supertypes

availble in arena refers to availability = 'arena'
SQL: SELECT DISTINCT subtypes, supertypes FROM cards WHERE availability = 'arena' AND subtypes IS NOT NULL AND supertypes IS NOT NULL
Database: codebase_community
Question: List out all post that are related to post ID 61217 and what is the popularity of this post?
Evidence: post related refers to RelatedPostId; popularity refers to ViewCount
SQL: SELECT T1.ViewCount FROM posts AS T1 INNER JOIN postLinks AS T2 ON T1.Id = T2.PostId WHERE T2.PostId = 61217
Database: codebase_community
Question: What is the score and the link type ID for post ID 395?
SQL: SELECT T1.Score, T2.LinkTypeId FROM posts AS T1 INNER JOIN postLinks AS T2 ON T1.Id = T2.PostId WHERE T2.PostId = 395
Database: codebase_community
Question: List out all post ID with score more than 60 and list out all the user ID that created these post.
Evidence: score more than 60 refers to Score > 60
SQL: SELECT PostId, UserId FROM postHistory WHERE PostId IN ( SELECT Id FROM posts WHERE Score > 60 )
Database: codebase_community
Question: What is the sum of favourite count gained by user ID 686 in 2011?
Evidence: in 2011 refers to year (CreatinDate) = 2011
SQL: SELECT SUM(DISTINCT FavoriteCount) FROM posts WHERE Id IN ( SELECT PostId FROM postHistory WHERE UserId = 686 AND STRFTIME('%Y', CreationDate) = '2011' )