What's the standard way of storing ``subtypes'' if you will in relational databases like MySQL?
As an example, think of a single user's Facebook feed. All it contains are "entries", but these entries can vary significantly in type and what needs to be stored. A status might require a VARCHAR(255)
for example, while a picture might want a BLOB
and a note might need a TEXT
.
Completely separate tables make it necessary to make seemingly needlessly complex queries to get all of the recent entries of any type. It just seems awkward, inefficient and not completely stable to have a lot of extra columns in which only one can be not NULL.
I understand that this must be a common question but I cannot find something similar, so please feel free to tell me a duplicate and I'll happily close the question.