How is the database designed for the message board in the QQ space? I don't know the database design of the QQ space? Can any friend receive an unlimited number of replies?
Reply to discussion (solution)
Reply ID reply_id,
Post ID note_id,
Parent ID parent_id of the reply ID
Not afraid of buildings in the building, as long as the ownership is marked clear
The adjacent list and the pre-order traversal can all be modified.
Reply ID reply_id,
Post ID note_id,
Parent ID parent_id of the reply ID
Not afraid of buildings in the building, as long as the ownership is marked clear
Can I list the most basic tables or give me a link?
The adjacent list and the pre-order traversal can all be modified.
Isn't the adjacent table in the data structure? Can you help me design the table?
Id, whether posted or replied, each post must be uniquely identified.
Id of the pid to be replied
The link is complete. just traverse the number.
Extension:
Mid Post id, which can narrow the search range
Pre-order: pre-order traversal, also known as left and right values, records the start and end IDs of a post.
Median sorting: it is derived from the "one-foot-length" of Zhuangzi, which takes half a day and is inexhaustible. However, because a computer can only represent a limited number, it cannot be "unlimited"
Id, whether posted or replied, each post must be uniquely identified.
Id of the pid to be replied
The link is complete. just traverse the number.
Extension:
Mid Post id, which can narrow the search range
Pre-order: pre-order traversal, also known as left and right values, records the start and end IDs of a post.
Median sorting: it is derived from the "one-foot-length" of Zhuangzi, which takes half a day and is inexhaustible. However, because a computer can only represent a limited number, it cannot be "unlimited"
It is equivalent to a news publishing system, but the user and the user can reply freely, just like the QQ space !!
Can you help me? My design is as follows:
There are three tables in total:
User table: tb_user;
Id // increment
User_name // User name
User_paw // password
Article table: tb_news:
Id // increment
User_id // The Author's id
Title // title
Content // content
Reply table: tb_message
Id // increment
Parent_id // I do not understand deeply
User_id // message holder id
News_id // The id of the message in which the message is sent
I don't know if such a design can work. I wrote something myself, so I can only share messages with each other.
Look at answers