How to design this simple DB?
I need to add some things to a DB I use to keep track of servers.
Table looks something like this.
Matrix
| Name | Description | Etc | Etc |
------------------------------------------------
| Server01 | First Server | Data | Data |
I want to add a table called Updates. It should look something like this:
Updates
| Name | Q1 Updates | Q2 Updates | Q3 Updates |
------------------------------------------------------
| Server01 | Done | Incomplete | Incomplete |
What is the best way to "link" these tables? I need everything in the Name field in Matrix to be in the Updates table as well. I'm a fundamental noob when it comes to databases, so I need some 101 help with this.
I have some triggers set up for another table that keeps track of other information and that works very well… I could just add more triggers for the table I am wanting to create… but I'm not sure if that's the best method.
What would you do?
EDIT: I want the Name field from Updates to always be an exact replica of what is in Matrix.
Best Answer
I'd probably start with something like this:
You then fill your Matrix entries with
Similarly, the Updates are filled like so
Finally, insert the possible Update Stati
Now, you have the framework to assemble your "configuration":
This "configuration" can then be queried with a pivot query:
With this design, this is no problem, since the Name is not stored redundantly.