birdsql/bird_sql_dev_20251106 huggingface dataset:
Database: card_games
Question: How many translations are there for the set of cards with "Angel of Mercy" in it?
Evidence: set of cards with "Angel of Mercy" in it refers to name = 'Angel of Mercy'
SQL:
SELECT COUNT(DISTINCT translation) FROM set_translations WHERE setCode IN ( SELECT setCode FROM cards WHERE name = 'Angel of Mercy' ) AND translation IS NOT NULL
Database: card_games
Question: Please list the names of the cards in the set "Hauptset Zehnte Edition".
Evidence: card set "Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'
SQL:
SELECT DISTINCT T1.name FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T2.translation = 'Hauptset Zehnte Edition'
Database: card_games
Question: For the set of cards with "Ancestor's Chosen" in it, is there a Korean version of it?
Evidence: set of cards with "Ancestor''s Chosen" in it refers to name = 'Ancestor''s Chosen'; Korean version refers to language = 'Korean'
SQL:
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'
Database: card_games
Question: Among the cards in the set "Hauptset Zehnte Edition", how many of them are designed by Adam Rex?
Evidence: card set "Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'; designed by Adam refers to artist = 'Adam Rex'
SQL:
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'
Database: card_games
Question: How many cards are there in the base set of "Hauptset Zehnte Edition"?
Evidence: "Hauptset Zehnte Edition" refers to translation = 'Hauptset Zehnte Edition'; number of cards refers to baseSetSize
SQL:
SELECT T1.baseSetSize FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Hauptset Zehnte Edition'
Database: card_games
Question: What is the Simplified Chinese translation of the name of the set "Eighth Edition"?
Evidence: 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
SQL:
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'
Database: card_games
Question: Did the set of cards with "Angel of Mercy" appear on Magic: The Gathering Online?
Evidence: 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
SQL:
SELECT IIF(EXISTS (SELECT 1 FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T1.name = 'Angel of Mercy' AND T2.mtgoCode IS NOT NULL), 'YES', 'NO')
Database: card_games
Question: When was the set of cards with "Ancestor's Chosen" released?
Evidence: card set "Ancestor's Chosen" refers to name = 'Ancestor''s Chosen'; when released refers to releaseDate
SQL:
SELECT DISTINCT T2.releaseDate FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T1.name = 'Ancestor''s Chosen'
Database: card_games
Question: What is the expansion type of the set "Hauptset Zehnte Edition"?
Evidence: card set "Hauptset Zehnte Edition" refers to translation = ' Hauptset Zehnte Edition'; expansion type refers to type
SQL:
SELECT T1.type FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Hauptset Zehnte Edition'
Database: card_games
Question: Among the sets in the block "Ice Age", how many of them have an Italian translation?
Evidence: sets in the block "Ice Age" refers to block = 'Ice Age'; Italian translation refers to language = 'Italian' and translation is not null
SQL:
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
Database: card_games
Question: Is the set of cards with Adarkar Valkyrie only available outside the United States?
Evidence: card set Adarkar Valkyrie refers to name = 'Adarkar Valkyrie'; isForeignOnly = 1 means only available outside the United States;
SQL:
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'
Database: card_games
Question: Among the sets of cards that have an Italian translation, how many of them have a base set number of under 100?
Evidence: Italian translation refers to language is 'Italian'; have a translation means translation is not null; base set number of under 100 refers to baseSetSize is less than 100
SQL:
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'
Database: card_games
Question: How many cards in the set Coldsnap have a black border color?
Evidence: card set Coldsnap refers to name = 'Coldsnap'; black border color refers to borderColor = 'black'
SQL:
SELECT SUM(CASE WHEN T1.borderColor = 'black' THEN 1 ELSE 0 END) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap'
Database: card_games
Question: Please list the name of the cards in the set Coldsnap with the highest converted mana cost.
Evidence: card set Coldsnap refers to name = 'Coldsnap'
SQL:
SELECT T1.name 
FROM cards AS T1 
INNER JOIN sets AS T2 ON T2.code = T1.setCode 
WHERE T2.name = 'Coldsnap' 
AND T1.convertedManaCost = (
    SELECT MAX(convertedManaCost) 
    FROM cards T3 
    INNER JOIN sets T4 ON T4.code = T3.setCode 
    WHERE T4.name = 'Coldsnap'
)
ORDER BY T1.name ASC;
Database: card_games
Question: Which of the following artists, Jeremy Jarvis, Aaron Miller or Chippy, have designed a card in the set Coldsnap.
Evidence: [Remove Evidence]
SQL:
SELECT DISTINCT T1.artist FROM cards as T1 INNER JOIN sets as T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.artist in ('Jeremy Jarvis', 'Aaron Miller', 'Chippy')
Database: card_games
Question: What is card number 4 in the set Coldsnap?
Evidence: card set Coldsnap refers to name = 'Coldsnap'; card number 4 refers to number = 4
SQL:
SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.number = 4
Database: card_games
Question: Among the cards with converted mana cost higher than 5 in the set Coldsnap, how many of them have unknown power?
Evidence: card set Coldsnap refers to name = 'Coldsnap'; converted mana cost higher than 5 refers to convertedManaCost > 5; unknown power refers to power = '*' or power = NULL
SQL:
SELECT SUM(CASE WHEN T1.power LIKE '*' 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
Database: card_games
Question: What is the Italian flavor text of the card "Ancestor's Chosen"?
Evidence: [Remove Evidence]
SQL:
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'
Database: card_games
Question: Please list all the foreign languages in which the card "Ancestor's Chosen" has a flavor text.
Evidence: "Ancestor''s Chosen" refers to name = 'Ancestor''s Chosen'; has a flavor text refers to flavorText is not null
SQL:
SELECT T2.language FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.name = 'Ancestor''s Chosen' AND T2.flavorText IS NOT NULL
Database: card_games
Question: What's the German type of the card "Ancestor's Chosen"?
Evidence: German refers to language = 'German'; "Ancestor's Chosen" refers to name = 'Ancestor''s Chosen'
SQL:
SELECT DISTINCT T1.type FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.name = 'Ancestor''s Chosen' AND T2.language = 'German'
Database: card_games
Question: Please list the Italian text ruling of all the cards in the set Coldsnap.
Evidence: card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'
SQL:
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'
Database: card_games
Question: Please list the Italian names of the cards in the set Coldsnap with the highest converted mana cost.
Evidence: card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian'; highest converted mana cost refers to MAX(convertedManaCost)
SQL:
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
Database: card_games
Question: When was the ruling for the card 'Reminisce' created?
Evidence: Reminisce refers to name = 'Reminisce'; when created is the date
SQL:
SELECT T2.date FROM cards AS T1 INNER JOIN rulings AS T2 ON T2.uuid = T1.uuid WHERE T1.name = 'Reminisce'
Database: card_games
Question: What is the percentage of the cards with a converted mana cost of 7 in the set Coldsnap?
Evidence: converted mana cost of 7 refers to convertedManaCost = 7; card set Coldsnap refers to name = 'Coldsnap'; percentage = DIVIDE(SUM(convertedManaCost = 7), SUM(convertedManaCost))*100
SQL:
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'
Database: card_games
Question: What is the percentage of incredibly powerful cards in the set Coldsnap?
Evidence: incredibly powerful cards refers to cardKingdomFoilId is not null AND cardKingdomId is not null; Coldsnap is the name of a card set
SQL:
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'
Database: card_games
Question: What's the code for the set which was released on 2017/7/14?
Evidence: released on 2017/7/14 refers to releaseDate = '2017-07-14'
SQL:
SELECT code FROM sets WHERE releaseDate = '2017-07-14' GROUP BY releaseDate, code
Database: card_games
Question: List the keyrune code for the set whose code is 'PKHC'.
SQL:
SELECT keyruneCode FROM sets WHERE code = 'PKHC'
Database: card_games
Question: For the set which had 'SS2' as the code, what is its magic card market id?
Evidence: magic card market id refers to mcmId
SQL:
SELECT mcmId FROM sets WHERE code = 'SS2'
Database: card_games
Question: What's the magic card market name for the set which was released on 2017/6/9?
Evidence: magic card market name refers to mcmName
SQL:
SELECT mcmName FROM sets WHERE releaseDate = '2017-06-09'
Database: card_games
Question: For the set "From the Vault: Lore", what is its expansion type?
Evidence: set "From the Vault refers to name which contains 'From the Vault: Lore'; expansion type refers to type
SQL:
SELECT type FROM sets WHERE name LIKE '%FROM the Vault: Lore%'
Database: card_games
Question: For the set "Commander 2014 Oversized" , give its parent code.
Evidence: the set "Commander 2014 Oversized" refers to name = 'Commander 2014 Oversized';
SQL:
SELECT parentCode FROM sets WHERE name = 'Commander 2014 Oversized'
Database: card_games
Question: For all cards illustrated by Jim Pavelec. and describe the text of the ruling of these cards. Do these cards have missing or degraded properties and values.
Evidence: all cards illustrated by Jim Pavelec refers to artist = 'Jim Pavelec'; the text of the ruling refers to text; cards have missing or degraded properties and values if hasContentWarning = 1 else it doesn't have;
SQL:
SELECT T2.text , CASE WHEN T1.hasContentWarning = 1 THEN 'YES' ELSE 'NO' END FROM cards AS T1 INNER JOIN rulings AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Jim Pavelec'
Database: card_games
Question: What was the release date for the set which card "Evacuation" in it?
Evidence: "Evacuation" refers to name = 'Evacuation'; release date refers to releaseDate
SQL:
SELECT T2.releaseDate FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T1.name = 'Evacuation'
Database: card_games
Question: How many cards are there in the set of "Rinascita di Alara"?
Evidence: set of "Rinascita di Alara" is a translation of a set.
SQL:
SELECT T1.baseSetSize FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Rinascita di Alara'
Database: card_games
Question: List the expansion type of the set "Huitième édition".
Evidence: the set "Huitième édition" refers to translation = 'Huitième édition'; expansion type refers to type
SQL:
SELECT type FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE translation = 'Huitième édition' )
Database: card_games
Question: What's the French name of the set of cards with "Tendo Ice Bridge" is in?
Evidence: French refers to language = 'French'; "Tendo Ice Bridge" is a translated name of a card; translated name refers to translation
SQL:
SELECT T2.translation FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T1.name = 'Tendo Ice Bridge' AND T2.language = 'French' AND T2.translation IS NOT NULL
Database: card_games
Question: How many translations of the name of the set "Tenth Edition"?
Evidence: set "Tenth Edition" refers to name = 'Tenth Edition'
SQL:
SELECT COUNT(DISTINCT T2.translation) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.name = 'Tenth Edition'
Database: card_games
Question: Tell the Japanese name of the set which card "Fellwar Stone" is in it.
Evidence: Japanese name refers to language = 'Japanese'; card "Fellwar Stone" refers to name = 'Fellwar Stone'
SQL:
SELECT T2.translation FROM cards AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.setCode WHERE T1.name = 'Fellwar Stone' AND T2.language = 'Japanese' AND T2.translation IS NOT NULL
Database: card_games
Question: Which card name in the set 'Journey into Nyx Hero's Path' has the highest converted mana cost.
Evidence: set 'Journey into Nyx Hero's Path' refers to name = 'Journey into Nyx Hero''s Path'.highest converted manacost require to find the maximum of manacost.
SQL:
WITH MaxCMC AS (
    SELECT MAX(T1.convertedManaCost) AS max_cmc
    FROM cards AS T1
    INNER JOIN sets AS T2 ON T2.code = T1.setCode
    WHERE T2.name = 'Journey into Nyx Hero''s Path'
)
SELECT T1.name
FROM cards AS T1
INNER JOIN sets AS T2 ON T2.code = T1.setCode
CROSS JOIN MaxCMC
WHERE T2.name = 'Journey into Nyx Hero''s Path'
  AND T1.convertedManaCost = MaxCMC.max_cmc;
Database: card_games
Question: What is the release date for the set "Ola de frío"?
Evidence: release date is the date of card set being released; set "Ola de frío" refers to translation = 'Ola de frío'
SQL:
SELECT T1.releaseDate FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation = 'Ola de frío'
Database: card_games
Question: What was the expansion type for the set which card "Samite Pilgrim" in it?
Evidence: expansion type refers to type; card "Samite Pilgrim" refers to name = 'Samite Pilgrim'
SQL:
SELECT type FROM sets WHERE code IN ( SELECT setCode FROM cards WHERE name = 'Samite Pilgrim' )
Database: card_games
Question: How many cards are there in the set 'World Championship Decks 2004' with the converted mana cost as '3'.
Evidence: the set 'World Championship Decks 2004' refers to name = 'World Championship Decks 2004'
SQL:
SELECT COUNT(id) FROM cards WHERE setCode IN ( SELECT code FROM sets WHERE name = 'World Championship Decks 2004' ) AND convertedManaCost = 3
Database: card_games
Question: Show the Simplified Chinese translation of the name of the set "Mirrodin"?
Evidence: Simplified Chinese translation refers to language = 'Chinese Simplified'; name of the set "Mirrodin" refers to name = 'Mirrodin'
SQL:
SELECT translation FROM set_translations WHERE setCode IN ( SELECT code FROM sets WHERE name = 'Mirrodin' ) AND language = 'Chinese Simplified'
Database: card_games
Question: For all the set of cards that has Japanese translation, what is the percentage of them are only available in non-foil?
Evidence: Japanese translation refers to language = 'Japanese'; in non-foil refers to isNonFoilOnly = 1; percentage of Japanese non foil in Japanese cards refers to DIVIDE(SUM(isNonFoilOnly = 1), SUM(language = 'Japanese'))*100
SQL:
SELECT CAST(SUM(CASE WHEN isNonFoilOnly = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(id) FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE language = 'Japanese' )
Database: card_games
Question: For all the cards that have a Brazilian Portuguese translation, what is the percentage of them that are only available online?
Evidence: Brazilian Portuguese translation refers to language = 'Portuguese (Brazil)'; only available online refers to isOnlineOnly = 1
SQL:
SELECT CAST(SUM(CASE WHEN T1.isOnlineOnly = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T2.language = 'Portuguese (Brazil)'
Database: card_games
Question: What are the available printing types of the cards that doesn't have a text box created by Aleksi Briclot?
Evidence: created by Aleksi Briclot refers to artist = 'Aleksi Briclot'; doesn't have a text box refers to isTextless = 1; available printing types refers to availability
SQL:
SELECT DISTINCT availability FROM cards WHERE artist = 'Aleksi Briclot' AND isTextless = 1
Database: card_games
Question: What is the unique id of the set that has the highest number of cards?
Evidence: the highest number of cards refers to MAX(baseSetSize); unique id refers to id
SQL:
SELECT id FROM sets ORDER BY baseSetSize DESC LIMIT 1
Database: card_games
Question: Among the cards that doesn't have multiple faces on the same card, who is the illustrator of the card art that has the highest cost of converted mana?
Evidence: doesn't have multiple faces refers to side IS NULL; illustrator refers to artist
SQL:
SELECT artist FROM cards WHERE side IS NULL ORDER BY convertedManaCost DESC LIMIT 1
Database: card_games
Question: What is the most common visual frame effects among the incredibly powerful foils?
Evidence: when both cardKingdomFoilId and cardKingdomId are not null, this foil is incredibly powerful; most common visual frame effects refers to MAX(frameEffects)
SQL:
SELECT frameEffects FROM cards WHERE cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL GROUP BY frameEffects ORDER BY COUNT(frameEffects) DESC LIMIT 1
Database: card_games
Question: How many cards with unknown power that can't be found in foil is in duel deck A?
Evidence: unknown power refers to power IS NULL or power = '*'; can't be found in foil refers to hasFoil = 0; duel deck A refers to duelDeck = 'a'
SQL:
SELECT SUM(CASE WHEN power = '*' OR power IS NULL THEN 1 ELSE 0 END) FROM cards WHERE hasFoil = 0 AND duelDeck = 'a'
Database: card_games
Question: Among the sets whose expansion type is Commander, which set has the highest total number of cards including promotional and related supplemental products but excluding Alchemy modifications? Indicate the id of the set.
SQL:
SELECT id FROM sets WHERE type = 'commander' ORDER BY totalSetSize DESC, id ASC LIMIT 1
Database: card_games
Question: In duels, what are the top 10 cards with the highest converted mana cost?
Evidence: duels refer to format = 'duel'
SQL:
SELECT DISTINCT name FROM cards WHERE uuid IN ( SELECT uuid FROM legalities WHERE format = 'duel' ) ORDER BY convertedManaCost DESC, name ASC LIMIT 10
Database: card_games
Question: When was the oldest mythic card released and what are its legal play formats?
Evidence: the oldest card refers to MIN(originalReleaseDate); mythic card refers to rarity = 'mythic'; legal play refers to status = 'legal'; play format refers to format
SQL:
SELECT T1.originalReleaseDate, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal' AND T1.originalReleaseDate = (SELECT MIN(originalReleaseDate) FROM cards WHERE rarity = 'mythic' AND originalReleaseDate IS NOT NULL)
Database: card_games
Question: How many cards did Volkan BaÇµa illustrated whose foreign language is in French?
Evidence: Volkan BaÇµa refers to artist = 'Volkan Baǵa'; foreign language is in French refers to language = 'French'
SQL:
SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Volkan Baǵa' AND T2.language = 'French'
Database: card_games
Question: How many distinct rare enchantment Abundance cards have at least one legal play format?
Evidence: rare refers to rarity = 'rare'; enchantment card refers to types = 'Enchantment'; Abundance cards refers to name = 'Abundance'; at least one legal format refers to status = 'Legal'
SQL:
SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T1.rarity = 'rare' AND T1.types = 'Enchantment' AND T1.name = 'Abundance' AND T2.status = 'Legal'
Database: card_games
Question: 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.
Evidence: play format refers to format; banned status refers to status = 'Banned'; the highest number of banned status refers to MAX(COUNT(status = 'Banned'))
SQL:
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'
Database: card_games
Question: What is the language of the "Battlebond" set?
Evidence: "Battlebond" set refers to name = 'Battlebond'
SQL:
SELECT language FROM set_translations WHERE id IN ( SELECT id FROM sets WHERE name = 'Battlebond' )
Database: card_games
Question: Who is the illustrator that illustrated the least amount of cards? List the format of play of the cards that he/she illustrated.
Evidence: format of the cards refers to format; illustrator refers to artist; the least amount of cards refers to MIN(artist)
SQL:
SELECT T1.artist, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid GROUP BY T1.artist ORDER BY COUNT(T1.id) ASC LIMIT 1
Database: card_games
Question: Among the cards whose version of frame style is 1997, what is the status of the card illustrated by D. Alexander Gregory in legacy play format that has sensitive content?
Evidence: version of frame style is 1997 refers to frameVersion = '1997'; illustrated by D. Alexander Gregory refers to artist = 'D. Alexander Gregory'; sensitive content refers to hasContentWarning = 1; legacy play format refers to format = 'legacy'; status of the card refers to status
SQL:
SELECT DISTINCT T2.status FROM cards AS T1 INNER JOIN legalities AS T2 ON T2.uuid = T1.uuid WHERE T1.frameVersion = 1997 AND T1.hasContentWarning = 1 AND T1.artist = 'D. Alexander Gregory' AND T2.format = 'legacy'
Database: card_games
Question: Which cards are ranked 1st on EDHRec? List all of the cards name and its banned play format.
Evidence: ranked 1st on EDHRec refers to edhrecRank = 1; banned refers to status = 'Banned'; play format refers to format; cards name refers to name
SQL:
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
Database: card_games
Question: What is the annual average number of sets that were released between 1/1/2012 to 12/31/2015? Indicate the common langugage of the card.
Evidence: AVG(id); releaseDate BETWEEN 1/1/2012 AND 12/31/2015; the common language refers to MAX(COUNT(language))
SQL:
SELECT (CAST(SUM(T1.id) AS REAL) / COUNT(T1.id)) / 4, T2.language FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.id = T2.id WHERE T1.releaseDate BETWEEN '2012-01-01' AND '2015-12-31' GROUP BY T1.releaseDate ORDER BY COUNT(T2.language) DESC LIMIT 1
Database: card_games
Question: List the artists who illustrated cards with black borders which are available only in arena.
Evidence: black borders refers to BorderColor = 'black'; available only in arena refers to availability = 'arena'
SQL:
SELECT DISTINCT artist FROM cards WHERE availability = 'arena' AND BorderColor = 'black'
Database: card_games
Question: Find the uuid of cards in which the old school format is restricted or banned.
Evidence: old school format refers to format = 'oldschool'; restricted or banned refers to status = 'banned' or 'restricted'
SQL:
SELECT uuid FROM legalities WHERE format = 'oldschool' AND (status = 'Banned' OR status = 'Restricted')
Database: card_games
Question: Among the card designed by Matthew D. Wilson, how many are available only in the paper?
Evidence: card designed by Matthew D. Wilson refers to artist = 'Matthew D. Wilson'; available only in the paper refers to availability = 'paper'
SQL:
SELECT COUNT(id) FROM cards WHERE artist = 'Matthew D. Wilson' AND availability = 'paper'
Database: card_games
Question: What are the rulings for the card named and designed by Kev Walker? List them in descending order of dates.
Evidence: rulings refers to text; card named and designed by Kev Walker refers to artist = 'Kev Walker'; descending order of dates refers to ORDER BY date DESC
SQL:
SELECT T2.text FROM cards AS T1 INNER JOIN rulings AS T2 ON T2.uuid = T1.uuid WHERE T1.artist = 'Kev Walker' ORDER BY T2.date DESC
Database: card_games
Question: List the names of all the cards in the set Hour of Devastation and find the formats in which these cards are legal.
Evidence: 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
SQL:
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' )
Database: card_games
Question: Find and list the names of sets which doesn't have Japanese translation but have Korean translation.
Evidence: names of sets refers to name; doesn't have Japanese translation refers to language not like '%Japanese%'; have Korean translation refers to language = 'Korean'
SQL:
SELECT name FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE language = 'Korean' AND language NOT LIKE '%Japanese%' )
Database: card_games
Question: List all the frame styles and cards Allen Williams worked on and find any banned cards if there are any.
Evidence: frame styles refers to frameVersion; cards Allen Williams worked on refers to artist = 'Allen Williams'; banned cards refers to status = 'Banned'
SQL:
SELECT 
    T1.frameVersion, 
    T1.name,
    CASE 
        WHEN EXISTS (SELECT 1 FROM legalities AS T2 WHERE T2.uuid = T1.uuid AND T2.status = 'Banned') 
        THEN 'Banned' 
        ELSE 'Not Banned' 
    END AS banned_status
FROM cards AS T1
WHERE T1.artist = 'Allen Williams'
ORDER BY T1.frameVersion ASC, T1.name ASC;
Database: codebase_community
Question: Which user has a higher reputation, Harlan or Jarrod Dixon?
Evidence: "Harlan" and "Jarrod Dixon" are both DisplayName; highest reputation refers to Max(Reputation)
SQL:
SELECT DisplayName FROM users WHERE DisplayName IN ('Harlan', 'Jarrod Dixon') AND Reputation = ( SELECT MAX(Reputation) FROM users WHERE DisplayName IN ('Harlan', 'Jarrod Dixon') )
Database: codebase_community
Question: Please list the display names of all the users whose accounts were created in the year 2011.
Evidence: No evidence needed
SQL:
SELECT DisplayName FROM users WHERE STRFTIME('%Y', CreationDate) = '2011'
Database: codebase_community
Question: How many users last accessed the website after 2014/9/1?
Evidence: last accessed after 2014/9/1 refers to LastAccessDate > '2014-09-01'
SQL:
SELECT COUNT(Id) FROM users WHERE date(LastAccessDate) > '2014-09-01'
Database: codebase_community
Question: What is the display name of the user who has the most number of views?
Evidence: user who has the most number of view refers to Max(Views)
SQL:
SELECT DisplayName FROM users WHERE Views = ( SELECT MAX(Views) FROM users )
Database: codebase_community
Question: Among the users who have more than 100 upvotes, how many of them have more then 1 downvotes?
Evidence: more than 100 upvotes refers to Upvotes > 100; more than 1 downvotes refers to Downvotes > 1
SQL:
SELECT COUNT(Id) FROM users WHERE Upvotes > 100 AND Downvotes > 1
Database: codebase_community
Question: How many users with more than 10 views created their account after the year 2013?
Evidence: more than 10 views refers to Views > 10; created after the year 2013 refers to year (CreationDate) > 2013
SQL:
SELECT COUNT(id) FROM users WHERE STRFTIME('%Y', CreationDate) > '2013' AND Views > 10
Database: codebase_community
Question: How many posts does the user csgillespie own?
Evidence: "csgillespie" is the DisplayName of user
SQL:
SELECT COUNT(T1.id) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: Please list the titles of the posts owned by the user csgillespie?
Evidence: "csgillespie" is the DisplayName of user
SQL:
SELECT T1.Title FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: Who is the owner of the post "Eliciting priors from experts"?
Evidence: "Eliciting priors from experts" is the Title of post; owner refers to DisplayName
SQL:
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Title = 'Eliciting priors from experts'
Database: codebase_community
Question: What is the title of the post that is owned by csgillespie and has the highest popularity?
Evidence: "csgillespie" is the DisplayName of user; highest popularity refers to Max(ViewCount)
SQL:
SELECT T1.Title FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie' ORDER BY T1.ViewCount DESC LIMIT 1
Database: codebase_community
Question: What is the display name of the user who is the owner of the most valuable post?
Evidence: most valuable post refers to Max(FavoriteCount)
SQL:
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id ORDER BY T1.FavoriteCount DESC LIMIT 1
Database: codebase_community
Question: What is the total number of comments of all the posts owned by csgillespie?
Evidence: "csgillespie" is the DisplayName of user; total number of comments refers to Sum(CommentCount)
SQL:
SELECT SUM(T1.CommentCount) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: For the post that got the most number of answers owned by csgillespie, how many answers did it get?
Evidence: "csgillespie" is the display name of the user. The post with the most number of answers is the one with the highest answer count among the user's posts.
SQL:
SELECT T1.AnswerCount 
FROM posts AS T1 
INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id 
WHERE T2.DisplayName = 'csgillespie' 
ORDER BY T1.AnswerCount DESC, T1.Id ASC 
LIMIT 1
Database: codebase_community
Question: What is the display name of the user who last edited the post "Examples for teaching: Correlation does not mean causation"?
Evidence: "Examples for teaching: Correlation does not mean causation" is the Title of post; user who last edited refers to LastEditorUserId
SQL:
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'
Database: codebase_community
Question: Among the posts owned by csgillespie, how many of them are root posts?
Evidence: 'csgillespie' is the DisplayName of user; root post refers to ParentId IS Null
SQL:
SELECT COUNT(T1.Id)
FROM posts AS T1
INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id
WHERE T2.DisplayName = 'csgillespie' AND T1.ParentId IS NULL;
Database: codebase_community
Question: Please list the display names of all the users who owns a post that is well-finished.
Evidence: the post that is well-finished refers to ClosedDate IS NOT Null
SQL:
SELECT DISTINCT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.ClosedDate IS NOT NULL
Database: codebase_community
Question: Among the posts owned by an elder user, how many of them have a score of over 19?
Evidence: elder users refers to Age > 65; Score of over 19 refers to Score > = 20
SQL:
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
Database: codebase_community
Question: What is the location of the owner of the post "Eliciting priors from experts"?
Evidence: Owner refers to OwnerUserId; 'Eliciting priors from experts' is the Title of post
SQL:
SELECT T2.Location FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Title = 'Eliciting priors from experts'
Database: codebase_community
Question: From which post is the tag "bayesian" excerpted from? Please give the body of the post.
Evidence: "bayesian" is the TagName; excerpt from refers to ExcerptPostId
SQL:
SELECT T2.Body FROM tags AS T1 INNER JOIN posts AS T2 ON T2.Id = T1.ExcerptPostId WHERE T1.TagName = 'bayesian'
Database: codebase_community
Question: From which post is the most popular tag excerpted from? Please give the body of the post.
Evidence: most popular tag refers to Max(Count); excerpt from refer to ExcerptPostId
SQL:
SELECT Body FROM posts WHERE id = ( SELECT ExcerptPostId FROM tags ORDER BY Count DESC LIMIT 1 )
Database: codebase_community
Question: How many badges has the user csgillespie obtained?
Evidence: "csgillespie" is the DisplayName of user
SQL:
SELECT COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: Please list the names of the badges obtained by csgillespie.
Evidence: "csgillespie" is the DisplayName of user
SQL:
SELECT T1.`Name` FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: Among the badges obtained by csgillespie, how many of them were obtained in the year 2011?
Evidence: "csgillespie" is the display name of the user; obtained in 2011 refers to badges received in the year 2011
SQL:
SELECT COUNT(T1.Id) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE STRFTIME('%Y', T1.Date) = '2011' AND T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: What is the display name of the user who has obtained the most number of badges?
SQL:
SELECT T2.DisplayName FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id GROUP BY T2.Id ORDER BY COUNT(T1.Id) DESC, T2.Id ASC LIMIT 1
Database: codebase_community
Question: What is the average score of the posts owned by the user csgillespie?
Evidence: "csgillespie" is the DisplayName of user; average score refers to AVG(Score)
SQL:
SELECT AVG(T1.Score) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T2.DisplayName = 'csgillespie'
Database: codebase_community
Question: What is the average number of badges obtained by a user with over 200 views?
Evidence: average number of badges = total number of badges / number of distinct users with over 200 views
SQL:
SELECT CAST(COUNT(T1.Id) AS REAL) / COUNT(DISTINCT T2.DisplayName) FROM badges AS T1 INNER JOIN users AS T2 ON T1.UserId = T2.Id WHERE T2.Views > 200
Database: codebase_community
Question: Among the posts with a score of over 5, what is the percentage of them being owned by an elder user?
Evidence: score of over 5 refers to Score > 5; elder user refers to Age > 65; percentage = Divide (Count(Id where Age>65), Count(Id)) * 100
SQL:
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
Database: codebase_community
Question: How many votes did the user No.58 take on 2010/7/19?
Evidence: user no. 58 refers to UserId = 58; on 2010/7/19 refers to CreationDate = '2010-07-19'
SQL:
SELECT COUNT(Id) FROM votes WHERE UserId = 58 AND CreationDate = '2010-07-19'
Database: codebase_community
Question: Indicate the creation date of the maximum number of votes.
Evidence: the creation date with the highest number of votes
SQL:
SELECT CreationDate 
FROM votes 
GROUP BY CreationDate 
ORDER BY COUNT(Id) DESC, CreationDate ASC 
LIMIT 1
Database: codebase_community
Question: Give the number of "Revival" badges.
Evidence: number refers to Id; 'Revival' is the Name of badge
SQL:
SELECT COUNT(Id) FROM badges WHERE Name = 'Revival'
Database: codebase_community
Question: What are the titles of all posts that have comments with the highest score?
Evidence: highest score comment refers to Max(comments.Score)
SQL:
SELECT DISTINCT p.Title FROM posts p INNER JOIN comments c ON p.Id = c.PostId WHERE c.Score = (SELECT MAX(Score) FROM comments) ORDER BY p.Title ASC
Database: codebase_community
Question: For the post which got 1910 view counts, how many comments does it get?
SQL:
SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId WHERE T1.ViewCount = 1910
Database: codebase_community
Question: 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?
Evidence: 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'
SQL:
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
Database: codebase_community
Question: Give the comment text of the post with only one comment and parent id 107829.
Evidence: one comment refers to CommentCount = '1'
SQL:
SELECT T2.Text FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId WHERE T1.ParentId = 107829 AND T1.CommentCount = 1
Database: codebase_community
Question: User No.23853 gave a comment to a post at 9:08:18 on 2013/7/12, was that post well-finished?
Evidence: 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
SQL:
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';
Database: codebase_community
Question: For the owner user of post No. 65041, what is his/her reputation points?
Evidence: post no. 65041 refers to Id = '65041'; reputation point refers to Reputation
SQL:
SELECT T1.Reputation FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T2.Id = 65041
Database: codebase_community
Question: For the user with the display name of "Tiago Pasqualini", how many posts did he/she own?
Evidence: "Tiago Pasqualini" is the DisplayName;
SQL:
SELECT COUNT(T1.Id) FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Tiago Pasqualini'
Database: codebase_community
Question: Provide the display name of the user who made the vote No.6347.
Evidence: vote no. 6347 refers to Id = '6347'
SQL:
SELECT T1.DisplayName FROM users AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.UserId WHERE T2.Id = 6347
Database: codebase_community
Question: Give the number of votes for the post about data visualization.
Evidence: About data visualization is the Title that contains 'data visualization';
SQL:
SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId WHERE T1.Title LIKE '%data visualization%'
Database: codebase_community
Question: For the user whose display name is "DatEpicCoderGuyWhoPrograms", what is his/her badge's name?
Evidence: "DatEpicCoderGuyWhoPrograms" is the DisplayName;
SQL:
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'DatEpicCoderGuyWhoPrograms'
Database: codebase_community
Question: For the user No.24, how many times is the number of his/her posts compared to his/her votes?
Evidence: user no. 24 refers to UserId = OwnerUserId = '24'; times of his/her post than votes = Divide (Count(post.Id), Count(votes.Id))
SQL:
SELECT 
    (SELECT CAST(COUNT(*) AS REAL) FROM posts WHERE OwnerUserId = 24) /
    (SELECT CAST(COUNT(*) AS REAL) FROM votes WHERE UserId = 24)
Database: codebase_community
Question: How many views did the post titled 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer' get?
Evidence: "Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer" is the Title of post; views refers to ViewCount
SQL:
SELECT ViewCount FROM posts WHERE Title = 'Integration of Weka and/or RapidMiner into Informatica PowerCenter/Developer'
Database: codebase_community
Question: Write the contents of comments with a score of 17.
Evidence: score of 17 refers to Score = 17; contents of comments refers to Text
SQL:
SELECT Text FROM comments WHERE Score = 17
Database: codebase_community
Question: Which user has the website URL listed at 'http://stackoverflow.com'
Evidence: user refers to DisplayName
SQL:
SELECT DisplayName FROM users WHERE WebsiteUrl = 'http://stackoverflow.com'
Database: codebase_community
Question: What is the badge name that user 'SilentGhost' obtained?
Evidence: "SilentGhost" is the DisplayName of user;
SQL:
SELECT T2.Name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'SilentGhost'
Database: codebase_community
Question: Name the user that commented 'thank you user93!'
Evidence: "thank you user93" is the Text of comment; user refers to DisplayName
SQL:
SELECT T1.DisplayName FROM users AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.UserId WHERE T2.Text = 'thank you user93!'
Database: codebase_community
Question: Write all comments made by user 'A Lion.'
Evidence: "A Lion" is the DisplayName of user; comment refers to Text
SQL:
SELECT T2.Text FROM users AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'A Lion'
Database: codebase_community
Question: Which user made a post titled 'Understanding what Dassault iSight is doing?' and how much is the reputation of the user?
Evidence: user refers to DisplayName
SQL:
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?'
Database: codebase_community
Question: Write all comments made on the post titled 'How does gentle boosting differ from AdaBoost?'
Evidence: "How does gentle boosting differ from AdaBoost?" is the Title of post; comments refers to Text
SQL:
SELECT T1.Text FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.Title = 'How does gentle boosting differ from AdaBoost?'
Database: codebase_community
Question: Name 10 users with the badge name 'Necromancer.'
Evidence: 'Necromancer' is the Name of badge; users refers to DisplayName
SQL:
SELECT DISTINCT T1.DisplayName
FROM users AS T1
INNER JOIN badges AS T2 ON T1.Id = T2.UserId
WHERE T2.Name = 'Necromancer'
ORDER BY T1.Id ASC
LIMIT 10;
Database: codebase_community
Question: Who is the editor of the post titled 'Open source tools for visualizing multi-dimensional data?'
Evidence: An editor of a post is the last person who edited it; 'Open source tools for visualizing multi-dimensional data?' is the exact title of the post
SQL:
SELECT T2.DisplayName FROM posts AS T1 INNER JOIN users AS T2 ON T1.LastEditorUserId = T2.Id WHERE T1.Title = 'Open source tools for visualizing multi-dimensional data?'
Database: codebase_community
Question: List the title of posts which were edited by Vebjorn Ljosa.
Evidence: 'Vebjorn Ljosa' is the DisplayName; last edited refers to LastEditorUserId
SQL:
SELECT T1.Title
FROM posts AS T1
INNER JOIN users AS T2 ON T1.LastEditorUserId = T2.Id
WHERE T2.DisplayName = 'Vebjorn Ljosa';
Database: codebase_community
Question: What is the total score of the posts edited by Yevgeny and include the user's website URL.
Evidence: "Yevgeny" is the DisplayName; edited refers to LastEditorUserId
SQL:
SELECT SUM(T1.Score), T2.WebsiteUrl FROM posts AS T1 INNER JOIN users AS T2 ON T1.LastEditorUserId = T2.Id WHERE T2.DisplayName = 'Yevgeny' GROUP BY T2.WebsiteUrl
Database: codebase_community
Question: 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?'
Evidence: "Why square the difference instead of taking the absolute value in standard deviation?" is the Title of post;
SQL:
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?'
Database: codebase_community
Question: How much is the total bounty amount of the post titled about 'data'
Evidence: About data means the title contains 'data'; total bounty amount is the sum of all bounty amounts for these posts.
SQL:
SELECT SUM(T2.BountyAmount) FROM posts AS T1 INNER JOIN votes AS T2 ON T1.Id = T2.PostId WHERE T1.Title LIKE '%data%'
Database: codebase_community
Question: Which user added a bounty amount of 50 to the post title mentioning variance?
Evidence: bounty amount of 50 refers to BountyAmount = 50; user refers to DisplayName; title mentioning variance refers to Title include 'variance'
SQL:
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%'
Database: codebase_community
Question: Calculate the average view count of each post tagged as 'humor' and list the title and the comment of each post.
Evidence: tagged as  'humor' refers to tag = '<humor>'; comment of the post refers to Text; average view count = AVG(ViewCount)
SQL:
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
Database: codebase_community
Question: Give the total number of comments posted by user ID 13.
SQL:
SELECT COUNT(Id) FROM comments WHERE UserId = 13
Database: codebase_community
Question: Which user ID has the highest reputation?
Evidence: highest reputation refers to Max(Reputation)
SQL:
SELECT Id FROM users WHERE Reputation = ( SELECT MAX(Reputation) FROM users )
Database: codebase_community
Question: Which user ID has the lowest view?
SQL:
SELECT Id FROM users WHERE Views = ( SELECT MIN(Views) FROM users ) ORDER BY Id ASC
Database: codebase_community
Question: How many users are awarded with supporter badge during year 2011?
Evidence: "Supporter" is the Name of badge; in year 2011 refers to year(Date) = 2011
SQL:
SELECT COUNT(DISTINCT UserId) 
FROM badges 
WHERE STRFTIME('%Y', Date) = '2011' 
AND Name = 'Supporter'
AND UserId IS NOT NULL
Database: codebase_community
Question: How many users are awarded with more than 5 badges?
Evidence: more than 5 badges refers to Count (Name) > 5; user refers to UserId
SQL:
SELECT COUNT(UserId) FROM ( SELECT UserId, COUNT(Name) AS num FROM badges GROUP BY UserId ) T WHERE T.num > 5
Database: codebase_community
Question: How many users from New York have a teacher and supporter badge?
Evidence: "Supporter" and "Teachers" are both Name of badge; 'New York' is the Location; user refers to UserId
SQL:
SELECT COUNT(*)
FROM users AS U
WHERE U.Location = 'New York'
  AND EXISTS (
    SELECT 1 FROM badges AS B1 
    WHERE B1.UserId = U.Id AND B1.Name = 'Supporter'
  )
  AND EXISTS (
    SELECT 1 FROM badges AS B2 
    WHERE B2.UserId = U.Id AND B2.Name = 'Teacher'
  )
Database: codebase_community
Question: Which user created post ID 1 and what is the reputation of this user?
Evidence: The creator of a post is its owner.
SQL:
SELECT u.DisplayName, u.Reputation
FROM posts AS p
INNER JOIN users AS u ON p.OwnerUserId = u.Id
WHERE p.Id = 1;