如何在SQL Server 2017中实现图形数据库

所谓图形数据库并不是存储图片的数据库,而是基于“图论”的对象与关系。

只有两种类型的表(点和线)
节点表:节点表定义图模型中的实体。
边缘表:边缘表定义节点表实体之间的连接

查询加MATCH语句

SELECT UsersFol.NickName
FROM Users Users, FlowInfo, Users UsersFol
WHERE MATCH(Users-(FlowInfo)->UsersFol)
AND Users.NickName = 'Camila';

这些查询将向我们显示哪些客户喜欢哪本书以及哪本书排名很高

select Customer.CustName,Books.BookName,CustomerBookRate.RankAmount from Customer,CustomerBookRate,Books
where MATCH (Customer-(CustomerBookRate)->Books)
select Books.BookName,sum(CustomerBookRate.RankAmount) from Customer,CustomerBookRate,Books
where MATCH (Customer-(CustomerBookRate)->Books)
group by Books.BookName

 



详细资料见:

https://blog.csdn.net/culuo4781/article/details/107624511
https://blog.csdn.net/m0_46986820/article/details/106018491

posted @ 2023-02-07 11:59  毛小毛  阅读(74)  评论(0编辑  收藏  举报