1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| DROP TABLE IF EXISTS `websites`; CREATE TABLE `websites` ( id INT(11) NOT NULL AUTO_INCREMENT, name1 CHAR(20) NOT NULL DEFAULT '' COMMENT '站点名称', url VARCHAR(255) NOT NULL DEFAULT '', alexa INT(11) NOT NULL DEFAULT '0' COMMENT 'Alexa 排名', sal DOUBLE COMMENT '广告收入', contry CHAR(10) NOT NULL DEFAULT '' COMMENT '国家', PRIMARY KEY(id) )ENGINE=INNODB DEFAULT CHARSET=UTF8;
INSERT INTO `websites` VALUES (1,'google','https://www.google.cn/','1',2000,'USA'), (2,'淘宝','https://www.taobao.cn/','13',2050,'CN'), (3,'菜鸟教程','https://www.runnoob.cn/','4689',0.0001,'CN'), (4,'微博','https://www.weibo.cn/','20',50,'CN'), (5,'facebook','https://www.facebook.cn/','3',500,'USA'); CREATE TABLE if NOT EXISTS `access_log`( `aid` INT(11) NOT NULL AUTO_INCREMENT, `site_id` INT(11) NOT NULL DEFAULT '0' COMMENT '网站id', `count` INT(11) NOT NULL DEFAULT '0' COMMENT '访问次数', `date` date NOT NULL, PRIMARY KEY(`aid`) )ENGINE=INNODB DEFAULT CHARSET=UTF8; INSERT INTO `access_log`(`aid`, `site_id`,`count`,`date`) VALUES (1, 1, 45, '2016-05-10'), (2, 3, 100, '2016-05-13'), (3, 1, 230, '2016-05-14'), (4, 2, 10, '2016-05-14'), (5, 5, 205, '2016-05-15'), (6, 4, 13, '2016-05-15'), (7, 3, 220, '2016-05-15'), (8, 5, 545, '2016-05-16'), (9, 3, 201, '2016-05-17'), (10, 88, 9999, '2016-09-09');
|