根据数据表的信息,写出创建这个表的SQL的语句。

如题所述

第1个回答  2014-12-26
create table student
(stuid int not null,
stuname char(10) not null,
stupwd varchar(20) not null)追问

能帮我解答吗?分数全给你了

追答

create table tblstudent
(stuid int not null,
stuname char(10) not null,
stupwd varchar(20) not null)

alter table tblstudent
add primary key(stuid)

create view vw_name_pwd as
select stuname 姓名,stupwd 密码
from tblstudent
前面那个语句我改了一下,表名字写错了。

追问

谢谢!这是三个小题的答案吧 谢谢了!

追答

是的,不谢,你发的图片不太清楚,所以第一次写的时候把表名写错了。
请别忘了采纳

追问

嗯!是的,考试拍照片有点着急。考完了我把分数全给你。谢谢你了!

如果您方便的话,最后请教一个问题

追答

字看不清

追问

追答

update products set UnitPrice=UnitPrice+10
WHERE UnitPrice<500

追问

谢谢你!

最后一题了

要求为数据库创建触发器tri delect

追答

触发器的要求是什么?
我写了一个简单的,因为需求不明。
CREATE TRIGGER tri_delect
ON tblstudent
for delete
AS
print '记录已删除'

追问

实现stuID级联删除功能

题目有两个表

追答

CREATE TRIGGER tri_delect
ON tblstudent
instead of delete
AS
delete from sc where stuid in(select stuid from deleted)

追问

只有两分钟了

追答

CREATE TRIGGER tri_delect
ON tblstudent
instead of delete
AS
delete from tblscore where stuid in(select stuid from deleted)

追问

麻烦您了,可是我已经交卷了

不过真的非常感谢您

追答

不谢。

本回答被提问者采纳
第2个回答  2014-12-26
得分追问

怎么弄?我现在很急在考试,能不能先告诉我?

得分什么的我无所谓多少

相似回答