What is sql data type?
The SQL data types are as follows:

1, binary data type.

Binary data includes binary, Varbinary and Image.

Binary data types can be fixed length or variable length.

Binary[(n)] is n-bit fixed binary data. Where the value range of n is from 1 to 8000. Its storage space is n+4 bytes.

Varbinary[(n)] is n-bit variable-length binary data. Where the value range of n is from 1 to 8000. Its storage space is n+4 bytes, not n bytes.

2. Character data type.

Character data types include char, varchar and text.

Character data is data composed of any combination of letters, symbols and numbers.

Varchar is variable-length character data, with a length of less than 8kb. Char is fixed-length character data with a maximum length of 8kb. ASCII data exceeding 8kb can be stored using text data types.

3.Unicode data type.

Unicode data types include nchar, nvarchar and ntext.

In Microsoft SQL Server, traditional non-unicode data types allow the use of characters defined by a specific character set. During the installation of SQL Server, you are allowed to select a character set.

In the Unicode standard, all characters defined by various character sets are included. Using unicode data types takes up twice as much space as using non-unicode data types.

4. Date and time data type.

Date and time data types include Datetime and Smalldatetime.

The date and time data type consists of valid dates and times.

For example, valid date and time data include "4/01/9812:15: 00: 00 pm" and "1:28: 29:15: 0/kloc".

The previous data types are before date and after time. The latter data types are before time and after date.

In Microsoft SQL Server, when the data types of date and time include Datetime and Smalldatetime, the stored date ranges from 1753 1 to nine thousand nine hundred and ninety-nine1231(each value requires 8 storage bytes).

5. Digital data types.

Digital data contains only numbers. Numeric data types include positive and negative numbers, decimal (floating point) and integer.

Integers consist of positive and negative integers, such as 39, 25, 0-2 and 33967. In Microsoft SQL Server, the data types stored in integers are int, smallint and tinyint.

Int data type stores more data than smallint data type, while smallint data type stores more data than tinyint data type.

The range of using int data type to store data is from -2 147 483 648 to 2 147 483 647 (each value requires four bytes of storage space).

6. Currency data type.

In Microsoft SQL Server, the data types of currency data are Money and Smallmoney.

The Money data type needs 8 storage bytes, and the Smallmoney data type needs 4 storage bytes.

Baidu encyclopedia -SQL data type