r/DatabaseHelp • u/Mondoscuro • Jul 12 '18
Normalization
Example: there is a table named "car" that contains cars data and a "color" field that contains the color of the car.
Would be enough to use an "enum" data type if I knew the colors would never change?
Or could I do a table "colors" that has only one field primary key, that directly contain color names like "red", "blue", etc
Or for normalization purposes should I do a table like this:
1 red
2 blue
3 black
4 white
And link color to cars using ID instead of using the names themselves as IDs?
I hope I was clear enough
2
Upvotes
View all comments
Show parent comment
1
u/Mondoscuro Jul 13 '18
Yeah it's just that to me, having a lookup table with two generally unique fields like "id" and "label" of whatever (not just color) feels a step back from normalization, instead of a step forward, but I can't find a proper guideline on this.