What is the best way to design a db with object types that share some columns but also have some of there own ?
Have 1 table for the shared data and let each type has its own table
[objects] o_id | o_name | object_type
[object_type_1] o_t_id | o_id | option1 | option 2
[object_type_2] o_t_id | o_id | option3 | option 4
OR
have all the columns in 1 table and have a lot of NULL’s
[objects] o_id | o_name | object_type | option1 | option 2 | option3
| option 4
This is a common problem. A single best solution does not exist. You’ll have to weigh the pros and cons of each always depending on your model.
Have a look at your options:
A different approach, for your extra properties, is EAV. This has some serious benefits but also some tremendous drawbacks, so becareful before thinking that it is the “silver bullet”: