算法 第4版 答案

tech2024-04-08  10

算法 第4版 答案

Well that was a raging success… not!

好吧,那是大获成功的…… 不是!

Apparently database normalization isn’t something that web developers find all that interesting. (But thanks to malikyte and xhtmlcoder for keeping the question from being a complete ghost town!)

显然,数据库标准化不是Web开发人员发现的所有有趣的东西。 (但是,感谢malikyte和xhtmlcoder避免了这个问题成为一个完整的鬼城!)

That’s a shame, though — there are all sorts of pragmatic reasons behind good data design. To name just a few: properly designed tables often perform better than their de-normalized brethren, normalized data is much easier to aggregate successfully, and (most importantly) properly designed tables are much easier to understand.

但是,这很遗憾-好的数据设计背后有各种务实的原因。 仅举几例:正确设计的表通常比未规范化的同类要好,规范化的数据更容易成功聚集,(最重要的是)正确设计的表更易于理解。

That last one’s really the crux behind normalizing tables. Remember — computers don’t care if we write good code; when we write good code, it’s so that future developers won’t curse our names. Data normalization falls into the same future-proofing category.

最后一个确实是规范化表背后的关键。 记住-计算机不在乎我们是否编写良好的代码; 当我们编写好的代码时,这样将来的开发人员就不会诅咒我们的名字。 数据规范化属于相同的面向未来的类别。

Anyway, though: on to the answers. I’ll be brief, I promise.

无论如何,不​​过:答案。 我保证,我会简短的。

The FDA’s nutritional content database is — to my utter surprise — actually 3NF (everything has a primary key, and every piece of data appears to be atomic). I have some quibbles with a couple of the design choices, but they’re actually pretty minor. It’s pretty remarkable when you come across data this clean out of the box.

令我惊讶的是,FDA的营养成分数据库实际上是3NF(一切都有主键,每个数据似乎都是原子的)。 我对一些设计选择有一些疑问,但实际上它们很小。 当您开箱即用地遇到数据时,这是非常了不起的。 Although the population demographic data is fairly well designed (and easy to munge into better forms), it doesn’t even achieve 1NF: records lack primary keys. This is usually the case with public data, and it stinks; it makes tracking changes from version to version extremely difficult.

尽管人口统计数据的设计相当好(并且很容易将其整理成更好的形式),但它甚至无法达到1NF:记录缺少主键。 公共数据通常是这种情况,而且很臭。 这使得跟踪版本之间的更改非常困难。

The SEC filings were a trick question. They’re in a XML dialect, so normal forms don’t apply.

提交给SEC的文件是一个棘手的问题。 它们使用XML方言,因此普通格式不适用。

I think it’s important to notice how different formats change the way we can produce and consume data; the SEC data is a pretty good example of well done XML, but it would be pretty difficult trying to push this data into a database in any sort of structured way.

我认为必须注意不同的格式如何改变我们产生和使用数据的方式,这一点很重要。 SEC数据是做得很好的XML的一个很好的例子,但是尝试以任何一种结构化的方式将这些数据推入数据库中将非常困难。

If I wanted to build a site around this stuff, I’d likely use something like Berkeley DB for XML instead of a relational database.

如果我想围绕这些内容构建站点,则可能会使用Berkeley DB for XML之类的东西来代替关系数据库。

The gas price data, though crammed into a Excel sheet used more for presentation than data management, is actually in 3NF (if only because it’s pre-aggregated data). The data of the measurement is the primary key, and all columns are singularly dependent on the primary key (i.e. price is a function of date, and nothing more).

汽油价格数据虽然塞入Excel表格中,而不是用于数据管理,但用于显示的次数却多于3NF(如果仅仅是因为它是预先汇总的数据)。 测量数据是主键,所有列都唯一取决于主键(即价格是日期的函数,仅此而已)。 The Juvenile Arrest Rate data is, like the gas prices, nominally 3NF data crammed into Excel.

少年逮捕率数据就像汽油价格一样,名义上是3NF数据填充到Excel中。

接下来… (Coming up…)

Tune in tomorrow for a special super-difficult (I hope) challenge to keep us all occupied over the holidays.

明天要进行特殊的超级困难(我希望)挑战,让我们所有人在假期中忙个不停。

As always, if youâ??ve got a question, puzzle, or challenge that you think would make a good question for this quiz, email me at jacob -at- jacobian.org.

与往常一样,如果您认为自己的问题,难题或挑战对本测验提出了很好的疑问,请发送电子邮件至jacob -at-jacobian.org 。

翻译自: https://www.sitepoint.com/answers-to-episode-4-whats-normal-really/

算法 第4版 答案

相关资源:算法 第4版-谢路云 完整版
最新回复(0)