I am setting up a MySQL database for accounting software. One of the fields is to save the currency used for each transaction. What field type would you recommend? Details:
- No more than 10 different currencies will be used
- All currencies have three-letter ISO names
- The currency column will sometimes be used in an CASE statement, and sometimes in a WHERE statement
- The table will be quite large so I want to make the optimal choice. Storage size is not an issue. Speed and to a lesser extend ease of use is.
I am considering:
- Using a
char (3)
field and saving the currencies asusd
,cad
, etc. - Using an
enum
field and defining the 10 currencies as options - Using a
tinyint
field and relating this to another database that holds the iso code for each currency. - Using a
tinyint
field and instead of relating a database (and having to do JOINs), I just save the list of very static and non-changing currencies in a PHP array. Saves me some JOINing, but still allows me to usetinyint
.
Anybody any suggestions as to what would be best?