Storing numbers as CHAR where no calculation will ever happen
Hello everyone, I guess this is more of a best practice question. When you have data which contains numbers that will never be used for any aggregation should you store them as an INT or CHAR? An example would be userID - 1234 (this will always be a number). Thanks in advance
If the data is a true number then I would use the relevant numeric datatype, i.e. INT, but if the data looks like a number but isn't e.g. 0123 - storing this as int would lose the leading 0 - then I would store as character. That's just driven by the efficiencies of storing/handling integers over character data.