Home > Database > Mysql Tutorial > body text

mysql中int bigint smallint和tinyint的长度_MySQL

WBOY
Release: 2016-06-01 13:38:42
Original
1708 people have browsed it

bitsCN.com


mysql中int bigint smallint和tinyint的长度

 

int    

 

int 从 -2^31 (-2,147,483,648) 到 2^31 – 1 (2,147,483,647) 的整型数据(所有数字),存储大小为 4 个字节,int 的 SQL-92 同义字为 integer。

 

如果勾选了属性unsigned(无符号=>正数)则是2^31*2+1(2147483647*2+1=4294967295)的10位整型数据,存储大小为 4个字节。

 

mediumint

 

如果勾选了属性unsigned(无符号=>正数)则是(8388607*2+1=16777215)8位整型数据,存储大小为 2 个字节。

 

smallint

 

从 -2^15 (-32,768) 到 2^15 – 1 (32,767) 的整型数据,存储大小为 2 个字节。

 

如果勾选了属性unsigned(无符号=>正数)则是2^15*2+1(32767*2+1=65535)6位整型数据,存储大小为 2 个字节。

 

tinyint

 

从 0 到 255 的整型数据。存储大小为 1 字节。
 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template