表示数据库的最紧凑的方式是什么?

发布于 2024-10-04 09:49:32 字数 139 浏览 5 评论 0原文

我有一个数据库(20 个表,最多 17 行),我需要在一张 A4 纸上以示意图或图形方式表示该数据库。

我正在寻找一种方法来做到这一点,因为我只了解 ER 模型,并且无法将其压缩到一个页面中。
它也可以是文本表示,只要它是标准化的方式即可。

I have a database (20 tables, up to a maximum of 17 rows) that I need to represent schematically or graphically on one A4 sheet.

I'm looking for a way to do this, since I only know about ER models and I couldn't manage to squeeze it into a single page.
It could also be a textual representation, as long as it is a standardized way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弱骨蛰伏 2024-10-11 09:49:32

有些人将数据模型称为“ER 图”,这正是您正在做的事情;其他人将 ERD 称为“数据模型”。不用担心常见的用法术语,现在我们行业中有很多非专业人士,他们称苹果为橙子。当您使用正确的标签时,生活会变得更加轻松。

实体关系图是实体和关系(仅)的示意图,这就是它被称为 ER 图而不是数据模型的原因。一张 A4 纸可以轻松容纳 10 个表格。您将有空间添加注释和文本。

数据模型是实体、关系和属性的完整示意图,主键区分清楚。根据进展阶段和观众,或者逻辑渲染与物理渲染,它将另外显示:

  • 其他索引(主键除外)
  • 数据类型
  • 有关关系的完整详细信息
  • 关联表(多对多,显示为逻辑级别的关系;在物理级别公开为表格)
  • 完全公开的子类型/父类型

  • 根据是否使用关系建模标准,它将显示数据及其关系的微妙性和复杂性。

  • 显然,如果您使用标准表示法,那么您将被更多的人理解,并且当更多人学习标准并期望该表示法时,您永远不必回去更改它。

查看下面链接中提供的数据模型。第一页是 ERD(28 个实体,同时保留层次结构)。 DM 在随后的 4 x A4 页中交付,每个页包含一个逻辑表簇;所有五个页面都已链接(确保您找到注释链接,然后单击它们)。

即使对于 DM,我发现最好

  • 以可管理或可理解的块的形式呈现信息:包含逻辑相关集群的 A4 页面,
  • 该页面必须自己完成(必须显示所有父表),这会导致重复
  • 但我从不重复任何内容,
  • 因此我在其自然簇中定义它一次,并在引用的任何地方使用折叠的实体符号,并将引用链接到完整的定义。

我发现的另一种可以严重提高理解的技术是按自然层次结构显示对象。该技术在 Notation 文档中有详细介绍。

对于只有十个表的您来说,另一个选择是在数据模型级别绘制架构,但仅显示主键(不包括非 PK 属性);比 ERD 迈出了一小步,比完整的 DM 少了一大步。我不建议这样做,而是给他们完整的 DM以及 ERD,无论需要多少 A4 页。人们可以停在第一页,也可以根据需要继续阅读。

链接到示例 ERD 和示例数据模型

链接到IDEF1X 表示法适合那些不熟悉关系建模标准的人。

Some people call Data Models "ER Diagrams", which is what you appear to be doing; others call ERDs "Data Models". Don't worry about the common usage terms, we have a lot of non-professionals in the industry these days, who call apples oranges. Life is much easier when you use the correct labels.

The Entity Relation Diagram is a schematic of the Entities and Relations (only), that's why it is called an ER diagram and not a Data Model. Ten tables will easily fit onto an A4 page. You will have space to add notes and text.

The Data Model is the full schematic of the Entities, Relations and Attributes, with the Primary Key differentiated clearly. Depending on the stage of progress and the audience, or the logical vs physical rendering, it will additionally show:

  • the other Indices (other than the Primary Key)
  • DataTypes
  • full detail re the Relations
  • Associative tables (many-to-many, shown as a Relation at the Logical level; exposed as a table at the Physical level)
  • Subtypes/Supertypes fully exposed

  • Depending on whether you use the Relational modelling Standard or not, it will show the subtleties and complexities of the data and its Relations.

  • Obviously, if you use Standard notation, then you will be understood by more people, and you never have to go back and change it when more people learn the Standard and expect that notation.

Have a look at the Data Model provided in the link below. The first page is the ERD (28 Entities, while retaining the hierarchy). The DM is delivered in the subsequent 4 x A4 pages, each containing a logical cluster of tables; and all five pages are linked (make sure you find the notes re links, and click on them).

Even for the DM, I find it is best to present information:

  • in manageable or understandable chunks, an A4 page containing a logically related cluster,
  • which has to be complete it itself (all the parent tables must be shown), which leads to duplication
  • but I never duplicate anything
  • therefore I define it once, in its natural cluster, and use a collapsed Entity symbol wherever it is referenced, and link the reference to the full definition.

The other technique that I have found that seriously improves understanding, is to show the objects in their natural hierarchy. That technique is detailed in the Notation document.

Another option for you, with only ten tables, is to draw the schema at Data Model level, but only show the Primary Keys (exclude non-PK attributes); one small step beyond ERD, and one big step less than full DM. I do not recommend this, rather, give them the full DM as well as the ERD, on however many A4 pages it takes. People can stop at the first page, or go further if they want.

Link to Example ERD & Data Model

Link to IDEF1X Notation for those who are unfamiliar with the Relational Modelling Standard.

似梦非梦 2024-10-11 09:49:32

不要将所有信息压缩到一个小区域,而是尝试省略非必要的列。我不知道你的表示有什么用途,但如果它是供人类阅读的,你应该记住信息包装得越密集,人脑就会忽略的信息就越多 处理图像时。

像往常一样,少即是多。

Instead of squeezing all information into a small area, try leaving out the non-essential columns. I don't know what the usage of your representation is, but if it is to be read by humans you should remember that the denser the information is packed, the more of it will simply be ignored by the human brain when processing the image.

Less is more, as usual.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文