In regard to static data table design. Having static data in tables like shown:
- Currencies (Code, Name). Row example: USD, United States Dollar
- Countries (Code, Name). Row example: DE, Germany
- XXXObjectType (Code, Name, ... additional attributes)
- ...
does it make sense to have another (INTEGER) column as a Primary Key so that all Foreign Key references would use it?
Possible solutions:
- Use additional INTEGER as PK and FK
- Use Code (usually CHAR(N), where N is small) as PK and FK
- Use Code only if less then certain size... What size?
- Other
_______
What would be your suggestion? Why?
I usually used INT IDENTITY
columns, but very often having the short code is good enough to show to the user on the UI, in which case the query would have one JOIN less.