What kind of queries a website like stackoverflow use?
I am learning mysql join queries. To pratice, I decided to make tables for a website like stackoverflow. I made three tables basically.
Qu开发者_运维百科estion_Thread
thread_id
title
username
datetime
Question_Reply
reply_id
thread_id
text
Question_Text_Comment
comment_id
reply_id
comment
How do I query all the replies and comments of each reply? I can't find a relationship here. It is not many-to-many, one-to-many, or one-to-one. It looks like one-to-many because one reply have many comments. The problem is that question detail page have many replies.
please advise me...
Question and reply is a one-to-many relationship. Reply and comment is a one-to-many relationship.
The properties (and keys) as far as I can see are looking good. I don't see the problem...
精彩评论