数据库中的数据集是否始终以一种形式或另一种形式标准化

发布于 2024-08-31 17:54:57 字数 161 浏览 2 评论 0原文

假设我有一组数据,给定数据和关系模式,我可以假设该组数据以一种形式或另一种形式标准化。在我看来,给出的原始数据必须标准化为某种形式。然而,与朋友的讨论导致我在这里问这个问题。

为了详细说明这个问题,我想说的是,给定关系或表的一组函数依赖关系,是否可以保证该表至少处于 1NF(如果不是其他表)

Suppose I have a set of data, given the data and the relation schemas can I assume that the set of data is normalized in one form or the other. In my opinion raw data given, has to be normalized into some form. However a discussion with a friend has led to ask me this question here.

To expound more on the question, I would say given a set of functional dependencies for a relation or table, is it guaranteed that the table would atleast be in 1NF if not others

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

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

发布评论

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

评论(4

浊酒尽余欢 2024-09-07 17:54:57

SQL 模型允许存在根本不是真正关系的表(例如具有重复行的表)。因此,SQL 数据库肯定不总是标准化的。我预计大多数使用数据库的人都遇到过没有键的表的示例。

The SQL model permits tables that are not true relations at all (tables with duplicate rows for example). So it certainly is not the case that SQL databases are always normalized. I expect most people who work with databases have come across examples of tables without keys.

甚是思念 2024-09-07 17:54:57

根据我的经验,在现实生活中,您会遇到各种数据库,从完全规范化到完全混杂的奇怪内容,您在任何地方都不会看到 em>,更不用说在数据库中了。

您当然不能指望找到 1NF 形式的数据(这被认为是最基本的标准化形式)。

另外,这并不是说标准化数据应该是数据库设计的“目标”。您需要根据性能标准权衡干净的设计,而完全规范化的数据库通常可以根据您的性能标准进行工作。

In my experience, in real life, you'll run into databases that span the entire spectrum from perfectly normalised to a complete mishmash of wierd stuff that you'd never expect to see anywhere, let alone in a database.

You certainly can't expect to find data in even 1NF (which is supposedly the most "basic" normalisation form).

Also, that's not to say that normalised data should be the "goal" of database design. You need to weigh clean design against performance criteria and fully normalised database can often work against your performance criteria.

伪心 2024-09-07 17:54:57

不,原始数据不一定在 1NF 中标准化。这取决于模式。可能存在 1NF 中不存在的模式设计。

让我给你举个例子,
假设有一个表存储所有学期学生的成绩。每个学期的 Studentid 为 5。假设 Marks 的架构为

Marks(studentid,marks)

该表不在 1NF 中,因为它会有重复的值。

No, The raw data are not necessarily normalized in 1NF. It depends on the schemas. There can be schema design which is not even in 1NF.

Let me give you an example,
Suppose there is a table which stores marks of all semester student. Each semester is having studentid 5. Assume the schema for Marks as

Marks(studentid,marks)

This table is not in 1NF as it will have repeated values.

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