This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT all_votes.created_date , google_votes.votes as google_votes, all_votes.votes as all_votes, (google_votes.votes / all_votes.votes*100) as google_share | |
| FROM | |
| ( | |
| SELECT DATE(`wiki_helpfulvote`.`created`) as created_date, count(*) as votes | |
| FROM `wiki_helpfulvote` | |
| WHERE `wiki_helpfulvote`.`created` BETWEEN "2012-08-01 0" AND "2013-10-03 0" | |
| GROUP BY DATE(`wiki_helpfulvote`.`created`) | |
| ) as all_votes | |
| JOIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT positive_helpfulvotes.docID as documentID, positive_helpfulvotes.docTitle, positive_helpfulvotes.votes, all_helpfulvotes.votes, (positive_helpfulvotes.votes/all_helpfulvotes.votes*100) as helpful_votes | |
| FROM | |
| ( | |
| SELECT `wiki_document`.`id` as docID, `wiki_document`.`title` as docTitle, count(*) as votes | |
| FROM `wiki_helpfulvote` | |
| JOIN `wiki_revision` ON `wiki_helpfulvote`.`revision_id`=`wiki_revision`.`id` | |
| JOIN `wiki_document` ON `wiki_revision`.`document_id`=`wiki_document`.`id` | |
| WHERE `wiki_helpfulvote`.`created` BETWEEN '2013-09-01 0' AND '2013-10-01 0' | |
| AND `wiki_document`.`locale` = 'en-US' | |
| AND `wiki_helpfulvote`.`helpful` ='1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT positive_search_votes.date_created as created_date, positive_search_votes.votes, all_search_votes.votes, (positive_search_votes.votes/all_search_votes.votes*100) as helpful_votes | |
| FROM | |
| ( | |
| SELECT DATE(`wiki_helpfulvote`.`created`) as date_created, count(*) as votes | |
| FROM `wiki_helpfulvote` | |
| JOIN `wiki_revision` ON `wiki_helpfulvote`.`revision_id`=`wiki_revision`.`id` | |
| JOIN `wiki_document` ON `wiki_revision`.`document_id`=`wiki_document`.`id` | |
| WHERE `wiki_helpfulvote`.`created` BETWEEN '2012-07-01 0' AND '2013-10-01 0' | |
| AND ( | |
| `wiki_document`.`id` = "817" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DATE(`wiki_revision`.`created`), count(distinct(`wiki_revision`.`creator_id`) | |
| FROM `wiki_revision` | |
| WHERE `wiki_revision`.`created` > "2013-07-01 0" | |
| AND `wiki_revision`.`created` < "2013-08-01 0" | |
| GROUP BY DATE(`wiki_revision`.`created`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT * | |
| FROM `questions_question` | |
| WHERE `questions_question`.`created` > "2013-06-25 0" | |
| AND `questions_question`.`created` < "2013-07-10 0" | |
| AND `questions_question`.`locale` LIKE "en-US" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT `wiki_document`.`id`, `wiki_revision`.`created` , `wiki_document`.`slug`, `wiki_document`.`title` | |
| From `wiki_document` | |
| JOIN `wiki_revision` ON `wiki_revision`.`id`=`wiki_document`.`current_revision_id` | |
| WHERE `wiki_revision`.`created` < '2012-07-12' | |
| AND `wiki_document`.`locale` LIKE "en-US" | |
| AND (`wiki_document`.`category` = "10" OR `wiki_document`.`category` = "20") | |
| AND `wiki_document`.`is_archived` = "0" | |
| AND `wiki_revision`.`is_approved` = "1" | |
| AND `wiki_revision`.`content` NOT LIKE "REDIRECT%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT `wiki_revision`.`summary`, DATEDIFF(`wiki_revision`.`reviewed`,`wiki_revision`.`created`) | |
| FROM `wiki_revision` | |
| JOIN `wiki_document` ON `wiki_document`.`id`=`wiki_revision`.`document_id` | |
| WHERE `wiki_document`.`locale` LIKE 'en-US' | |
| AND `wiki_revision`.`created` >= '2013-01-01' | |
| AND DATEDIFF(`wiki_revision`.`reviewed`,`wiki_revision`.`created`) >=30; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DATE(`questions_question`.`created`), count(*) | |
| FROM `questions_question` | |
| WHERE DATE(`questions_question`.`created`) > '2012-12-01' | |
| GROUP BY DATE(`questions_question`.`created`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Shows number users registering per day | |
| SELECT DATE(`auth_user`.`date_joined`), count(*) | |
| FROM `auth_user` | |
| WHERE DATE(`auth_user`.`date_joined`) > '2012-12-01' | |
| GROUP BY DATE(`auth_user`.`date_joined`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT username, count(distinct(document_id)) as reveditnum | |
| FROM | |
| ( | |
| SELECT username, document_id | |
| FROM wiki_revision wr | |
| JOIN auth_user au ON wr.creator_id = au.id | |
| JOIN wiki_document wd ON wr.document_id = wd.id | |
| WHERE created > '2012-10-24' and created <= '2013-04-24' | |
| AND wd.locale = 'en-US' | |
| UNION |