I have a database which stores information about various items. In particular, for each item I need to store the name, type and color. Each type can have a various amount of different colors. For example, I need to be able to ask 'what color can an item of type A have?'
I'm struggling to see how I should best structure my database. Each item has a color and a type, but I also need to capture the fact that each type has a unique range of colors available.
currently I have these ideas:
FIRST OPTION
items (ID(PK), name, types_and_colors_ID (FK))
types and colors (ID(PK), type_name (FK), color(FK))
types (ID(PK), type_name)
colors (ID(PK), color_name)
SECOND OPTION
items (ID(PK), name, type(FK), color(FK))
types and colors (type (PK FK), color (PK FK))
types (ID(PK), type_name)
colors (ID(PK), color_name)
THIRD OPTION
items (ID(PK), name, type_color_id(FK))
types (ID(PK), type_name))
type_colors (type_color_id, color_name (PK), type_id (PK))

