数据库的数据类型(data type of database)

数据库的数据类型(data type of database)

ID:11486812

大小:42.50 KB

页数:21页

时间:2018-07-12

数据库的数据类型(data type of database)_第1页
数据库的数据类型(data type of database)_第2页
数据库的数据类型(data type of database)_第3页
数据库的数据类型(data type of database)_第4页
数据库的数据类型(data type of database)_第5页
资源描述:

《数据库的数据类型(data type of database)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、数据库的数据类型(Datatypeofdatabase)MySQLdatatypesandcolumntypes1.MySQLdatatypeThereareseveraldatatypesinmysql:(1)numericalValuesarevaluessuchas32or153.4.MySQLsupportsscientificnotation.Scientificnotationconsistsofintegersorfloatsfollowedby"e""Or"e",asymbol("+"or"-")andaninteg

2、erindex.Both1.24e+12and23.47e-1arelegitimatescientifictablesThenumberexpressedbyanotation.And1.24e12isnotlegalbecausetheindexbeforethesymbolisnotgivenAfloatingpointismadeupofanintegerpart,adecimalpoint,andadecimalpart.Theintegerpartandthefractionalpartcanbeempty,butnot

3、atthesametimeForempty.Thenumericalcanputaminussign"-"torepresentanegativevalue.(2)character(string)typeCharactertype(alsocalledstringtype,referredtoasstring)suchas"Hello,world!"or"causedbyaSteamedBunsofmurderthisvalue,Oravaluesuchasphonenumber87398413.Youcanencloseeith

4、erasinglequotationmarkoradoublequotationmarktoenclosethestringvalue.Beginnersoftencan'ttellthedifferencebetweenvalue87398143andstring87398143.It'sallnumbers.Howdoyouusenumericvalues?,Howaboutacharactertype?Thekeyis:thenumerical87398143istoparticipateinthecalculation,fo

5、rexample,itisatotalamountofmoneyinthefinance;Andcharactertype87398143isnotinvolvedinthecalculation,justthatthephonenumber,andsotherearestreetnumbers,housenumbers,andsoon,theyareallNotinvolvedincalculation.(3)dateandtimetype;Dateandtimearevaluessuchas"2006-07-12"or"12:3

6、0:43".MySQLalsosupportsacombinationofdate/time,Suchas"2006-07-1212:30:43"".(4)nullvalueNullrepresentsanunknownvalue.Forexample,fillintheaddressspaceisnotclearnotfillin,thisisthevalueofnull.WecreateatablewiththeCREATETABLEstatement(seetheprevioussection),whichcontainsth

7、edefinitionofcolumns.Forexample,wearethereAtablejokeiscreatedinfrontofwhichtherearetwocolumnscontentandwriter:Createtable(Contentvarchar(20)notnull,Writervarchar(10)null)Definethesyntaxofacolumnasfollows:Col_namecol_typy[col_attributes][general_attributes]Amongthem,col

8、umnnamesaregivenbycol_name.Columnnamescancontainupto64characters,includingletters,numbers,underscores,anddollarsymbol

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

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

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