gpt4 book ai didi

sql - 什么是数据库规范化和功能依赖?

转载 作者:搜寻专家 更新时间:2023-10-30 20:01:42 27 4
gpt4 key购买 nike

我正在阅读 Database Normalization tutorial我很难理解以下内容:

Functional dependency says that if two tuples have same values for attributes A1, A2,..., An, then those two tuples must have to have same values for attributes B1, B2, ..., Bn.

Functional dependency is represented by an arrow sign (→) that is, X→Y, where X functionally determines Y.

以上两个指的是什么? “功能决定”是什么意思?

我可以有一个元组,其中 A1、A2、A3 相同但 B1、B2、B3 不同。

最佳答案

当关系中的一个属性唯一地确定另一个属性时,就会发生函数依赖。这可以写成 A -> B,这与声明“B 在功能上依赖于 A”是一样的。

在列出员工特征(包括社会安全号码 (SSN) 和姓名)的表格中,可以说姓名在功能上取决于 SSN(或 SSN -> 姓名),因为员工的姓名可以根据其 SSN 唯一确定。但是,反向语句(姓名 -> SSN)不正确,因为不止一名员工可以拥有相同的姓名但不同的 SSN。

关于sql - 什么是数据库规范化和功能依赖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29764062/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com