2016년 11월 24일 목요일

MySQL Length and Maximum Size by Data Type

TINYINT[n] [UNSIGNED] [ZEROFILL]
: -128 ~ 127 (UNSIGNED then 0 ~ 255)

SMALLINT[n] [UNSIGNED] [ZEROFILL]
: -32768 ~ 32767 (UNSIGNED then 0 ~ 65535)

MEDIUMINT[n] [UNSIGNED] [ZEROFILL]
: -8388608 ~ 8388607 (UNSIGNED then 0 ~ 16777215)

INT[n] [UNSIGNED] [ZEROFILL]
: -2147483648 ~ 2147483647 (UNSIGNED then 0 ~ 4294967295)
: All operations are done with "signed BIGINT". so, if you are outside the range of "signed BIGINT", such as addition multiplication, the value will be wrong.

INTEGER[n] [UNSIGNED] [ZEROFILL]
: -2147483648 ~ 2147483647 (UNSIGNED then 0 ~ 4294967295)

BIGINT[n] [UNSIGNED] [ZEROFILL]
: -9223372036854775808 ~ 9223372036854775807 (UNSIGNED then 0 ~ 18446744073709551615)

FLOAT[n,d] [ZEROFILL]
: -3.402823466E+38 ~ -1.175494351E-38, 0 and
: 1.175494351E-38 ~ 3.402823466E+38
: You can not set unsigned.

DOUBLE[n,d] [ZEROFILL]
: -1.7976931348623157E+308 ~ -2.2250738585072014E-308, 0 and
: 2.2250738585072014E-308 ~ 1.7976931348623157E+308
: You can not set unsigned.

REAL[n,d] [ZEROFILL]
: -1.7976931348623157E+308 ~ -2.2250738585072014E-308, 0 and
: 2.2250738585072014E-308 ~ 1.7976931348623157E+308

DATE
: ‘1000-01-01’ ~ ‘9999-12-31’
: You can not set unsigned.

DATETIME
: ‘1000-01-01 00:00:00’ ~ ‘9999-12-31 23:59:59’

TIMESTAMP[n]
: ‘1970-01-01 00:00:00’ ~ 2037

CHAR(n) [BINARY]
: 1 ~ 255 letters
: If a fixed length and a small length are entered, they are filled in with spaces on the right. If the BINARY keyword is not given, search is case insensitive.

VARCHAR(n) [BINARY]
: 1 ~ 255 letters
: If the BINARY keyword is not given, search is case insensitive.

TINYTEXT
: Max 255 byte

TEXT
: Max 65535 byte

MEDIUMTEXT
: Max 16777215 byte

LONGTEXT
: Max 4294967295 byte

ENUM(‘value1′, ’value2’, …)
: ‘value1’, ‘value2’, …, or NULL can be entered Only. Up to 65535 different values can be entered.

SET(‘value1′, ’value2’, …)
: ‘value1’, ‘value2’, …, or NULL can be entered Only. Up to 64 different values can be entered.

댓글 없음:

댓글 쓰기

ChatGPT 와 AI 미래에 대한 대화, 그리고 감동

우연히 유튜브에서 구글 전 CEO 에릭슈미트가 한 이야기를 보았다. 앞으로 1~2년 사이에 인공지능으로 인해 많은것들이 바뀔것이다. 뭐 이런 이야기는 누구나 할 수 있는 말이다. 책 팔아먹기위해 나온 영상일 수도 있겠지만, 핵심은 영상 뒷부분에 있다....