mysql - Database design for a tutorial web application -
we have requirement of creating tutorial kind of application, there list of topics , each topics have sub topics. user can enroll topic, , go through sub topics , mark sub topics "completed". opting use mysql
relational db.
so. there typically 3 master tables,
- users
- topics
- sub_topics
we planning continue approach making mapping tables 'users , topics' i.e 'user_topics' contains column user_id
, topic_id
, is_enrolled
, mapping table track completion status of sub topics, may 'user_sub_topics' contains user_id
, sub_topic_id
, topic_id
, is_completed
is best way design db? or other work around can done?
here few queries need data
- topic list display list of topics completed label if user has completed sub topics (join query help)
- topic detail page display list of completed sub topics too
please suggest
first have design such relational database finding relations between entities , study bit er or extended er diagram(entity relation) , convert diagram tables.
there step step method shows how , @ end can check normal form of tables , check whether satisfies purpose , how design.
i suggest fundamentals of database systems ramez elmasri provide great information database design
wiki
Comments
Post a Comment