如何在回复表中在回复

uscsndtuodnklds uscsndtuodnklds 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

想知道数据库中的表是如何创建的
比如qq空间中发布了一个心情 别人回复后 我在回复别人的信息是 我的信息是放在回复表中还是在创建的另一张表
如下我自己想的解决方案是否可行 还有那个回帖数该怎么算?
create table Message --信息表
(
id int identity(1,1) primary key not null, --信息Id
title varchar(50) not null, --信息的标题
message varchar(500) not null, --信息的内容
author varchar(10) not null, --信息的作者
postTime datetime not null, --信息的发布时间
replyCount int not null, --信息的回复数
status int not null --信息的状态1:已读 0:未读
)
go

create table reply --回复 信息表中的信息的表
(
rid int identity(1,1) primary key not null, --回复的id
messageId int not null, --与信息表中的信息id对应
ruid int not null, --与用户表中的用户id对应
title varchar(50) null, --回复的标题
content varchar(500) not null, --回复的内容
rdate datetime not null, --回复的时间
)
go

create table rreply --回复 回复表中的信息的表
(
rrid int identity(1,1) primary key not null,
rid int not null, --与回复表中的回复id对应
rruid int not null, --与用户表中的用户id对应
rrcontent varchar(500) not null, --回复的内容
rrdate datetime not null --回复的时间


)
...全文
评论 8
收藏 已收藏
分享
返回顶部
uscsndtuodnklds
MS-SQL Server 34,876 成员 254,635 内容