Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Yahya
.
Toggle Highlighting
SQL
USE bnwiki_p; SELECT SUBSTR(rev_timestamp, 1, 7) AS Month, -- Extracts year and month (YYYY-MM) COUNT(DISTINCT page_id) AS New_pages_this_month FROM page, revision WHERE page_id = rev_page AND page_namespace = 0 -- Main namespace AND rev_parent_id = 0 -- New page, not a revision of another page AND page_is_redirect = 0 -- Excludes redirects AND rev_timestamp >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) -- Last 1 year GROUP BY SUBSTR(rev_timestamp, 1, 7) -- Group by Year-Month ORDER BY SUBSTR(rev_timestamp, 1, 7); -- Total count of new pages over the last year SELECT COUNT(DISTINCT page_id) AS Total_new_pages_last_year FROM page, revision WHERE page_id = rev_page AND page_namespace = 0 -- Main namespace AND rev_parent_id = 0 -- New page, not a revision of another page AND page_is_redirect = 0 -- Excludes redirects AND rev_timestamp >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR); -- Last 1 year
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...