借书、还书的触发器怎么写?
create table BOOKINFO (
BOOKNO varchar(20) not null,
BOO_BOOKTYPENO varchar(10) not null,
BOOKNAME varchar(50) not null,
BOOKAUTHOR varchar(20) not null,
BOOKINDATE date not null,
BOOKISBN varchar(15) not null,
BOOKPRICE numeric(50),
constraint PK_BOOKINFO primary key (BOOKNO)
);
create table BOOKTYPE
(
BOOKTYPENO varchar(10) not null,
BOOKTYPENAME varchar(50) not null,
constraint PK_BOOKTYPE primary key (BOOKTYPENO)
);
create table BORROW_RETURNINFO
(
REA_READNO varchar(15) not null,
BOO_BOOKNO varchar(20) not null,
BORROWDATE date,
RETURNDATE date,
constraint PK_BORROW_RETURNINFO primary key clustered (REA_READNO, BOO_BOOKNO)
);
create table BUYBOOK
(
PUB_PUBLISHNO varchar(10) not null,
BOO_BOOKNO varchar(20) not null,
QUANTITY numeric(50),
constraint PK_BUYBOOK primary key clustered (PUB_PUBLISHNO, BOO_BOOKNO)
);
create table PUBLISHINFO
(
PUBLISHNO varchar(10) not null,
PUBLISHNAME varchar(50) not null,
PUBLISHADDRE varchar(50),
PUBLISHZIPCODE varchar(7),
PUBLISHPHONE varchar(11),
constraint PK_PUBLISHINFO primary key (PUBLISHNO)
);
create table READINFO
(
READNO varchar(15) not null,
REA_READTYPENO varchar(10) not null,
READNAME varchar(30) not null,
READSEX varchar(4),
READDATE date,
READPHONE varchar(11),
READCONDITION varchar(4),
constraint PK_READINFO primary key (READNO)
);
create table READTYPE
(
READTYPENO varchar(10) not null,
READTYPENAME varchar(50) not null,
BOOKNUMBER numeric,
BOOKDAY numeric,
constraint PK_READTYPE primary key (READTYPENO)
);