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

In the article, you will learn about SIGNED and UNSIGNED integer data types in MySQL. The article provides information about integer types with the ZEROFILL, AUTO_INCREMENT, and display_width attributes, as well as describes examples of when and how to use integer data types. Contents What is MySQL INTEGER SIGNED vs UNSIGNED What is UNSIGNED INT […]

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