- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
chapter3t-sql编程.sql(Chapter3t-sql programming.Sql)
chapter3t-sql编程.sql(Chapter3t-sql programming.Sql)
USE MySchool
GO
/*-- hours 1--*/
/*-- case: find Li Wencai and his adjacent school students --*/
/*-- find Li Wencai information --*/
DECLARE @name nvarchar (50) - student name
SET, @name=, Li Wencai -- using the SET assignment
SELECT, StudentNo, StudentName, BornDate, Address, FROM, Student, WHERE, StudentName = @name
/*-- find Li Wencai adjacent school students --*/
DECLARE @StudentNo int -- student number
SELECT, @StudentNo=StudentNo, from, Student, WHERE, StudentName=@name -- assign with SELECT
SELECT, StudentNo, StudentName, BornDate, Address, FROM, Student, WHERE (StudentNo = @StudentNo+1) or (StudentNo = @StudentNo-1)
/*-- case: output server name, version --*/
PRINT server name: + @@SERVERNAME
SELECT @@SERVERNAME AS server name
PRINTSQL Server version + @@VERSION
SELECT @@VERSION ASSQL Server version
/*-- case: display the new student record, insert or update @ERROR data --*/
INSERT, INTO, Student (StudentName, StudentNo, LoginPwd, GradeId, BornDate, Sex, IdentityCard)
VALUES (` Wu Song , 10011,123456, 1, 1,1980-12-31
If the @@ERROR is greater than 0, it means that the last statement has been executed
Print current error number + convert (varchar (5), @@ERROR)
UPDATE, Student, SET, BornDate=1970-7-8, WHERE, StudentNo=10011
PRINT current error number:+CONVERT (varchar (5), @@ERROR)
GO
/*-- case: use local variables display graphics. The character triangle mosaic (line 5) --*/
DECLARE @tag nvarchar (1)
SET @tag=.
PRINT @tag
PRINT @tag+@tag
PRINT @tag+@tag+@tag
PRINT @tag+@tag+@tag+@tag
PRINT @tag+@tag+@tag+@tag+@tag
/*-- hours 2--*/
/*-- case: query student ID is 12003 students in June 10, 2009 organized by the Java Logic course exam,
Use the Print statement to output the students name and score --*/
DECLARE @NAME varchar (50) - name
DECLARE, @Result, decimal (5,2) -- examination results
DECLARE @NO int
SET @NO = 10000
SELECT @NAME = StudentName, FROM, Student, WHERE, StudentNo=@NO
SELEC
您可能关注的文档
- 2007年公务员年度个人工作总结(Personal work summary of 2007 civil service).doc
- 2007年四川高考理综生物试题解析(2007 Sichuan college entrance examination questions analysis of biological).doc
- 2007年度最成功产品设计(The most successful product design in 2007).doc
- 2007年全国国际货运代理从业人员资格考试(国际货代业务)试卷(2007 National International Freight Forwarders qualification examination (international freight forwarding business) examination paper).doc
- 2007级新生开学典礼发言稿(A speech on the opening ceremony of class 2007 freshmen).doc
- 2008元宵节祝福语(2008 blessings of the Lantern Festival).doc
- 2008年度中国最具竞争力品牌咨询公司20强(2008 China's most competitive brand consulting firm 20).doc
- 2008年东风4型内燃机车乘务员专业知识(2008, Dongfeng 4 type diesel locomotive attendant professional knowledge).doc
- 2008年度工作总结(Summary of work in 2008).doc
- 2007年全国国际货运代理从业人员资格考试(国际货代英语)试卷(2007 National International Freight Forwarders qualification examination (International Freight Forwarding English) test paper).doc
- cf步伐(CF pace).doc
- chinese food translation(中国菜的翻译).doc
- che506(che506).doc
- churchill北美会计审计职业的特点及工资(for cc(Churchill characteristics and salary of North American Accounting and auditing profession (for CC).doc
- c++实例教学(类的应用-02)(C++ example teaching (class application -02)).doc
- cm9软件中英文对照及可删列表(Cm9 software in English, Chinese and delete list).doc
- cnc 编 程 经 验 总 结(CNC programming experience summary).doc
- cnc机床坐标系的确定及工件坐标系(Determination of CNC machine tool coordinate system and workpiece coordinate system).doc
- cnc编程解说(CNC programming commentary).doc
- container procesure(容器的过程).doc
最近下载
- 【0196】82页PPT农业集团企业信息化总体解决方案(豪华版).pptx VIP
- 2025至2030自动焊接机器人系统行业调研及市场前景预测评估报告.docx
- 北师大版(北京)八年级全册物理第七章 热现象单元练习题.doc VIP
- SMTC 5 320 040 与空气接触橡胶材料要求(20130531).pdf VIP
- 酒厂(白酒生产企业)安全生产标准化管理体系全套资料汇编(2019-2020新标准实施模板).doc VIP
- 2024-2025学年八年级物理上册第一章《声现象》单元测试卷(苏科版2024新教材)(含解析).pdf VIP
- 2019年上海科技大学991数据结构与算法硕士研究生考试真题.pdf VIP
- 职业中等学校音乐表演人才培养方案.docx VIP
- 英语 第一册(五年制高职)课件全套 Unit1 A New School---Unit8 Time to Celebrate.pptx
- 四年级数学-课前三分钟讲稿-三角形和四边形-图形稳定性的应用--精品课件.ppt VIP
文档评论(0)