SQL Data Types and Operators
Explore the main SQL data types such as numeric, date, and character strings, and understand how SQL operators function in conditions. This lesson helps you comprehend essential SQL elements used in query construction and data manipulation.
SQL data types
A SQL data type is an attribute that specifies the type of data of any object. You can specify the data type of each column in the table based on your requirements.
Some of them are listed below:
Exact Numeric Data Types
| Data Type | Ranges From | To |
|---|---|---|
| int | -2,147,483,648 | 2,147,483,647 |
| bigint | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
| smallint | -32,768 | 32,767 |
| tinyint | 0 | 255 |
| bit | 0 | 1 |
| decimal | -10^38 +1 | 10^38 -1 |
| numeric | -10^38 +1 | 10^38 -1 |
Approximate Numeric Data Types
| Data Type | Ranges From | To |
|---|---|---|
| float |