mysql - what's the common schema for allowing multiple "types" of data that is of the same parent -


what's standard way of storing ``subtypes'' if in relational databases mysql?

as example, think of single user's facebook feed. contains "entries", these entries can vary in type , needs stored. status might require varchar(255) example, while picture might want blob , note might need text.

completely separate tables make necessary make seemingly needlessly complex queries of recent entries of type. seems awkward, inefficient , not stable have lot of columns in 1 can not null.


i understand must common question cannot find similar, please feel free tell me duplicate , i'll happily close question.

i think call subtypes hierarchy. entries abstract entities , concrete subentities status, picture , whatever. user can have many entries "mapped" somehow 1 of subentities.

you can take @ question see how transform hierarchy tables: what best database schema support values appropriate specific rows?


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -