I am sorry this is such a newb question, but it is one thing I am having a difficult time wrapping my mind around, and after an evening spent reading I finally just decided to ask for some clarification.
Say I have a table that contains information about servers. As new servers come online, this table is populated with information about the servers. Now, assume that the server name is unique, and server serial number is unique.
Scenario #1:
Server Table
server_name text,
server_serial text,
server_os integer (FK points to os table),
os_version integer (FK points to os_version table),
cpu_type integer (FK points to cpu_type table),
Now, let's assume there are 20 things that will not be unique about this server (e.g., server_os is not unique), thus in Scenario #1 we have 20 columns that contain FKs pointing to PKs of other tables.
Scenario #2:
No normalization. No other tables, just a server table with all the columns related to the server. No FK/PK relationships.
Normally I would go for Scenario #1. However, in scenario #1 I end up with a lot more queries. For scenario #2, I would simply do an insert for each server. In scenario #1, I would need to do a select to grab the PKs for all 20 columns, and then do my insert with the returned values (21 queries assuming all values exist in the 20 other columns). It gets even worse if there's a new server_os, cpu_type, etc.
Any help understanding why scenario #1 (normalized) is better in this situation would be greatly appreciated, or what exactly I am missing here. Thank you!
ServerTable
as FK could be deciding factor here