I'm using Postgres as the database management system.
Currently, I have a countries
table, which has only four countries, i.e. four rows (might add one or two more countries, i.e. rows, later).
--Table 1: countries
id
country_name
I have many tables, referencing to this countries
table.
--Table 2: events
name
country_id
date
--Table 3: servers
server_name
country_id
--Table 4: packages
package_name
country_id
The problem is whenever I want a country name, I wanted to join the countries
table with other table and make the query to get the country_name
value(s).
As the countries
table is "static" with only four country rows, should I create a column named country_name
in the tables 2, 3, 4 and save the country value as a string, as this will get rid of the countries
table and also will get rid of all Joins in my query?
Kindly advice what is the correct approach when dealing with "static" names.
countries
table have acountry_id
column? I assume yes, but I'd prefer to hear it from you. Please edit your question and add the details. Thanks.