数据库 用 T-SQL语句完成下列题目

2024-12-18 00:04:43
推荐回答(1个)
回答1:

  1. create table s

    (sno char(9) primary key,sname char(20),sage smallint,ssex char(2))

  2. select cno,cname from c where teacher='刘强'

  3. select sno,sname from s where sage<22 and ssex='女'

  4. select * from s where sname like '刘%'

  5. alter table s add sdept char(20)

  6. alter table sc add constraint CK_stugrade check (grade between 0 and 100)

  7. insert into s(sno,sname,sage,ssex)

    values('001','张三',19,'男')

  8. update s set sdept='水利水电工程' where ssex='女'

  9. delete from s

  10. drop table s