鍍金池/ 問答/數(shù)據(jù)庫(kù)/ 某個(gè)數(shù)據(jù)庫(kù)的DDL的表關(guān)系搞不清楚

某個(gè)數(shù)據(jù)庫(kù)的DDL的表關(guān)系搞不清楚

某個(gè)數(shù)據(jù)庫(kù)的DDL如下所示,請(qǐng)問帖子應(yīng)該是哪個(gè)表?請(qǐng)解釋一下三個(gè)表的作用。
create table t_forum
(
forum_id int(11) not null ,
forum_name varchar(150) not null default 'forum',
forum_desc varchar(255) default NULL,
primary key (forum_id)
);

create table t_post
(
post_id int(11) not null ,
topic_id int(11) not null default 0,
user_id int(11) not null default 0,
post_text text,
post_attach blob,
post_time datetime default NULL,
primary key (post_id)
);

create table t_topic
(
topic_id int(11) not null ,
forum_id int(11) not null default 0,
topic_title varchar(100) not null default '',
user_id int(11) not null default 0,
topic_time datetime default NULL,
topic_views int(11) default 1,
topic_replies int(11) default 0,
primary key (topic_id)
);

回答
編輯回答
萌面人

t_forum,這個(gè)表應(yīng)該是保存論壇數(shù)據(jù),(論壇id,論壇名稱,論壇描述信息);
t_topic,這個(gè)表應(yīng)該是保存話題數(shù)據(jù),每一個(gè)話題都和一個(gè)論壇相關(guān),(話題id,關(guān)聯(lián)論壇id,話題名稱,發(fā)布該話題用戶id,發(fā)布時(shí)間,關(guān)注用戶數(shù),回復(fù)數(shù)...);
t_post,這個(gè)應(yīng)該就是帖子了(帖子id,關(guān)聯(lián)話題id,發(fā)布用戶id,帖子內(nèi)容,發(fā)布時(shí)間...);
大概應(yīng)該是這樣的...

2017年12月25日 11:09