发布网友
共1个回答
热心网友
表没问题,刚才我都跑了一遍
你问题的两个结果,第一个没问题,第二个没测试,但是创建成功,有问题自己调试一下吧
1
select c.cn,s.sno,s.sn from
s,c,sc where s.sno=sc.sno and c.CNO=sc.cno and c.CNO in
(select cno from tc where tno=(select tno from t where tn='张兰'))
2
Create Trigger tcno
On C
for Update
As
if Update(CNO)
begin
Update TC Set CNO=i.CNO From TC ,Inserted i Where TC.CNO=i.CNO
Update SC Set CNO=i.CNO From SC ,Inserted i Where SC.CNO=i.CNO
end追问CREATE TABLE S (A1 char(2) not null , A2 tinyint, A3 money)
语句建表的话 A1设为主键 A2默认值为1 在上面的基础上麻烦帮我改一下
还有A1后面还用不用加not null?
追答CREATE TABLE S (a1 char(2) not null primary key,
a2 tinyint not null default 1,
a3 money)
有主键必须not null
比如a3那种就可有可无了