DB world is not mine, so perhaps the question is trivial
Imagine designing a DB that store data from different kinds of items (like datatypes)
I have no idea how I should do it, but this is how I'm making it
id | quantity | price ... Kind | ID_k_foreing |
then for every kind of items would be a table with properties of each type
so via software I could compare the kind and then make the joins to the appropriate table
like this pseudocode
switch(kind)
{
case chess_game:
the join is made with a table like this:
id_k| material | length | weigth ..
case car_toy:
the join is made with a table like this:
id_k| color | velocity | remote_control ...
case doll:
the join is made with a table like this:
id_k| name | height | clothes ..
...
}
There is some standar way to solve this "data type" problem in structure without adding tricky software functions?
thanks