Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report