UNSIGNED removes the sign bit from supported numeric column types so the full storage space represents zero or positive values. For example, an INT normally ranges from -2,147,483,648 to 2,147,483,647. Declared as INT UNSIGNED, it instead ranges from 0 to 4,294,967,295. The attribute is most common on AUTO_INCREMENT primary keys, counters, monetary amounts, and any measurement that can never be negative.UNSIGNED can be applied to TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, DECIMAL, and NUMERIC. It is ignored on floating-point types (FLOAT, DOUBLE) in MySQL 8.0+ and prohibited on non-numeric types. You can add or drop the attribute with CREATE TABLE or ALTER TABLE ... MODIFY/CHANGE. Attempting to insert or update a negative value into an UNSIGNED column triggers error 1264 (Out of range value for column).Other major databases do not implement UNSIGNED; instead, use a larger data type or check constraints. Because of this, schema migrations from MySQL to PostgreSQL or SQL Server must translate UNSIGNED columns carefully.
#VALUE!
MySQL 3.23
MySQL raises error 1264 (Out of range value) and rejects the row because negative numbers violate the UNSIGNED constraint.
No. Storage size is identical to the signed equivalent. The difference lies only in how the bit pattern is interpreted.
Yes. Using UNSIGNED on an AUTO_INCREMENT primary key is common because the sequence never needs negative values.
Change the target column to a larger signed type (e.g., BIGINT) or add a CHECK constraint like CHECK (col >= 0) to enforce non-negativity.