帮帮看我的表建的有问题吗
时间:2011-11-17
来源:互联网
SQL code
drop table request; drop table requesttype; drop table requesttemplate; drop table user; drop table usertype; --创建用户类型表 create table usertype ( id int(5) primary key not null, name varchar(10) not null ); --创建用户表 create table user ( id int(5) primary key not null, username varchar(20) not null, userpwd varchar(20) default 'abc123_', email varchar(30), roleid int(5) , reportmanagerid int(5), foreign key(reportmanagerid) references user(id), foreign key(roleid) references usertype(id) ); --创建请求模板 create table requesttemplate ( id int(5) primary key not null, summary varchar(100) not null, reason varchar(100) not null, forwhomid int(5) not null, preferredtime Date not null, steps varchar(600) not null, foreign key(forwhomid) references user(id) ); commit; --请求类型表 create table requesttype ( id int(5) primary key not null, name varchar(30) not null, templateid int(5) not null, engineervisible boolean , foreign key(templateid) references requesttemplate(id) ); --创建请求表 create table request ( id int(10) primary key not null, requesterid int(5) not null, requestdate date not null, requesttypeid int(5) not null, executorid int(5), approveddate date, title varchar(50) not null, contentid int(5) not null, status int(5), foreign key(contentid) references requesttemplate(id), foreign key(requesterid) references user(id), foreign key(requesttypeid) references requesttype(id), foreign key(executorid) references user(id) ); commit; --插入请求模板 insert into requesttemplate values(1,'do not limit the download', 'we all need software to update ourselves', 1, '2011-11-17', '1.release to the download for a short time; 2.watch out for the situation; 3.if there is no any problem we can go through it'); insert into requesttemplate values(2,'update the hardware', 'we all need best hardware to work better', 2, '2011-11-20', '1.update a part of computer; 2.watch out for the situation; 3.if there is no any problem we can go through it'); insert into requesttemplate values(3,'do not limit the website access', 'we all need more resources to work', 3, '2011-11-23', '1.release a part of the website access; 2.watch out for the situation; 3.if there is no any problem we can go through it'); commit; --插入请求类型 insert into requesttype(id,name,templateid) values(1,'Software Download',1); insert into requesttype(id,name,templateid) values(2,'Hardware Issue',2); insert into requesttype(id,name,templateid) values(3,'Website Access',3); commit; --插入用户类型 insert into usertype values(1,'Engineer'); insert into usertype values(2,'ITManager'); insert into usertype values(3,'Admin'); insert into usertype values(4,'SDM'); insert into usertype values(5,'ITStaff'); commit; --插入用户 insert into user(id,username,userpwd) values(1,'awl','123'); insert into user(id,username,userpwd) values(2,'irwin','1123'); insert into user(id,username,userpwd) values(3,'harris','123'); insert into user(id,username,userpwd) values(4,'好人','123'); commit;
作者: awl910213 发布时间: 2011-11-17
你想问什么呢?
作者: litiebiao2012 发布时间: 2011-11-18
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28