是否存在双向关系数据库? [英] Are There Bidirectional Relational Databases?

查看:98
本文介绍了是否存在双向关系数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个服装数据库,在该数据库中,可以将诸如顶部或底部(裤子,裙子)之类的表中的项与其他表(如帽子或鞋子)中的项进行匹配。 / p>

我希望能够将所有桌子在两个方向上相互关联(每条裙子上有很多上衣,每个上衣上有很多裤子,等等),我想要每个表相互关联。例如,我想查询这些裤子搭配什么样的商品,并查看衬衫,鞋子等的列表。



使用关系数据库需要介于两者之间



我想我可以用NoSQL数据库做到这一点,但是随着我了解这些内容是的,它们似乎不合适。我错了吗?



是否存在双向关系数据库,它们被称为什么?

解决方案


是否存在双向关系数据库,它们被称为什么?


它们被称为关系数据库。



在关系数据库中进行查询没有方向性。关系数据库中的每个表(基础表或查询结果)都表示感兴趣的应用程序关系。一个表包含以这种方式相关的值的行。 (当值的子行标识应用程序实体时,关系既涉及值又涉及应用程序实体。)基表设置为满足与其关联的应用程序关系的值的行。查询返回的值的行满足用基表关系表示的应用程序关系。



鉴于每个基表都代表必要的应用程序关系,一个定义了足够的基本表来描述整个应用程序状态。说表的数量是荒谬的。归一化建议将某些表/关系分解为其他表/关系不仅简化了描述,而且减少了操作的冗余性和复杂性。



关系数据库中的外键约束可以合理地称为定向。他们告诉DBMS,某个地方某些列下的值必须显示为其他地方某些列下的值。在ER(实体关系)建模中,这些图被表示为来自实体的线,并标识了它们所参与的关系。(后者是您的中间表。)但是,哪些外键约束对查询组合没有影响



您需要阅读有关关系数据库的介绍& DBMS。 (避免使用基于ER建模和ORM(对象关系映射)方法的演示,因为不能真正理解关系模型。 )(NoSQL接近也不会。)


I'd like to create a clothing database, where items from tables such as 'tops' or 'bottoms' (pants, skirts) can be matched with each other and with items in other tables such as hats or shoes.

I want to be able to relate all tables to each other in both directions (each skirt goes with many tops, and each top goes with many pants, etc) and I want each table to be related to each other. E.g, I want to query 'what items look good with these pants' and see a list of shirts, shoes, etc.

Using a relational database would requires in-between tables for every relationship, which creates a ridiculous amount of tables.

I thought I might be able to do this with a NoSQL databases, but as I'm learning what those are, they don't seem to fit. Am I wrong?

Are there bi-directional relational databases, and what are they called?

解决方案

Are there bi-directional relational databases, and what are they called?

They are called "relational databases".

Querying in relational databases has no directionality. Each table (base table or query result) in a relational database represents an application relationship of interest. A table holds the rows of values that are related in that way. (When subrows of values identify application entities, the relationship is about both values and application entities.) A base table is set to the rows of values that satisfy its associated application relationship. A query returns the rows of values that satisfy its application relationship that has been expressed in terms of the base table relationships.

Given that each base table represents a necessary application relationship, one defines sufficient base tables to describe the overall application state. To say that the number of tables is ridiculous is ridiculous. The decomposition of certain tables/relationships into others as suggested by normalization not only makes that description simpler but reduces redundancy and complications in manipulation.

The foreign key constraints in a relational database can reasonably be called directed. They tell the DBMS that the values under some columns in one place have to appear as values under some columns elsewhere. In ER (Entity-Relationship) modeling these are diagrammed as lines from entities and identifying relationships to the relationships they participate in. (The latter are your "in-between tables".) But which foreign key constraints hold has no effect on query composition.

You need to read an introduction to relational databases & DBMSs. (Avoid presentations based on ER modeling and ORM (Object-Relational Mapping) approaches, which do not really understand the relational model.) (NoSQL approaches don't either.)

这篇关于是否存在双向关系数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆