I have a principle question regarding definition of a code in a relational database. Let's assume (case 1) we have a code, for example, nationality code:
1
2
...
23
...
125
...
What is the preferred datatype to use for this kind of code (for example INT(3) or VARCHAR(3)?). The range is between 1 and 999.
Now, let's assume we have again a numeric code (case 2) but with fixed length, for example, 4:
2342
3252
2641
...
What would be in this case the appropriate datatype?
In both cases there is no information, that is, the position of a digit has no meaning, the code is just a distinction id.
I would appreciate any comments. Thanks.