码迷,mamicode.com
首页 > 数据库 > 详细

mysql tinyint smallint mediumint int bigint

时间:2014-12-02 16:31:02      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:style   blog   ar   color   sp   on   数据   div   log   

 

类型

 存储所占空间

(无论显示多少位)

(单位 字节/bytes)

存储数据范围 最大显示长度
tinyint 1

 -128   ~  127                 signed

   0     ~   255                 unsigned 

 3 

smaillint   2

-32768 ~ 32767              signed

   0       ~  65535            unsigned

5
mediumint 3

-8388608 ~ 8388607       signed

  0  ~ 16777215              unsigned

7      signed

8      unsigned

int 4

-2147483648 ~ 2147483647               signed

0 ~ 4294967295                                 unsigned

11
bigint 8

-9223372036854775808 ~ 9223372036854775807     signed

0   ~   18446744073709551615                                 unsigned

19     signed

20     unsigned

 

 

create   table   mysql_int  (

id               int(11)            primary key      auto_increment,
tinyint_a        tinyint(3)         not null,
smallint_b       smallint           unsigned         not null,
mediumint_c      mediumint(7)       not null,
bigint_d         bigint             unsigned         not null

);

 

 

mysql tinyint smallint mediumint int bigint

标签:style   blog   ar   color   sp   on   数据   div   log   

原文地址:http://www.cnblogs.com/xiaoyueer/p/4137807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!