What is the difference between int and integer in MySQL 5.0?

I guess the only difference is the spelling.

So by using INT, you'd end up using less bytes on your SQL script (not that it matters).


According to the MySQL documentation :

The keyword INT is a synonym for INTEGER

but if you want to write SQL scripts compatible with ANSI SQL use INTEGER. According to the specification :

SQL defines distinct data types named by the following keywords: CHARACTER, CHARACTER VARYING, BIT, BIT VARYING, NUMERIC, DECIMAL, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION, DATE, TIME, TIMESTAMP, and INTERVAL.

In this way, you will have better chance to use your SQL scripts on other DBMS. For example PostgresSQL have an INTEGER type but no INT type.


Taken from MYSQL 5.0 online reference

The keyword INT is a synonym for INTEGER.