標籤:default create data com values 作用 python div class
bigint支援的數位大小範圍為:19位,存電話號碼。有符號範圍:-9223372036854775808 到 9223372036854775807
int支援的數字範圍為:10位,有符號範圍:-2147483648 到 2147483647 無符號範圍:0-4294967295
mysql> create table c5(id bigint);
Query OK, 0 rows affected (0.04 sec)
mysql> insert into c5 values(23434);
Query OK, 1 row affected (0.01 sec)
mysql> insert into c5 values(44444444444444423434);
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> insert into c5 values(444444444444444444444444444444444444444444423434);
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> insert into c5 values(444444444444444444444444444444444444444444423434444444444444444444444444444);
Query OK, 1 row affected, 1 warning (0.00 sec)
插入一個大的數值並不報錯,但實際存到表裡面的資料就是19位元字支援的最大數字
mysql> select * from c5;
+---------------------+
| id |
+---------------------+
| 23434 |
| 9223372036854775807 |
| 9223372036854775807 |
| 9223372036854775807 |
+---------------------+
4 rows in set (0.00 sec)
mysql> select count(*) from c5;
+----------+
| count(*) |
+----------+
| 4 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from c5\G
*************************** 1. row ***************************
count(*): 4
1 row in set (0.00 sec)
mysql> select * from c5\G
*************************** 1. row ***************************
id: 23434
*************************** 2. row ***************************
id: 9223372036854775807
*************************** 3. row ***************************
id: 9223372036854775807
*************************** 4. row ***************************
id: 9223372036854775807
4 rows in set (0.00 sec)
mysql>
那麼comment的作用是什麼呢? 字面上的意思 備忘 , 查看設計表就知道了。
show create table 表名;
CREATE TABLE `tests` ( `id` bigint(20) NOT NULL COMMENT ‘ID‘, `tenant_it` bigint(20) NOT NULL COMMENT ‘租戶ID‘) ENGINE=InnoDB DEFAULT CHARSET=utf8
python基礎_MySQL的bigint類型