V2EX  ›  英汉词典

Natural Key

释义 Definition

Natural key(自然键)是数据库术语,指使用数据本身固有的、有实际意义的属性作为唯一标识符(主键),而非系统生成的人工编号。例如,用身份证号码或电子邮件地址作为记录的唯一标识。

发音 Pronunciation

/ˈnætʃ.ər.əl kiː/

例句 Examples

A person's social security number can serve as a natural key in a database.
一个人的社会安全号码可以在数据库中充当自然键。

When designing the user table, the team chose email address as the natural key instead of an auto-incremented ID, since every user must register with a unique email.
在设计用户表时,团队选择电子邮件地址作为自然键,而不是自增ID,因为每个用户都必须使用唯一的电子邮件进行注册。

词源 Etymology

Natural 源自拉丁语 naturalis,意为"天生的、本性的";key 源自古英语 cǣġ,原指"钥匙",后引申为"关键、标识符"。在数据库领域,key 被用来指代能唯一识别一条记录的字段。Natural key 这一术语强调的是该标识符来自数据的"天然"属性,与人为生成的 surrogate key(代理键)相对。该术语随关系型数据库理论在20世纪70年代的发展而广泛使用。

相关词汇 Related Words

文献引用 Literary & Technical References

  • E.F. Codd, A Relational Model of Data for Large Shared Data Banks (1970) — 关系型数据库理论的奠基之作,奠定了键(key)概念的理论基础。
  • C.J. Date, An Introduction to Database Systems — 数据库经典教材,详细讨论了 natural key 与 surrogate key 的区别与使用场景。
  • Martin Fowler, Patterns of Enterprise Application Architecture (2002) — 在讨论对象-关系映射时涉及 natural key 的实际应用与取舍。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5547 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 7ms · UTC 07:05 · PVG 15:05 · LAX 00:05 · JFK 03:05
♥ Do have faith in what you're doing.