SQL
x
#count IdeaLab ideas created per month by community
SELECT EXTRACT(YEAR FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `year`,
EXTRACT(MONTH FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `month`,
COUNT(rev_id) AS ideas_created_by_Community
FROM metawiki_p.revision r
INNER JOIN metawiki_p.page AS p
ON r.rev_page = p.page_id
INNER JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
WHERE p.page_namespace = 200
AND cl.cl_to IN ("IdeaLab/Ideas/IdeaLab")
AND r.rev_user_text NOT LIKE "%(WMF)" #not a standard staff account
AND r.rev_user_text NOT IN ("Ijon", "FuzzyBot", "Wolliff") #not a non-standard staff account OR User:FuzzyBot
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
#count IdeaLab ideas created per month total
SELECT EXTRACT(YEAR FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `year`,
EXTRACT(MONTH FROM DATE_FORMAT(rev_timestamp,'%Y%m%d%H%i%s')) AS `month`,
COUNT(rev_id) AS ideas_created_total
FROM metawiki_p.revision r
INNER JOIN metawiki_p.page AS p
ON r.rev_page = p.page_id
INNER JOIN metawiki_p.categorylinks AS cl
ON p.page_id = cl.cl_from
WHERE p.page_namespace = 200
AND cl.cl_to IN ("IdeaLab/Ideas/IdeaLab")
AND r.rev_parent_id = 0
GROUP BY `year`, `month`
ORDER BY `year` ASC, `month` ASC;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.