Sachin Singh

Sachin Singh

  • 10
  • 55.8k
  • 75.2k

Database design problem

Jan 9 2021 3:36 PM
 i am developing an CMS for teachers , where they can login, design thier course and then post articles which will be save on SQL Server database.
1.Teacher Logs in 
2.He choose a Category (Let say Web Development)
3.Then he selects a Subcategory (say .. Javascript)
4.then he enters chapters in Javascript he want to teach.
5.then he enters Topics of each chapters.
6.Some Topics may have subtopics. 
7.Finally he writes post on a particular subtopic/Topic of a chapter for a course under subcategory of category.
 
my question is about the structure of Post table 
PostId
Title
Body
TopicId
ParentTopicId  /// it indicates i am not reating separate table for sub topic
 
 
 
OR
 
PostId
Title
Body
TopicId
SubTopicId   /// it indicates i am creating separate Table for subtopic
 
which one is good for faster lookup and maintanance or any better solution.

Answers (4)