What are the Data types in SQL?

Sql, Data Types

  • Numeric data types such as int, tinyint, bigint, float, real, etc.
  • Date and Time data types such as Date, Time, Datetime, etc.Date and Time data types such as Date, Time, Datetime, etc.
  • Character and String data types such as char, varchar, text, etc.
  • Unicode character string data types, for example nchar, nvarchar, ntext, etc.
  • Binary data types such as binary, varbinary, etc.
  • SMALLINT - 16bit signed integer. Range: -32768 to 32767. Size 2 bytes (native 2s compliment format).
  • INTEGER or INT - 32bit signed integer. Range: (-1 * 2^31) to (2^31–1). Size 4 bytes (native 2s complement format).
  • INT8 - 64bit signed integer. Range: (-1 * 2^63) to (2^63 - 1). Size 10 bytes (proprietary data structure)
  • BIGINT - 64bit signed integer. Range: (-1 * 2^63) to (2^63 - 1). Size 8 bytes (native 2s complement format).
  • SERIAL - INTEGER with auto increment used as a surrogate key.
  • SERIAL8 - INT8 with auto increment used as a surrogate key.
  • BIGSERIAL - BIGINT with auto increment used as a surrogate key.
  • DECIMAL or MONEY - configurable range and precision, floating point or fixed point (integer or fractional) up to 32 decimal digits. Range: -1*10^-31 to 10^31
  • SMALLFLOAT - 32bit IEEE floating point.
  • FLOAT - 64bit IEEE floating point.