Dataset for stackoverflow

0

Please login or register to vote for this query.

(click on this box to dismiss)

Latin Language

Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language

SELECT
    DATEPART(YEAR, CreationDate) AS Year,
    DATEPART(MONTH, CreationDate) AS Month,
    COUNT(Id) AS TotalPosts,
    SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions,
    SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers,
    SUM(CASE WHEN PostTypeId = 3 THEN 1 ELSE 0 END) AS Comments,
    SUM(Score) AS TotalScore,
    AVG(Score) AS AvgScore,
    AVG(ViewCount) AS AvgViewCount
FROM
    Posts
WHERE
    CreationDate >= '2019-01-01' AND CreationDate < '2020-01-01' -- Pre-COVID period
    OR (CreationDate >= '2020-01-01' AND CreationDate < '2022-01-01') -- During COVID period
    OR (CreationDate >= '2022-01-01' AND CreationDate < '2023-01-01') -- Post-COVID period
GROUP BY
    DATEPART(YEAR, CreationDate),
    DATEPART(MONTH, CreationDate)
ORDER BY
    Year, Month;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results