首页 新闻 搜索 专区 学院

某客运公司的运输管理系统

-1
悬赏园豆:5 [待解决问题]

create database chap2;
use chap2;
create table qcjbxxb (
cph varchar(50) primary key,
qczl varchar(50),
zdzkl varchar(50),
bc varchar(50),
s_name varchar (50)
);
create table cpxxb (
cpbh varchar(50) primary key,
czcs int,
pj int,
bch varchar(50),
yszw int,
yp int,
cfsj varchar(50),
cfd varchar(50),
mdd varchar(50),
glxm varchar(50)
);
create table bcxxb (
bch varchar(50) primary key,
cfd varchar(50),
mdd varchar(50),
cfsj varchar(50),
dzsj varchar(50),
czcs int,
glyxm varchar(50)
);
create table ckxxb (
ckxm varchar(50)primary key,
cpbh varchar(50),
xb varchar(50),
csrq varchar(50)
);
create table czb (
bch varchar(50)primary key,
cfd varchar(50),
mdd varchar(50),
cfsj varchar(50),
dzsj varchar(50),
cph varchar(50),
ckxm varchar(50)
);
create table sjxxb (
s_name varchar(50)primary key,
xb varchar(50),
csrq varchar(50),
jszh varchar(50),
sj varchar(50)
);
create table kyzgly (
glyxm varchar(50),
mm nchar(10)
);
create table xtgly (
dlm nchar(10),
mm nchar(10)
);
create view view_
as select dbo.bcxxb.mdd,dbobcxxb.bch,dbo.bcxxb.cfd,dbo.bcxxb.glyxm,dbo.qcxxb.cph,dbo.qcxxb.qczl,dbo.sjxxb.s_name
from dbo.bcxxb
inner join dbo.qcxxb
on dbo.bcxxb.bch=dbo.qcjbxxb.bch
inner join dbo.sjxxb
on dbo.qcxxb.s_name=dbo.sjxxb.s_name;
SET ansi_nulls on
go
set quoted_identifier on
go
alter trigger[dbo].[c]
on[dbo].[ckxxb]for insert
as
if exists(select*from dbo.ckxxb,dbo.cpxxb where dbo.cpxxb.cpbh=dbo.ckxxb.cpbh)
begin
update dbo.cpxxb
set yszw=yszw+1,yp=yp-1
where cpbh=(select cpbh from inserted)
end
crytckxx
insert into dbo.ckxxb
values('陆的','00006','男','1993');
set ansi_nulls on
go
set quoted_identifier on
go
alter trigger [dbo].[b]
on [dbo].[czb] for insert
as
if exists(select*from dbo.czb,dbo.bcxxb where dbo.bcxxb.bxh=dbo.czb.bch)
begin
update dbo.bxxxb
set czcs=czcs+1
where bch=(select bch from inserted)
end
crytczxx
insert into dbo.czb
values('0006','洛阳','西安','14;00','19;00','011','陆平');

 

 这是我的程序代码 


有几处错误我不知道怎么修改 
我忒忙的主页 我忒忙 | 初学一级 | 园豆:28
提问于:2016-06-19 11:40
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册