Dludora/Bird-minidev-sqlserver-oracle huggingface dataset:
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 (SQLite): 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%'
SQL (SQL Server): 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%'
SQL (Oracle): SELECT T3.DisplayName, T1.Title FROM posts T1 INNER JOIN votes T2 ON T1.Id = T2.PostId INNER JOIN users T3 ON T3.Id = T2.UserId WHERE T2.BountyAmount = 50 AND T1.Title LIKE '%variance%'

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 (SQLite): 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 
SQL (SQL Server): SELECT AVG(TRY_CAST(T2.ViewCount AS FLOAT)), 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
SQL (Oracle): SELECT AVG(T2.ViewCount), T2.Title, T1.Text FROM comments T1 INNER JOIN posts T2 ON T2.Id = T1.PostId  WHERE T2.Tags = '<humor>' GROUP BY T2.Title, T1.Text

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 (SQLite): SELECT COUNT(UserId) FROM ( SELECT UserId, COUNT(Name) AS num FROM badges GROUP BY UserId ) T WHERE T.num > 5
SQL (SQL Server): SELECT COUNT(UserId) AS _agg1 FROM ( SELECT UserId, COUNT(Name) AS num FROM badges GROUP BY UserId ) T WHERE T.num > 5
SQL (Oracle): SELECT COUNT(UserId) FROM ( SELECT UserId, COUNT(Name) num FROM badges GROUP BY UserId ) T WHERE T.num > 5

Question: Which user have only one post history per post and having at least 1000 views?
Evidence: having at least 1000 view refers to Views > = 1000; user refers to UserId
SQL (SQLite): 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
SQL (SQL Server): 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
SQL (Oracle): SELECT T2.UserId FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN posts T3 ON T2.PostId = T3.Id WHERE T3.ViewCount >= 1000 GROUP BY T2.UserId HAVING COUNT(DISTINCT T2.PostHistoryTypeId) = 1
Database: codebase_community

Question: What is the percentage difference of student badges given during 2010 and 2011?
Evidence: 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)
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST(SUM(IIF(YEAR(Date) = '2010', 1, 0)) AS FLOAT) * 100 / COUNT(Id) - TRY_CAST(SUM(IIF(YEAR(Date) = '2011', 1, 0)) AS FLOAT) * 100 / COUNT(Id) AS _agg1 FROM badges WHERE Name = 'Student'
SQL (Oracle): SELECT CAST(SUM(CASE WHEN SUBSTR("DATE", 1, 4) = '2010' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(Id) - CAST(SUM(CASE WHEN SUBSTR("DATE", 1, 4) = '2011' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(Id) FROM badges WHERE Name = 'Student'

Question: What is the average of the up votes and the average user age for users creating more than 10 posts?
Evidence: 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))
SQL (SQLite): 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
SQL (SQL Server): SELECT AVG(TRY_CAST(T1.UpVotes AS FLOAT)), AVG(TRY_CAST(T1.Age AS FLOAT)) AS _agg1 FROM users AS T1 INNER JOIN ( SELECT OwnerUserId, COUNT(*) AS post_count FROM posts GROUP BY OwnerUserId HAVING (COUNT(*)) > 10) AS T2 ON T1.Id = T2.OwnerUserId
SQL (Oracle): SELECT AVG(T1.UpVotes), AVG(T1.Age) FROM users T1 INNER JOIN ( SELECT OwnerUserId, COUNT(*) post_count FROM posts GROUP BY OwnerUserId HAVING (COUNT(*)) > 10) T2 ON T1.Id = T2.OwnerUserId

Question: Calculate the ratio of votes in 2010 and 2011.
Evidence: DIVIDE(COUNT(Id where YEAR(CreationDate) = 2010), COUNT(Id where YEAR(CreationDate) = 2011)) FROM votes;
SQL (SQLite): SELECT CAST(SUM(IIF(STRFTIME('%Y', CreationDate) = '2010', 1, 0)) AS REAL) / SUM(IIF(STRFTIME('%Y', CreationDate) = '2011', 1, 0)) FROM votes
SQL (SQL Server): SELECT TRY_CAST(SUM(IIF(YEAR(CreationDate) = '2010', 1, 0)) AS FLOAT) / SUM(IIF(YEAR(CreationDate) = '2011', 1, 0)) AS _agg1 FROM votes
SQL (Oracle): SELECT CAST(SUM(CASE WHEN SUBSTR(CreationDate, 1, 4) = '2010' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) / SUM(CASE WHEN SUBSTR(CreationDate, 1, 4) = '2011' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) FROM votes
Database: codebase_community

Question: Which post by slashnick has the most answers count? State the post ID.
Evidence: most answers count refers to MAX(AnswerCount); post by slashnick refers to DisplayName = 'slashnick';
SQL (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.PostId FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN posts T3 ON T2.PostId = T3.Id WHERE T1.DisplayName = 'slashnick' ORDER BY T3.AnswerCount DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: Among posts by Harvey Motulsky and Noah Snyder, which one has higher popularity?
Evidence: Has higher popularity means the post has higher view count ; calculation = MAX(SUM(ViewCount)) where DisplayName = 'Harvey Motulsky' OR DisplayName = 'Noah Snyder';
SQL (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T1.DisplayName FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN posts 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 NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: State all the tags used by Mark Meckes in his posts that doesn't have comments.
Evidence: used by Mark Meckes refers to DisplayName = 'Mark Meckes'; Doen't have comments refers to CommentCount = 0;
SQL (SQLite): 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
SQL (SQL Server): 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
SQL (Oracle): SELECT T3.Tags FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN posts T3 ON T3.Id = T2.PostId WHERE T1.DisplayName = 'Mark Meckes' AND T3.CommentCount = 0
Database: codebase_community

Question: Based on posts posted by Community, calculate the percentage of posts that use the R language.
Evidence: DIVIDE(COUNT(PostId WHERE TagName = 'r')), (COUNT(PostId WHERE DisplayName = 'Community')) as percentage; R language refers to tagname = 'r'
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST(SUM(IIF(T3.TagName = 'r', TRY_CAST(1 AS FLOAT), 0.0)) AS FLOAT) * 100 / COUNT(T1.Id) AS _agg1 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'
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T3.TagName = 'r' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(T1.Id) FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN tags T3 ON T3.ExcerptPostId = T2.PostId WHERE T1.DisplayName = 'Community'

Question: Calculate the difference in view count from post posted by Mornington and view count from posts posted by Amos.
Evidence: calculation = SUBTRACT(SUM(ViewCount where DisplayName = 'Mornington'), SUM(ViewCount where DisplayName = 'Amos'));
SQL (SQLite): 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
SQL (SQL Server): SELECT SUM(IIF(T1.DisplayName = 'Mornington', TRY_CAST(T3.ViewCount AS FLOAT), 0.0)) - SUM(IIF(T1.DisplayName = 'Amos', TRY_CAST(T3.ViewCount AS FLOAT), 0.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
SQL (Oracle): SELECT SUM(CASE WHEN T1.DisplayName = 'Mornington' THEN CAST(T3.ViewCount AS BINARY_DOUBLE) ELSE 0.0 END) - SUM(CASE WHEN T1.DisplayName = 'Amos' THEN CAST(T3.ViewCount AS BINARY_DOUBLE) ELSE 0.0 END) diff FROM users T1 INNER JOIN postHistory T2 ON T1.Id = T2.UserId INNER JOIN posts T3 ON T3.Id = T2.PostId

Question: What is the average monthly number of links created in 2010 for posts that have no more than 2 answers?
Evidence: calculation = DIVIDE(COUNT(Id where YEAR(CreationDate) = 2010 and AnswerCount < = 2), 12)
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST(COUNT(T1.Id) AS FLOAT) / 12 FROM postLinks AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.AnswerCount <= 2 AND YEAR(T1.CreationDate) = '2010'
SQL (Oracle): SELECT CAST(COUNT(T1.Id) AS BINARY_DOUBLE) / 12 FROM postLinks T1 INNER JOIN posts T2 ON T1.PostId = T2.Id WHERE T2.AnswerCount <= 2 AND SUBSTR(T1.CreationDate, 1, 4) = '2010'
Database: codebase_community

Question: When did 'chl' cast its first vote in a post?
Evidence: DisplayName = 'chl'; cast its first vote refers to MIN(CreationDate);
SQL (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.CreationDate FROM users T1 INNER JOIN votes T2 ON T1.Id = T2.UserId WHERE T1.DisplayName = 'chl' ORDER BY T2.CreationDate NULLS FIRST FETCH FIRST 1 ROWS ONLY

Question: What is the display name of the user who acquired the first Autobiographer badge?
Evidence: Autobiographer is the name of the badge; acquired the first refers to MIN(Date);
SQL (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T1.DisplayName FROM users T1 INNER JOIN badges T2 ON T1.Id = T2.UserId WHERE T2."NAME" = 'Autobiographer' ORDER BY T2."DATE" NULLS FIRST FETCH FIRST 1 ROWS ONLY

Question: Among the users located in United Kingdom, how many users whose post have a total favorite amount of 4 or more?
Evidence: favorite amount of 4 or more refers to FavoriteCount > = 4; Location = 'United Kingdom';
SQL (SQLite): 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
SQL (SQL Server): SELECT COUNT(T1.Id) AS _agg1 FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE T1.Location = 'United Kingdom' AND T2.FavoriteCount >= 4
SQL (Oracle): SELECT COUNT(T1.Id) FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId WHERE T1.Location = 'United Kingdom' AND T2.FavoriteCount >= 4

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 (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.Id, T2.Title FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId WHERE T1.DisplayName = 'Harvey Motulsky' ORDER BY T2.ViewCount DESC NULLS LAST FETCH FIRST 1 ROWS ONLY
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 2010 refers to MAX(FavoriteCount) where year(CreationDate) = 2010;
SQL (SQLite): 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
SQL (SQL Server): SELECT T2.OwnerUserId, T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId WHERE YEAR(T1.CreationDate) = '2010' ORDER BY T2.FavoriteCount DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.OwnerUserId, T1.DisplayName FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId WHERE SUBSTR(T1.CreationDate, 1, 4) = '2010' ORDER BY T2.FavoriteCount DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

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 (SQLite): 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
SQL (SQL Server): SELECT TRY_CAST(SUM(IIF(YEAR(T2.CreaionDate) = '2011' AND T1.Reputation > 1000, 1, 0)) AS FLOAT) * 100 / COUNT(T1.Id) AS _agg1 FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId
SQL (Oracle): SELECT CAST(SUM(CASE WHEN SUBSTR(T2.CreaionDate, 1, 4) = '2011' AND T1.Reputation > 1000 THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(T1.Id) FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId

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 (SQLite): 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'
SQL (SQL Server): 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'
SQL (Oracle): SELECT T2.ViewCount, T3.DisplayName FROM postHistory T1 INNER JOIN posts T2 ON T1.PostId = T2.Id INNER JOIN users T3 ON T2.LastEditorUserId = T3.Id WHERE T1.Text = 'Computer Game Datasets'
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 (SQLite): 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
SQL (SQL Server): SELECT COUNT(T2.Id) AS _agg1 FROM posts AS T1 INNER JOIN comments AS T2 ON T1.Id = T2.PostId GROUP BY T1.Id ORDER BY MIN(T1.Score) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT COUNT(T2.Id) FROM posts T1 INNER JOIN comments T2 ON T1.Id = T2.PostId GROUP BY T1.Id ORDER BY MIN(T1.Score) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

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 (SQLite): 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
SQL (SQL Server): 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 OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
SQL (Oracle): SELECT T3.Text, T1.DisplayName FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments T3 ON T2.Id = T3.PostId WHERE T2.Title = 'Analysing wind data with R' ORDER BY T1.CreationDate DESC NULLS LAST FETCH FIRST 10 ROWS ONLY

Question: Among all the posts posted by the most influential user, identify the percentage with a score above 50.
Evidence: 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));
SQL (SQLite): 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
SQL (SQL Server): SELECT TRY_CAST(SUM(CASE WHEN T2.Score > 50 THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(T1.Id) AS _agg1 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
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T2.Score > 50 THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(T1.Id) FROM users T1 INNER JOIN posts T2 ON T1.Id = T2.OwnerUserId INNER JOIN ( SELECT MAX(Reputation) max_reputation FROM users ) T3 ON T1.Reputation = T3.max_reputation
Database: codebase_community

Question: What is the excerpt post ID and wiki post ID of the tag named sample?
Evidence: tag named sample refers to TagName = 'sample';
SQL (SQLite): SELECT ExcerptPostId, WikiPostId FROM tags WHERE TagName = 'sample'
SQL (SQL Server): SELECT ExcerptPostId, WikiPostId FROM tags WHERE TagName = 'sample'
SQL (Oracle): SELECT ExcerptPostId, WikiPostId FROM tags WHERE TagName = 'sample'

Question: Give the user's reputation and up vote number of the user that commented "fine, you win :)".
Evidence: Text = 'fine, you win :)';
SQL (SQLite): 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 :)'
SQL (SQL Server): 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 :)'
SQL (Oracle): SELECT T2.Reputation, T2.UpVotes FROM comments T1 INNER JOIN users T2 ON T1.UserId = T2.Id WHERE T1.Text = 'fine, you win :)'

Question: Among the posts with views ranging from 100 to 150, what is the comment with the highest score?
Evidence: views ranging from 100 to 150 refers to ViewCount BETWEEN 100 and 150; comment with the highest score refers to Text where MAX(Score);
SQL (SQLite): SELECT Text FROM comments WHERE PostId IN ( SELECT Id FROM posts WHERE ViewCount BETWEEN 100 AND 150 ) ORDER BY Score DESC LIMIT 1
SQL (SQL Server): SELECT Text FROM comments WHERE PostId IN ( SELECT Id FROM posts WHERE ViewCount BETWEEN 100 AND 150 ) ORDER BY Score DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT Text FROM comments WHERE PostId IN ( SELECT Id FROM posts WHERE ViewCount BETWEEN 100 AND 150 ) ORDER BY Score DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: In posts with 1 comment, how many of the comments have 0 score?
Evidence: in posts with 1 comment refers to CommentCount = 1;
SQL (SQLite): 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
SQL (SQL Server): SELECT COUNT(T1.id) AS _agg1 FROM comments AS T1 INNER JOIN posts AS T2 ON T1.PostId = T2.Id WHERE T2.CommentCount = 1 AND T2.Score = 0
SQL (Oracle): SELECT COUNT(T1.id) FROM comments T1 INNER JOIN posts T2 ON T1.PostId = T2.Id WHERE T2.CommentCount = 1 AND T2.Score = 0

Question: Among the comments with scores between 5 to 10, what is the percentage of the users with 0 up votes?
Evidence: percentage = DIVIDE(COUNT(UserId where UpVotes = 0 and Score BETWEEN 5 and 10))*100, (COUNT(UserId where Score BETWEEN 5 and 10));
SQL (SQLite): 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
SQL (SQL Server): SELECT TRY_CAST(SUM(IIF(T1.UpVotes = 0, TRY_CAST(1 AS FLOAT), 0.0)) AS FLOAT) * 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
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T1.UpVotes = 0 THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100/ COUNT(T1.Id) per FROM users T1 INNER JOIN comments T2 ON T1.Id = T2.UserId WHERE T2.Score BETWEEN 5 AND 10