Created
January 21, 2020 09:04
-
-
Save SerendipityNL/f4f91371034216a72fbadf361d3078c3 to your computer and use it in GitHub Desktop.
To calculate and plot the average amount of queries per pageview per month
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
-- Upload to https://chart-studio.plot.ly/create | |
SELECT | |
`date`, | |
`amount` / `pageviews` AS `queries_per_page` | |
FROM | |
`log_queries`; | |
SELECT | |
`date`, | |
AVG(`amount` / `pageviews`) AS `queries_per_page` | |
FROM | |
`log_queries` | |
GROUP BY | |
MONTH(`date`), YEAR(`date`) | |
ORDER BY | |
`date` ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment