SQL Data Types With Description

A database table must have a name and a data type for each column.

While building a table, a SQL developer must decide what kind of data will be contained in each column. The data type specifies how SQL will interact with the stored data and serves as a guide for SQL in determining what kind of data is anticipated inside of each column.

SQL Data Type List

INTEGER or INT: In most databases, a whole number (positive or negative) can have a maximum value of 2,147,483,647.

BIGINT : has a maximum value of 9,223,372,036,854,775,807.

SMALLINT: A smaller integer having a common database maximum value of 32,767.

FLOAT or REAL : A floating-point number with a decimal point and up to seven digits of accuracy is referred to as FLOAT or REAL.

DOUBLE PRECISION : A floating-point value having a decimal point and a precision of up to 15 digits is said to have DOUBLE PRECISION.

DECIMAL or NUMERIC : A fixed-point number having a defined accuracy and scale is referred to as DECIMAL or NUMERIC.

CHAR or CHARACTER : A string that has a set length and a given length.

VARCHAR or CHARACTER VARYING : A variable-length string with a predetermined maximum length is known as a VARCHAR or CHARACTER VARYING.

Text that has no maximum length and is changeable in length.

Date :  A date with the characters YYYY-MM-DD.

TIME : The format of a time. HH:MM:SS.

TIMESTAMP : A formatted date and time HH:MM:SS or YYYY-MM-DD.

BOOLEAN or BOOL : A boolean value, commonly expressed as true or false, is referred to as a BOOLEAN or BOOL.

BLOB or BINARY LARGE OBJECT : A binary data object having a predetermined maximum length is known as a BLOB or BINARY LARGE OBJECT.

A big string data object with no stated maximum length is known as a CLOB, or CHARACTER LARGE OBJECT.

In various databases or SQL implementations, these data types may have somewhat different names or attributes. Beyond the ones listed below, certain databases could handle more data types.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories