Skip to content

Instantly share code, notes, and snippets.

@czwen
Last active August 13, 2020 06:58
Show Gist options
  • Save czwen/f2d58418c3ef362556b0a6c7f6a5825e to your computer and use it in GitHub Desktop.
Save czwen/f2d58418c3ef362556b0a6c7f6a5825e to your computer and use it in GitHub Desktop.
mysql data types
DATA TYPE SPEC DATA TYPE SPEC
CHAR String (0 - 255) INT Integer (-2147483648 to 214748-3647)
VARCHAR String (0 - 255) BIGINT Integer (-9223372036854775808to 9223372036854775807)
TINYTEXT String (0 - 255) FLOAT Decimal (precise to 23 digits)
TEXT String (0 - 65535) DOUBLE Decimal (24 to 53 digits)
BLOB String (0 - 65535) DECIMAL "DOUBLE" stored as string
MEDIUMTEXT String (0 - 16777215) DATE YYYY-MM-DD
MEDIUMBLOB String (0 - 16777215) DATETIME YYYY-MM-DD HH:MM:SS
LONGTEXT String (0 - 4294967295) TIMESTAMP YYYYMMDDHHMMSS
LONGBLOB String (0 - 4294967295) TIME HH:MM:SS
TINYINT Integer (-128 to 127) ENUM One of preset options
SMALLINT Integer (-32768 to 32767) SET Selection of preset options
MEDIUMINT Integer (-8388608 to 8388607) BOOLEAN TINYINT(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment