- SQL Basics
- SQL Home
- SQL Syntax
- SQL RDBMS
- SQL Databases
- SQL Data Types
- SQL Operators
- SQL Expressions
- SQL Database
- SQL Create Database
- SQL Select Database
- SQL Drop Database
- SQL Table
- SQL Create Table
- SQL Drop Table
- SQL Keywords
- SQL Insert Into
- SQL Select
- SQL Where
- SQL And & Or
- SQL Update
- SQL Delete
- SQL Like
- SQL Select Top
- SQL Group By
- SQL Order By
- SQL Distinct
- SQL In
- SQL Between
- SQL Joins
- SQL Joins
- SQL Inner Join
- SQL Left Join
- SQL Right Join
- SQL Full Join
- SQL Constraints
- SQL Constraints
- SQL Unique
- SQL Not Null
- SQL Primary Key
- SQL Foreign Key
- SQL Check
- SQL Default
- SQL Create Index
- SQL Advance
- SQL Aliases
- SQL Union
- SQL Auto Increment
- SQL Views
- SQL Dates
- SQL Transactions
- SQL Injection
- SQL Test
- SQL Online Test
- Give Online Test
- All Test List
SQL Data Types
Data type in SQL, is used to define, what type of value, a column can contain.
SQL Accurate Numeric Data Types
Here, the following table lists all the accurate numeric data types available in SQL:
Data Type | From | To |
---|---|---|
bigint | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
int | -2,147,483,648 | 2,147,483,647 |
smallint | -32,768 | 32,767 |
tinyint | 0 | 255 |
bit | 0 | 1 |
numeric | -1038 +1 | 1038 -1 |
decimal | -1038 +1 | 1038 -1 |
money | -922,337,203,685,477.5808 | +922,337,203,685,477.5807 |
smallmoney | -214,748.3648 | +214,748.3647 |
SQL Approximate Numeric Data Types
The table given below, lists the approximate numeric data types available in SQL:
Data Type | From | To |
---|---|---|
float | -1.79E + 308 | 1.79E + 308 |
real | -3.40E + 38 | 3.40E + 38 |
SQL Date and Time Data Types
The following table lists the date and time data type available in SQL:
Data Type | From | To |
---|---|---|
datetime | Jan 1, 1753 | Dec 31, 9999 |
smalldatetime | Jan 1, 1900 | Jun 6, 2079 |
date | This data type stores a date like June 30, 1991 in SQL | |
time | This data type stores a time of day like 12:30 P.M. in SQL |
SQL Character Strings Data Types
The following table lists the character strings date types available in SQL:
Data Type | Description |
---|---|
char | Maximum length of 8,000 characters.( Fixed length non-Unicode characters) |
varchar | Maximum of 8,000 characters.(Variable-length non-Unicode data). |
varchar(max) | This data type is only for SQL Server 2005. Maximum length of 231 characters, Variable-length non-Unicode data |
text | Variable-length non-Unicode data with a maximum length of 2,147,483,647 characters |
Unicode Character Strings Data Types
Here is the table lists Unicode character strings data type available in SQL:
Data Type | Description |
---|---|
nchar | Maximum length of 4,000 characters (Fixed length Unicode) |
nvarchar | Maximum length of 4,000 characters (Variable length Unicode) |
nvarchar(max) | Maximum length of 231 characters, only for SQL Server 2005 (Variable length Unicode) |
ntext | Maximum length of 1,073,741,823 characters (Variable length Unicode) |
Binary Data Types
Here is the table lists binary data types available in SQL:
Data Type | Description |
---|---|
binary | Maximum length of 8,000 bytes (Fixed-length binary data) |
varbinary | Maximum length of 8,000 bytes (Variable length binary data) |
varbinary(max) | Maximum length of 231 bytes, only for SQL Server 2005 (Variable length Binary data) |
image | Maximum length of 2,147,483,647 bytes (Variable length Binary Data) |
« Previous Tutorial Next Tutorial »
Like/Share Us on Facebook 😋