just looking for some general direction/best practice about when to use a lookup value table. Lets say I have a table with transactions/payments in it which has the following columns:
transactions
- transaction_id
- order_id
- amount_paid
- payment_status
- payment_type
Ok lets say payment_type can be one of 3 options ('credit card', 'direct credit', or 'international money transfer'). Currently for every table row this payment_type field is being stored as text. Now is it better to store this value as text or make a lookup table for it and store the foreign key back in the transactions table?
E.g.
payment_type
- payment_type_id
- payment_type_name
transactions
- transaction_id
- order_id
- amount_paid
- payment_status
- payment_type_id
Now my thoughts are this field is tightly coupled with the web application, so if more payment types are added in the future, the application will likely have to change to accommodate it. It would be just as easy to add another payment type as text e.g. 'paypal' or add another entry into the lookup table. The various payment types could be stored within the website code in an array.
The benefits I can see of using the lookup table are less overall data in the database (storing a key rather than text). Disadvantages are maybe slightly slower querying as it has to do another join on the data?
So what's the best practice here?