Get the App
SLTechnology News&Howtos  ›  Database  › 

Usage and Application of MySQL INT,TINYINT,SMALLINT,BIGINT

Shulou Source: shulou.com Published: 2022-06-01 10:57:36 09月21日 Update

MySQL INT,TINYINT,SMALLINT,BIGINT usage and application, MySQL supports all standard SQL integer types INTEGER, INT, and SMALLINT. In addition, MySQL provides TINYINT, MEDIUMINT,BIGINT as an extension of the standard SQL, which is usually used as the primary key of a table because the integer type represents an exact number. In addition, INT columns can have the AUTO_INCREMENT attribute.

1, value range

2, use

So it is usually used as the primary key id of the table

You can also use foreign keys, time, sorting, etc.

USE huthondb

CREATE TABLE items (

Iid INT AUTO_INCREMENT PRIMARY KEY

Text VARCHAR (255)

);

Note that MySQL provides an extension that allows you to specify the display width and the INT data type. The display width is enclosed in parentheses after the INT keyword, for example, INT (10) specifies an INT with a display width of five digits. The maximum is 11

Article from (www.huthon.com)

Tags: Width type integer standard often application maximum exact digit key keyword attribute parenthesis number data article time purpose range sort Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info OPPO Reno Shulou Information macOS