MySQL中tinytext、text、mediumtext和longtext詳解【轉】

來源:互聯網
上載者:User

標籤:float   3.4   enum   post   ali   rowspan   100%   big   name   

一、數字類型

類型 範圍 說明  
Char(N) [binary] N=1~255 個字元
binary :分辨大小寫
固定長度 std_name cahr(32) not null
VarChar(N) [binary] N=1~255 個字元
binary :分辨大小寫
可變長度 std_address varchar(256)
TinyBlob 最大長度255個字元(2^8-1)

Blob (Binary large objects)儲存二進位資料,且有分大小寫

memo text not null
TinyText 最大長度255個字元(2^8-1)
Blob 最大長度65535個字元(2^16-1)
Text 最大長度65535個字元(2^16-1)
MediumBlob 最大長度 16777215 個字元(2^24-1)
MediumText 最大長度 16777215 個字元(2^24-1)
LongBlob 最大長度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 unsigned
SmallInt[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)  
TimeStamp yyyymmddhhmmss  
Year

年份yyyy

 

MySQL中tinytext、text、mediumtext和longtext詳解【轉】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.