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
BDA2017
.
Toggle Highlighting
SQL
#select * from user ORDER BY RAND() limit 10; #SHOW DATABASES; #select any database to use USE fjwiki_p; #SHOW TABLES; #select any table to describe below #DESCRIBE page; #describe the columns in the table #SELECT AND ORDER #SELECT * FROM page LIMIT 10; #select all columns for the first 10 entries in page table #SELECT * FROM revision ORDER by rev_timestamp LIMIT 10; #SELECT rev_page FROM revision ORDER BY rev_timestamp DESC LIMIT 10; #order rev_page column in order of rev_timestamp #JOIN #SELECT rev_page, page_title, rev_timestamp FROM revision JOIN page ON rev_page = page_id ORDER by rev_timestamp ASC limit 10; #select columns you want in, join two frames on two colums #SELECT rev_page, page_title, rev_timestamp, rev_user, user_name FROM revision JOIN page ON rev_page = page_id JOIN user ON rev_user = user_id ORDER by rev_timestamp ASC LIMIT 10 #double join #COUNT #SELECT COUNT(rev_id) FROM revision WHERE rev_user = "66249"; #GROUP #SELECT COUNT(rev_id) FROM revision GROUP by rev_user LIMIT 10; #SELECT COUNT(rev_id) AS editcounts FROM revision GROUP by rev_user ORDER BY editcounts DESC LIMIT 10; #SELECT COUNT(rev_id) AS editcounts, rev_user, user_name FROM revision JOIN user ON rev_user = user_id GROUP BY rev_user ORDER BY editcounts DESC LIMIT 10; #WHERE NOT LIKE SELECT COUNT(rev_id) AS editcounts, rev_user, user_name, user_registration FROM revision JOIN user ON rev_user = user_id WHERE user_name NOT LIKE "%bot%" AND user_name NOT LIKE "%boT%" AND user_name NOT LIKE "%bOt%" AND user_name NOT LIKE "%Bot%" AND user_name NOT LIKE "%BOt%" AND user_name NOT LIKE "%BoT%" AND user_name NOT LIKE "%bOT%" AND user_name NOT LIKE "%BOT%" GROUP BY rev_user ORDER BY editcounts DESC LIMIT 20;
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...