This section will explain how you can analyze or query the stored data to generate some statistics. We will cover the following types of statistics:
How to calculate the page hits from each country
How to calculate the count of each browser
How to calculate the count of each operating system
Run the following command on the MySQL console to calculate the number of hits on a page from each country:
select country, count(*) from apachelog group by country;
The output for the preceding command is as follows:
+---------------------------+----------+ | country | count(*) | +---------------------------+----------+ | Asia/Pacific Region | 9 | | Belarus | 12 | | Belgium | 12 | | Bosnia and Herzegovina | 12 | | Brazil | 36 | | Bulgaria | 12 | | Canada | 218 | | Europe ...