Is it a good idea to use an integer column for storing US ZIP codes in a database?

A numeric ZIP code is — in a small way — misleading.

Numbers should mean something numeric. ZIP codes don’t add or subtract or participate in any numeric operations. 12309 – 12345 does not compute the distance from downtown Schenectady to my neighborhood.

Granted, for ZIP codes, no one is confused. However, for other number-like fields, it can be confusing.

Since ZIP codes aren’t numbers — they just happen to be coded with a restricted alphabet — I suggest avoiding a numeric field. The 1-byte saving isn’t worth much. And I think that that meaning is more important than the byte.


Edit.

“As for leading zeroes…” is my point. Numbers don’t have leading zeros. The presence of meaningful leading zeros on ZIP codes is yet another proof that they’re not numeric.

Leave a Comment