INTEGER (often written INT) is a fixed-precision signed whole-number data type defined by the SQL standard. It stores values without decimals, typically using 4 bytes of storage, giving a range of −2,147,483,648 to 2,147,483,647 in two-complement implementations. Some vendors provide UNSIGNED or ZEROFILL modifiers, but these are extensions and not portable.INTEGER is part of the broader numeric family that includes SMALLINT, BIGINT, and DECIMAL. Choosing INTEGER instead of larger or smaller types affects storage, performance, and overflow risk. In table definitions, INTEGER can have optional constraints such as PRIMARY KEY, NOT NULL, CHECK, or AUTO_INCREMENT/IDENTITY (vendor specific). Casting between INTEGER and other numeric types is allowed but truncates fractions.Because INTEGER is exact (not approximate like FLOAT), it is preferred for counts, identifiers, and any value that must remain integral. Be aware of overflow: inserting a number outside the supported range raises an error or silently wraps, depending on the database.
INT, SMALLINT, BIGINT, DECIMAL, NUMERIC, SERIAL, IDENTITY, AUTO_INCREMENT, CAST
SQL-86
Most databases allocate 4 bytes, but some allow configurable sizes while keeping the INTEGER keyword.
The SQL standard does not define UNSIGNED. MySQL and MariaDB add an UNSIGNED modifier that disallows negative values and doubles the positive range.
Choose BIGINT if the counter can exceed the 32-bit limit, or add a CHECK constraint to catch near-overflow values early.
No. Use DECIMAL or NUMERIC with an explicit scale to maintain precision for currency calculations.