MySQL中tinytext、text、mediumtext和longtext详解

来源:互联网 发布:红蜘蛛电脑调色软件 编辑:程序博客网 时间:2024/06/03 05:24

一、字符串类型

类型
范围
说明
 Char(N) [ binary]N=1~255 个字节
binary :分辨大小写固定长度std_name cahr(32) not nullVarChar(N) [binary]N=1~255 个字节
binary :分辨大小写可变长度std_address varchar(256)TinyBlob最大长度255个字节(2^8-1)

Blob (Binary large objects)储存二进位资料,且有分大小写

memo text not nullTinyText最大长度255个字节(2^8-1)Blob最大长度65535个字节(2^16-1) Text最大长度65535个字节(2^16-1)MediumBlob最大长度 16777215 个字节(2^24-1)MediumText最大长度 16777215 个字节(2^24-1LongBlob最大长度4294967295个字节 (2^32-1)LongText最大长度4294967295个字节 (2^32-1)Enum集合最大数目为65535列举(Enumeration),Enum单选、Set复选sex enum(1,0)
habby set(‘玩电玩’,'睡觉’,'看电影’,'听音乐’)Set集合最大数目为64

辨別Null与Not Null :Null为允许储存空值(Null)

二、数字/数值类型

类型
范围
说明
例如
TinyInt[M] [UNSIGNED]-128~127
UNSIGNED : 0~255 num tinyint unsignedSmallInt[M] [UNSIGNED]-32768~32767
UNSIGNED :0~ 65535  MediumInt[M] [UNSIGNED]-8388608~8388607
UNSIGNED :0~16777215  Int[M] [UNSIGNED]-2^31~2^31-1
UNSIGNED : 0~2^32  BigInt[M] [UNSIGNED]-2^63~2^63-1
UNSIGNED : 0~2^64  Float [(M,D)]

-3.4E+38~3.4E+38( 约 )

注: M 为长度, D 为小数,Float 4 bytes,Double 8 bytes Double [(M,D)]-1.79E+308~1.79E+308( 约 )Decimal [(M,D)] 

辨別ZeroFill:当宣告关键字ZeroFill为自动填满0,如 000021

三、日期时间类型

类型
范围
说明
Date日期(yyyy-mm-dd) Time时间(hh:mm:ss) DateTime日期与时间組合(yyyy-mm-dd hh:mm:ss) TimeStampyyyymmddhhmmss Year

年份yyyy

 
阅读全文
0 0
原创粉丝点击