I have a basic comment table with Id,Username,Comment, Date-time as the fields ..I need to add a reply table to this there a person can reply to the corresponding comment and then another person can reply to that reply and etc etc .Thank you in advance.
I would do it by keeping the replies in the Comment table, but having a separate table to link the Comments, thus: CommentID InReplyToCommentID So that if Comment 47 is a response to Comment 13, then there'll be a record in the ReplyTo table: CommentID InReplyToCommentID 47 13 This has the advantage of being small, and not requiring multiple organisations for storing the same sort of information, as well as not affecting any existing systems.
Though Thomas Rushton already provided a good solution, I'd suggest adding just a new column, InReplyToCommentID in the comments table. Then you have both comments, replies and their relation all in the same table. When you want to find all first Level comments you'll just need to query for comments with InReplyToCommentID being null, with no need to involve a second table. Unless a reply can be related to more than one comment, I think it's a simpler, more efficient solution.