Let's assume we want to store following data in the relational database: CountryName
, CapitalCityName
, CapitalCityPostCode
. Lets assume that one city has only one post code. We can implement it in one table in a trivial way:
Countries
[PK]CountryId, CountryName, CapitalCityName, CapitalCityPostCode
Or we can arrange it in the more normalized way into 2 tables in 1:1 relation:
Coutries
[PK]CountryId, CountryName, [FK]CapitalCityId
and
CapitalCities
[PK]CapitalCityId, CapitalCityName, CapitalCityPostCode, [FK]CountryId
How will this affect the performance? For example - if we need to list all the countries with its capitals names, will it be significantly faster in the first case? How many records/columns do I need to have to see the difference?