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
Hermann2020
.
Toggle Highlighting
SQL
#SHOW DATABASES; USE simplewiki_p; SHOW TABLES; #DESCRIBE actor; #name of the table, gives list of all the columns in the table #SELECT * FROM page LIMIT 10 # * means all the columns; from table that is named page; first 10 elements #SELECT page_len FROM page LIMIT 10; #slices down to one column in the particular table #SELECT * FROM revision LIMIT 10; #SELECT * FROM revision ORDER by rev_timestamp LIMIT 10; #SELECT rev_page FROM revision ORDER by rev_timestamp DESC limit 10; #ordered descendingly; Ids of the last 10 pages edited on Wikipedia #SELECT rev_page, page_title, rev_timestamp #FROM revision JOIN page ON rev_page = page_id #ORDER by rev_timestamp ASC limit 10; #want to query from both tables at the same time and want to see first ten, ordered in ascending order #having it from revision table, so can appear multiple times #SELECT * FROM user limit 10; #user is table name #SELECT rev_page, page_title, rev_timestamp, rev_actor, user_name #FROM revision JOIN page ON rev_page = page_id JOIN user ON rev_actor = user_id #ORDER by rev_timestamp ASC limit 10; #joins to tables and want to see the columns which are stated after select #describe revision; #describe page; #why two joins? #SELECT * FROM revision LIMIT 5; #SELECT * FROM revision JOIN page ON rev_page = page_id LIMIT 5; ##SELECT COUNT(rev_id) FROM revision WHERE rev_actor = "66249"; #no of times the specific user has edited the specific wikipedia #number of editors who edited the first version of the Wikipedia of your choice
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...