转php面试题有我的答案(九A)
来源:互联网 发布:重庆时时彩计划软件 编辑:程序博客网 时间:2024/05/21 13:30
sorry, 本人未能理解每种图书,是指图书类别,还是一个图书,具体的有多本。
/**//*==============================================================*/
/**//* DBMS name: MySQL 4.0 */
/**//* Created on: 2007-10-25 20:43:34 */
/**//*==============================================================*/
drop table if exists book;
drop table if exists bookDetail;
drop table if exists lend;
drop table if exists user;
/**//*==============================================================*/
/**//* Table: book ,包括图书的一些具体信息 */
/**//*==============================================================*/
create table book
(
b_id int unsigned not null AUTO_INCREMENT,
b_name varchar(100) not null,
b_author varchar(30) not null,
b_desc text,
b_price dec(10,2) not null,
b_isbn varchar(30) not null,
primary key (b_id)
)
type = InnoDB;
/**//*==============================================================*/
/**//* Table: bookDetail ,包括唯一编号,图书编号,入库日期,入库人 */
/**//*==============================================================*/
create table bookDetail
(
bd_id int unsigned not null AUTO_INCREMENT,
b_id int unsigned,
db_inTime datetime not null,
db_inUser int not null,
primary key (bd_id)
)
type = InnoDB;
/**//*==============================================================*/
/**//* Index: "fk_Book_Detail_FK" */
/**//*==============================================================*/
create index fk_Book_Detail_FK
(
b_id
);
/**//*==============================================================*/
/**//* Table: lend 借阅信息,借出日期,借阅天数,实际归还的日期 */
/**//*==============================================================*/
create table lend
(
u_id int unsigned,
bd_id int unsigned,
l_date date,
l_backdate date,
l_days int unsigned
)
type = InnoDB;
/**//*==============================================================*/
/**//* Index: "fk_user_lend_FK" */
/**//*==============================================================*/
create index fk_user_lend_FK
(
u_id
);
/**//*==============================================================*/
/**//* Index: "fK_book_lend_FK" */
/**//*==============================================================*/
create index fK_book_lend_FK
(
bd_id
);
/**//*==============================================================*/
/**//* Table: user 用户具体表 */
/**//*==============================================================*/
create table user
(
u_id int unsigned not null AUTO_INCREMENT,
u_name varchar(30) not null,
u_phone varchar(30),
u_address varchar(200),
u_booknum int unsigned not null,
primary key (u_id)
)
type = InnoDB;
alter table bookDetail add constraint fk_BookType_Book foreign key (b_id)
references book (b_id) on delete restrict on update restrict;
alter table lend add constraint FK_fK_book_lend foreign key (bd_id)
references bookDetail (bd_id) on delete restrict on update restrict;
alter table lend add constraint FK_fk_user_lend foreign key (u_id)
references user (u_id) on delete restrict on update restrict;
/**//* DBMS name: MySQL 4.0 */
/**//* Created on: 2007-10-25 20:43:34 */
/**//*==============================================================*/
drop table if exists book;
drop table if exists bookDetail;
drop table if exists lend;
drop table if exists user;
/**//*==============================================================*/
/**//* Table: book ,包括图书的一些具体信息 */
/**//*==============================================================*/
create table book
(
b_id int unsigned not null AUTO_INCREMENT,
b_name varchar(100) not null,
b_author varchar(30) not null,
b_desc text,
b_price dec(10,2) not null,
b_isbn varchar(30) not null,
primary key (b_id)
)
type = InnoDB;
/**//*==============================================================*/
/**//* Table: bookDetail ,包括唯一编号,图书编号,入库日期,入库人 */
/**//*==============================================================*/
create table bookDetail
(
bd_id int unsigned not null AUTO_INCREMENT,
b_id int unsigned,
db_inTime datetime not null,
db_inUser int not null,
primary key (bd_id)
)
type = InnoDB;
/**//*==============================================================*/
/**//* Index: "fk_Book_Detail_FK" */
/**//*==============================================================*/
create index fk_Book_Detail_FK
(
b_id
);
/**//*==============================================================*/
/**//* Table: lend 借阅信息,借出日期,借阅天数,实际归还的日期 */
/**//*==============================================================*/
create table lend
(
u_id int unsigned,
bd_id int unsigned,
l_date date,
l_backdate date,
l_days int unsigned
)
type = InnoDB;
/**//*==============================================================*/
/**//* Index: "fk_user_lend_FK" */
/**//*==============================================================*/
create index fk_user_lend_FK
(
u_id
);
/**//*==============================================================*/
/**//* Index: "fK_book_lend_FK" */
/**//*==============================================================*/
create index fK_book_lend_FK
(
bd_id
);
/**//*==============================================================*/
/**//* Table: user 用户具体表 */
/**//*==============================================================*/
create table user
(
u_id int unsigned not null AUTO_INCREMENT,
u_name varchar(30) not null,
u_phone varchar(30),
u_address varchar(200),
u_booknum int unsigned not null,
primary key (u_id)
)
type = InnoDB;
alter table bookDetail add constraint fk_BookType_Book foreign key (b_id)
references book (b_id) on delete restrict on update restrict;
alter table lend add constraint FK_fK_book_lend foreign key (bd_id)
references bookDetail (bd_id) on delete restrict on update restrict;
alter table lend add constraint FK_fk_user_lend foreign key (u_id)
references user (u_id) on delete restrict on update restrict;
- 转php面试题有我的答案(九A)
- 转php面试题及我的答案(九)
- 转php面试题及我的答案(一)
- 转php面试题及我的答案(二)
- 转php面试题及我的答案(三)
- 转php面试题及我的答案(四)
- 转php面试题及我的答案(五)
- 转php面试题及我的答案(六)
- 转php面试题及我的答案(七)
- 转php面试题及我的答案(八)
- C++面试题(有我做的答案,参考)
- 我遇到的面试题(附答案)
- GOOGLE面试题--我的答案
- .net面试题大全(有答案)
- .net面试题大全(有答案)
- .Net面试题大全(有答案)
- J2eEE面试题(有答案)
- .Net面试题大全(有答案)
- 常见日志文件和常用命令(from cu)
- T-SQL中的时间表示
- Bug Report
- C# WebService Delphi 客户端编程入门
- Linux常用操作集锦
- 转php面试题有我的答案(九A)
- Linux知识点滴
- 全美笑话排行前八名
- 今天啊
- 正则表达式
- Unicode 转义字符的溃败
- Linux操作系统中使用技巧集锦
- 编写优秀Bug报告的艺术及案例分析
- od -- octal dump 八进制输出文件内容