Yes I did use VARCHAR(32) for both date and time. I know I shouldn’t. But for the purpose of this query, please feel free to change.
And how would I structure the SQL query if I wanted monthly tally. Like each month and the hits for that month? Is that simpler or harder?
Here are few insert statements so that you can populate the table.
INSERT INTO vtble VALUES(NULL, '04-10-2010', '00:03:57', '94.23.211.138', 'United Kingdon', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','http://www.codingpoint.co.uk/portfolio.php');
INSERT INTO vtble VALUES(NULL, '04-10-2010', '00:04:57', '94.23.211.138', 'France', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','http://www.codingpoint.co.uk/contact.php');
INSERT INTO vtble VALUES(NULL, '08-10-2010', '10:03:17', '94.23.211.138', 'United Kingdon', 'Mozilla/5.0 (compatible; YandexBot/3.0; MirrorDetector; +http://yandex.com/bots)','index.php','http://www.codingpoint.co.uk/');
INSERT INTO vtble VALUES(NULL, '08-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '10-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '10-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '12-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '12-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '13-10-2010', '12:04:50', '90.23.211.10', 'United Kingdon', 'page_test [email]larbin2.6.3@unspecified.mail','index.php[/email]','unknown');
INSERT INTO vtble VALUES(NULL, '15-10-2010', '12:04:50', '95.108.150.235', 'Russian Federation', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '17-10-2010', '19:01:00', '85.25.124.132', 'Germany', 'Linguee Bot (http://www.linguee.com/bot; [email]bot@linguee.com)','index.php[/email]','unknown');
INSERT INTO vtble VALUES(NULL, '17-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '15-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '18-10-2010', '11:01:00', '85.25.124.132', 'Germany', 'Mozilla/5.0 (compatible; YandexBot/3.0; MirrorDetector; +http://yandex.com/bots)','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '19-10-2010', '01:08:00', '207.25.124.130', 'Canada', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '24-10-2010', '12:18:00', '85.25.124.132', 'Germany', 'Linguee Bot (http://www.linguee.com/bot; [email]bot@linguee.com)','index.php[/email]','unknown');
INSERT INTO vtble VALUES(NULL, '26-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '27-10-2010', '11:01:00', '207.46.199.37', 'United States', 'Mozilla/5.0 (compatible; YandexBot/3.0; MirrorDetector; +http://yandex.com/bots)','index.php','unknown');
INSERT INTO vtble VALUES(NULL, '26-10-2010', '08:11:00', '207.46.199.30', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','www.spdu.info');
INSERT INTO vtble VALUES(NULL, '27-10-2010', '09:12:10', '207.46.166.130', 'United States', 'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.6.30 Version/10.63','index.php','www.spdu.info');