When should I use UNSIGNED and SIGNED INT in MySQL?

后端 未结 8 849
后悔当初
后悔当初 2020-12-07 12:45

When should I use UNSIGNED and SIGNED INT in MySQL ? What is better to use or this is just personal prefernce ? Because I\'ve seen it used like this;

id INT         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 13:16

    One thing i would like to add In a signed int, which is the default value in mysql , 1 bit will be used to represent sign. -1 for negative and 0 for positive. So if your application insert only positive value it should better specify unsigned.

提交回复
热议问题