You are on page 1of 2

My SQL server data types and their purposes

Data types Purposes


char Character string, fixed length.
Varchar Variable length character string, maximum length fixed.
clob A Character Large OBject (or CLOB) is a collection of character data in
a database management system, usually stored in a separate location that
is referenced in the table itself.
NCHAR National character type is the same as character except that it holds
standardized multibit characters or Unicode characters.
NCHAR VARYING National character varying type is the same as character varying except
that it holds standardized multibit characters or Unicode characters.
NCLOB NCLOB type is the same as CLOB except that it holds standardized
multibit characters or Unicode characters.
BOOLEAN Stores truth values - either TRUE or FALSE.
BLOB BLOB stores a long sequence of bytes.
INTEGER Represents an integer
SMALLINT Same as INTEGER type except that it might hold a smaller range of
values, depending on the DBMS.
BIGINT Same as INTEGER type except that it might hold a larger range of
values, depending on the DBMS.
NUMERIC Exact numerical, precision p, scale s. The maximum precision depends
on the DBMS.
FLOAT Approximate numerical, mantissa precision p. Precision is greater than
or equal to 1 and the maximum precision depends on the DBMS.
REAL Same as FLOAT type except that the DBMS defines the precision.
DOUBLE Same as FLOAT type (DBMS defines the precision) but greater than
PRECISION that of REAL.
DATE Represents a date. Format : yyyy-mm-dd
TIME WITHOUT Represents a time of day without time zone. Format : hh:mm:ss
TIME ZONE
TIME WITH TIME Represents a time of day with time zone. Format : yyyy-mm-dd AT
ZONE TIME ZONE -06:00.
TIMESTAMP Represents a combination of DATE and TIME values separated by a
WITHOUT TIME space. Format : yyyy-mm-dd hh:mm:ss
ZONE
TIMESTAMP Represents a combination of DATE and TIME values separated by a
WITH TIME ZONE space with time zone. Format : yyyy-mm-dd hh:mm:ss AT TIME
ZONE -06:00.
Year-month Includes no fields other than YEAR and MONTH, though not both are
required.
Day-time Includes any fields other than YEAR or MONTH. These intervals can
contain a day value, hour value, minute value, second value, or some
combination thereof.
DECIMAL Exact numerical, precision p, scale s. A decimal number, that is a
number that can have a decimal point in it.

You might also like