When should I use UNSIGNED and SIGNED INT in MySQL?

后端 未结 8 859
后悔当初
后悔当初 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:02

    Basically with UNSIGNED, you're giving yourself twice as much space for the integer since you explicitly specify you don't need negative numbers (usually because values you store will never be negative).

提交回复
热议问题