mysql データ型の最小値と最大値

数値型 最小値 最大値
tinyint -128 127
tinyint(unsigned) 0 255
smallint -32768 32767
smallint(unsigned) 0 65535
mediumint -8388608 8388607
mediumint(unsigned) 0 16777215
int -2147483648 2147483647
int(unsigned) 0 4294967295
bigint -9223372036854775808 9223372036854775807
bigint(unsigned) 0 18446744073709551615
decimal decimal(整数の桁数,小数点の桁数)で指定。
日付型 最小値 最大値
date 1000-01-01 9999-12-31
datetime 1000-01-01 00:00:00 9999-12-31 23:59:59
time -838:59:59 838:59:59
timestamp 1970-01-01 00:00:00 2037-12-31 23:59:59
year(yyyy) 1901 2155
year(yy) 1970 2069
文字列型 最小値 最大値
char 255 Byte
varchar 255 Byte
tinytext 255 Byte
text 65535 Byte
mediumtext 16777215 Byte
longtext 4294967295 Byte
enum(data1,data2,… 65535個
set(data1,data2,… 64セット

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です