SQL DataType - Suja-dot/Database GitHub Wiki

Most Common Data Types

Numeric

INT

  • a normal sized integer that can be signed or unsigned

FLOAT(M,D)

  • M is display length, D is the number of decimal
  • cannot be unsigned

DOUBLE(M,D)

  • cannot be unsigned

Date and Time

DATA

  • YYYY-MM-DD format

DATETIME

  • YYYY-MM-DD HH:MM:SS format

TIMESTAMP

  • calculated from midnight, January 1, 1970

TIME

  • Stores the time in HH:MM:SS format

String

CHAR

  • Fixed-length character string, Size is specified in parenthesis. Max 255 bytes

VARCHAR

  • Variable-length character string, Max size is specified in parenthesis

BLOB

  • "Binary Large Object", used to store large amounts of binary data, such as images or other types of files

TEXT

  • large amount of text data