MySQL數據庫:註釋及數據類型

註釋

/* 多行註釋 */
# 單行註釋
-- 單行註釋(注意:兩個但橫線後面必須加空格)

數據類型

1.整形

​ tinyint、smallint、mediumint、int、bigint
​ 小整數值 大整數值 大整數值 大整數值 極大整數值mysql

2.浮點型

​ float、doublesql

3.小數型

​ decimal (經常使用:保證數據不丟失)
​ 如:100.32-----》decimal(5,2)code

4.字符型

1.char
2.varchar
3.text
4.blob
5.enum 枚舉 (多選一)
6.set (多選多)ci

5.日期和時間

1.year
2.date
3.time
4.datetime(5.5沒有)
5.timestamp 時間戳class

空值 null 作爲賦值能夠用 = 做爲條件用is null進行判斷date

非空 is not null 判斷非空條件數據類型

相關文章
相關標籤/搜索