Files
exam-jyt/数据库脚本.sql
T
2026-06-17 21:32:18 +08:00

79 lines
3.6 KiB
SQL

drop table t_sjxxb;
-- 书籍信息表
create table t_sjxxb(
id varchar(32) not null comment 'ID'
primary key,
isbn varchar(13) not null comment 'ISBN书号',
b_name varchar(100) comment '书名',
b_type varchar(4) comment '图书类型',
b_price varchar(10) comment '价格',
b_author varchar(100) comment '作者',
b_publisher varchar(100) comment '出版商',
b_publication_time datetime comment '出版日期',
b_num int(11) comment '库存数量',
b_not_return_num int(11) comment '未归还数量',
b_path varchar(100) comment '封面图片oss地址',
b_introduce text comment '介绍',
b_lend_num int(11) comment '借阅次数',
b_state int(2) comment '状态0正常 1失效',
create_time datetime comment '首次记录时间',
update_time datetime comment '最后更新时间'
);
drop table t_jhxxb;
-- 借还信息表
create table t_jhxxb(
id varchar(32) not null comment 'ID'
primary key,
user_id varchar(32) not null comment '用户id',
b_id varchar(32) not null comment '书id',
state varchar(2) comment '借还状态0 待归还 1已归还',
exceed_state varchar(2) comment '是否逾期,0未逾期 1 逾期',
start_time datetime comment '借阅时间',
end_time datetime comment '应归还时间',
return_time datetime comment '实际归还时间',
create_time datetime comment '首次记录时间',
update_time datetime comment '最后更新时间'
);
CREATE TABLE IF NOT EXISTS `t_gonggao` (
`id` varchar(32) NOT NULL,
`name` varchar(50) NOT NULL COMMENT '发布人',
`title` varchar(200) NOT NULL COMMENT '公告标题',
`text` varchar(200) NOT NULL COMMENT '公告内容',
`create_time` date NOT NULL COMMENT '发布时间',
`update_time` date NOT NULL COMMENT '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公告表';
--
-- 转存表中的数据 `t_gonggao`
--
INSERT INTO `t_gonggao` (`id`, `name`, `title`, `text`, `create_time`, `update_time`) VALUES
('1632988376099491841', '系统管理员', 'tt', '11', '2023-03-07', '2023-03-07');
-- --------------------------------------------------------
--
-- 表的结构 `t_liuyan`
--
CREATE TABLE IF NOT EXISTS `t_liuyan` (
`id` varchar(32) NOT NULL,
`userid` varchar(32) NOT NULL COMMENT '发布人',
`itemname` varchar(100) NOT NULL COMMENT '使用昵称',
`text` varchar(200) NOT NULL COMMENT '留言内容',
`create_time` date NOT NULL COMMENT '发布时间',
`update_time` date NOT NULL COMMENT '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言信息表';
--
-- 转存表中的数据 `t_liuyan`
--
INSERT INTO `t_liuyan` (`id`, `userid`, `itemname`, `text`, `create_time`, `update_time`) VALUES
('1632991267640061953', '10001', '1', '2', '2023-03-07', '2023-03-07'),
('1633007276212166658', '1627315399204634625', '1123123', '1231232133', '2023-03-07', '2023-03-07');