Consensus? MySQL, Signed VS Unsigned Primary/Foreign Keys Consensus? MySQL, Signed VS Unsigned Primary/Foreign Keys mysql mysql

Consensus? MySQL, Signed VS Unsigned Primary/Foreign Keys


I prefer to set my columns as unsigned if they cannot be negative. Besides the range factor that you mentioned, it also makes it clearer when reading the table definition.


A signed 32-bit int can represent over 2 billion numbers so I suspect the issue is moot for most people. That said, I often use negative numbers when I want to indicate that a record is purposefully orphaned.