图书管理系统素材.zip
立即下载
资源介绍:
图书管理系统素材.zip
create database if not exists db_book charset utf8;
use db_book;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '用户id',
`userName` varchar(20) NOT NULL COMMENT '用户名',
`password` varchar(20) NOT NULL COMMENT '密码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into user values(1,'admin','123');
CREATE TABLE `booktype` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '图书类别id',
`bookTypeName` varchar(20) NOT NULL COMMENT '图书类别名称',
`bookTypeDesc` varchar(1000) DEFAULT NULL COMMENT '图书类别描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into booktype values
(1,'计算机编程类','编程类相关书籍'),
(2,'绘本','儿童图书');
CREATE TABLE `book` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '图书id',
`bookName` varchar(20) NOT NULL COMMENT '图书名称',
`author` varchar(20) NOT NULL COMMENT '作者',
`press` varchar(20) NOT NULL COMMENT '出版社',
`price` float NOT NULL COMMENT '价格',
`bookDesc` varchar(1000) DEFAULT NULL COMMENT '图书描述',
`bookTypeId` int NOT NULL COMMENT '图书类别id',
PRIMARY KEY (`id`),
KEY `fk_id` (`bookTypeId`),
CONSTRAINT `fk_id` FOREIGN KEY (`bookTypeId`) REFERENCES `booktype` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;