SMALLINT
16-bit signed integer (SMALLINT) is an integer data type used to store integer values ranging from -32,768 to 32,767. This data type occupies two bytes (16 bits) of storage space and is suitable for storing smaller integer values to save storage space.
Syntax
Example
- Create a table with a SMALLINT type column:
- Insert SMALLINT type data into the table:
- Query SMALLINT type data in the table:
Notes
- Please ensure that the inserted data is within the valid range of the SMALLINT type, otherwise it may cause data overflow or truncation.
- When performing mathematical operations, please be aware of implicit conversions between data types to avoid unexpected results.