开发者

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜