database design - mysql handling nested data for a known number of levels -


now have hierarchical structure looks this:

.stage
...grade
.....semester
.......subject
.........unit
...........lesson

at first stored inside same table id parent relationship; however, each level of 6 levels has own data. example, lesson has featured_video_id , subject has language_id.

now i'm thinking of creating 6 tables: 1 each level , connect them foreign keys. i'm thinking of possibilities , thought professional opinion help. division of or regret in future?

i t makes lot of sense have separate tables stages, grades, semesters, ...

you have mentioned best reason this, can add individual data each of these levels. can name foreign keys in sensible way (i.e. stage_id in table grades). , doubt ever need list of subjects mixed in lessons or semesters.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -