If I try to define a simple table as this:
create table test
(
id integer primary key
);
When I see the table details using the command:describe test, I see that test has an int(11) as type of the attribute id.
I am using mysql 5.5 cluster on Mac os X, I can’t figure the reason of this, how do I declare a single integer? Must I declare it as int(1)? There isn’t another way?
For MySQL,
INT(11)datatype describes a simple column of integers, with a storage size of 4 bytes (see here). The number inside the parenthesis (11in your case) is just a indication of the maximum display width for integer types columns (see here).