What is the difference between int and integer in MySQL 5.0?
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.