Skip to content

Instantly share code, notes, and snippets.

@methbkts
Last active September 5, 2019 12:16
Show Gist options
  • Select an option

  • Save methbkts/78e6f5f886c9c603803588c4bf86b57c to your computer and use it in GitHub Desktop.

Select an option

Save methbkts/78e6f5f886c9c603803588c4bf86b57c to your computer and use it in GitHub Desktop.

Numbers :

type description range length exemple
tinyint -128 to 127 (0-255) 28
smallint -32768 to 32767 (0-65535) 216
mediumint -8388608 to 8388607 (0-16777215) 224 ---
int -2147483648 to 2147483647 (0-4294967295) 232 ---
bigint -9223372036854775808 to 9223372036854775807 (0-18446744073709551615) 264 ---
decimal store exact numeric values, best for business uses --- --- ---
float --- --- --- ---
double --- --- --- DOUBLE(5,2) -> 123.45

Date & Hours :

  • date
  • datetime
  • timestamp
  • time
  • year

Strings :

  • char
  • varchar
  • tinytext
  • text
  • mediumtext
  • longtext
  • json

Lists :

  • enum
  • set

Binaries :

  • bit
  • binary
  • varbinary
  • tinyblob
  • blob
  • mediumblob
  • longblob

Geometry :

  • geometry
  • point
  • linestring
  • polygon
  • multipoint
  • multilinestring
  • multipolygon
  • geometrycollection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment