chapter查寻数据(Chapter search data)

chapter查寻数据(Chapter search data)

ID:42479428

大小:49.50 KB

页数:19页

时间:2019-09-15

chapter查寻数据(Chapter search data)_第1页
chapter查寻数据(Chapter search data)_第2页
chapter查寻数据(Chapter search data)_第3页
chapter查寻数据(Chapter search data)_第4页
chapter查寻数据(Chapter search data)_第5页
资源描述:

《chapter查寻数据(Chapter search data)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、chapter2查寻数据(Chapter2searchdata)SinglelinenotesMultilinecomment/**/Thefirststep:createdatabaseniitdb/*Databasefilecontains:Masterdatafile:niitdb.mdfLogfile:niitdb_log.ldfThesecondstepistoseparatedatabase,adddatabase,backupandrestoredatabaseEstablishingD:Da

2、tsbaseThirdsteps:CreatestudenttableStuNoStuNameagesexaddressCommondatatypes:Values:int1,2,3............Shortnumericaltype:smallIntLongnumericaltype:bigIntDecimalpoint(floatingpoint,singleprecision):float-->3.14Doubleprecision:double-->3.1415926533348Charact

3、ertype:char-->'a','b','1'String:string-->"abkei""Sql:structuredquerylanguage(structquerylanguage)Server:(service)P1.4Businessproceduresmayhavethreeelements…………*/--executetheSQLstatement--1,usingdatabaseGrammar:--usedatabase--goExample:UseniitdbGoSelect*From

4、StudentAsetofcustomcolumns,columnchart,headerinformation(threekinds)--selectcolumnnames1,columnnames2,columnnames3,...Namesn--fromtablenameSelectStuNoas'ID','name'address''=StuNameaddressFromdbo.Student-two,connectorcharactersSelectStudent.StuNO,Student.Stu

5、Name,'',Student.sex'='descriptionofgender:FromStudentINTturnsintoCHAR:convertfunctionSelectStuName+'age:'+CONVERT(char(4),age)+'old'+'as'description'address:'+addressFromStudentSelectStuName+'age:'+CONVERT(char(4),age)+'old'+'minus10yearsafter'+CONVERT(char

6、(4),age-10)+'as'description'address:'+addressFromStudentAnynumberandratioofnumericalvalues,theresultisitself.SelectStuName+'age:'+CONVERT(char(4),age%300)+'old'+'as'description'address:'+addressFromStudentSelectspecificrows--1,comparisonoperatorNotequalto<>

7、=!Select*fromStudentwhereage=30Select*fromStudentwhereage>30--2,arithmeticoperator-+-*/%/*3,logicaloperatorNotandandor/ornegativeSelect*fromStudentWhereStuName='jordan'andage<40Select*fromStudentWhereStuName='jordan'orStuName='Yao'--4,rangevalue-between....

8、and...Select*fromStudentWhereagebetween30and50--5,isnullisnotnullSelect*fromStudentWhereaddressisnull--6,in,notinSelect*fromStudentWhereStuNOin('N001','N003','N005')-insteadofStuNO='N001'orStuNo='N003'

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。