数据库设计
Information表
字段:InformationID,InfoContent,...
KeyWord表(存储单个关键字)
字段:KeyWordID,KeyWord
Relation表
字段:InformationID,KeyWordID
相应的存储过程
AddKeyword:往KeyWord表添加新增的单个关键字,往Relation表添加关联
UpdateRelation:Relation表更新文章和关键字关联
晚上继续...
SELECT DISTINCT *
FROM Information AS i
INNER JOIN Relation AS r ON i.InformationID = r.InformationID
INNER JOIN KeyWord AS k ON r.keywordID = k.KeyWordID
WHERE (i.InformationID <> 1) and r.keywordID in
(select r.keywordID from relation r where r.informationID=1)
本文介绍了一种通过存储过程实现的文章与关键词关联的数据库设计方案。具体包括Information表存储文章内容,KeyWord表存储关键词,以及Relation表建立两者之间的联系。此外,还提供了一个用于添加新关键词及其与文章关联的存储过程。

被折叠的 条评论
为什么被折叠?



