1 DROP DATABASE IF EXISTS dblms; /*未建库前,删除原库中的dblms*/ 2 3 CREATE DATABASE dblms DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; /*新建数据库*/ 4 5 USE dblms;/*进入数据库*/
1 DROP TABLE IF EXISTS `lms_bookinfo`;/*未建表前,删除原库中的重名的表*/ 2 3 CREATE TABLE `lms_bookinfo` ( 4 `ISBN` VARCHAR(50) NOT NULL , /*图书ISBN*/ 5 `book_name` VARCHAR(50) NOT NULL, /*书名*/ 6 `book_category` VARCHAR(50) NOT NULL, /*书籍类别*/ 7 `author` VARCHAR(50) NOT NULL, /*作者*/ 8 `description` TEXT, /*简介*/ 9 `publisher` TEXT, NOT NULL , /*出版社*/ 10 `disabled` TINYINT(4) DEFAULT NULL, 11 `entertime` TIMESTAMP NOT NULL, DEFAULT CURRENT_TIMESTAMP, 12 PRIMARY KEY (`brand_id`) 13 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; 14 15 LOCK TABLES `ms_brand` WRITE; 16 INSERT INTO `ms_brand` VALUES ('字段A的值','字段B的值','字段C的值',....),('字段A的值','字段B的值',....),()........ 17 UNLOCK TABLES;