I want to store Zip Code (within United States) in MySQL database. Saving space is a priority. which is better option using VARCHAR - limited
There are a few problems with storing a zip code as a numeric value.
12345-6789
. You cannot store a dash in a numeric datatype.I would store a zip code as a varchar(5)
or varchar(10)
.
As a side note, I am not sure why you would select varchar(6)
, do you have a reason for selecting an unusual length when standard zip codes are 5 or 10 with the extension?