Showing entries 1 to 2
Displaying posts with tag: Zerofill (reset)
MySQL INT (INTEGER) Data Types with Different Examples

This article explains the SIGNED and UNSIGNED integer data types in MySQL and provides examples to illustrate when and how to use these integer data types effectively.

The post MySQL INT (INTEGER) Data Types with Different Examples appeared first on Devart Blog.

What does the 11 mean in INT(11)?

If you create a table using a numeric type like INT or BIGINT, you might have been surprised by the numbers that appear in the table's DESCRIBE:

mysql> CREATE TABLE test(a INT, b SMALLINT, c BIGINT);
Query OK, 0 rows affected (1.04 sec)
mysql> DESCRIBE test;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| a     | int(11)     | YES  |     | NULL    |       |
| b     | smallint(6) | YES  |     | NULL    |       |
| c     | bigint(20)  | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.03 sec)

I didn't put those values 11, 6, and 20 in there. Where did they come from and what are they? They're the columns' "Display Width"

Well, for an integer type (the value in parentheses called the display width of the field. This is …

[Read more]
Showing entries 1 to 2