SQLscript - 副本.doc

  1. 1、本文档共21页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
SQLscript - 副本

Create table S (Sno char(9) primary key, Sname varchar(20) not null, Ssex char(2), Sage smallint, Sdept char(2)) ; Create table C (Cno varchar(2) primary key, Cname varchar(20) not null, Cpno varchar(2), Ccredit smallint) ; Create table SC (Sno char(9), Cno varchar(2), Grade smallint, primary key (Sno, Cno), foreign key (Sno) references S(Sno), foreign key (Cno) references C(Cno) ) ; DESC S; alter table S modify (sname varchar(8)); alter table S drop (sdept); alter table S add (sdept char(2)); drop table SC; drop table S; drop table C; CREATE INDEX S_AGE ON S(SAGE); DROP INDEX S_AGE; INSERT INTO S VALUES(200215121,李勇,男, 20 ,CS); INSERT INTO S VALUES(200215122,刘晨,女, 19 ,CS); INSERT INTO S VALUES(200215123,王敏,女, 18 ,MA); INSERT INTO S VALUES(200215125,张立,男, 19 ,IS); INSERT INTO C VALUES(1,数据库,5, 4); INSERT INTO C VALUES(2,数学,null, 2); INSERT INTO C VALUES(3,信息系统,1,4); INSERT INTO C VALUES(4,操作系统,6,3); INSERT INTO C VALUES(5,数据结构,7,4); INSERT INTO C VALUES(6,数据处理,null,2); INSERT INTO C VALUES(7,PASCAL语言,6,4); INSERT INTO SC VALUES(200215121,1, 92); INSERT INTO SC VALUES(200215121,2, 85); INSERT INTO SC VALUES(200215121,3, 88); INSERT INTO SC VALUES(200215122,2, 90); INSERT INTO SC VALUES(200215122,3, 80); create index sind on s(sage); create unique index sind2 on s(sname desc); drop index sind2 ; select sno , sname from s ; select sname, sno , sdept from s ; select * from s ; select sname, 2012 - sage as birthyear from s ; select sno from sc; select distinct sno from sc; select all sno from sc; select sname from s where sdept= CS; select sname,sage from s where sage20; select sname,sdept,sage from s where sage between 20 and 23 ; select sname,sdept,sage from s where sage not between 20 and 23 ; select sname,sdept,sage from s where sage 20 or sage 23 ; select sname, ssex from s where sdept in (CS, MA, IS) ; select sname, ssex from s where sdept not in (CS, MA, IS) ; select sname, sno,ssex from s where sname like 刘%; select * from c where cname like 数据__ ; sele

文档评论(0)

xxj1658888 + 关注
实名认证
内容提供者

教师资格证持证人

该用户很懒,什么也没介绍

领域认证该用户于2024年04月12日上传了教师资格证

1亿VIP精品文档

相关文档