database - 什么时候应该将社会保险号用作数据库主键?

标签 database database-design relational-database

我们的 DBA 说,由于社会保险号 (SSN) 是唯一的,我们应该将其用作表中的主键。

虽然我不同意 DBA 的观点(并且已经提到了 this answer 中发现的一些好的部分),但在某些情况下他可能是正确的吗?

最佳答案

SSN 不是人们的唯一标识符。它是否应该是某个表中的 PK 取决于表中的行的含义。 (另见 sqlvogel's answer。)

6.1 percent of Americans have at least two SSNs associated with their name. More than 100,000 Americans have five or more SSNs associated with their name. [...] More than 15 percent of SSNs are associated with two or more people. More than 140,000 SSNs are associated with five or more people. Significantly, more than 27,000 SSNs are associated with 10 or more people.
--idanalytics.com

另见维基百科 Social Security number .

关于database - 什么时候应该将社会保险号用作数据库主键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45422211/

相关文章:

sql-server - SQLSERVER : BCP import and encrypt columns using Database Key

php - Laravel 访问被拒绝

我从不选择的MySQL主键

mysql - 在一列中多次存储多个值?

entity-framework - 在 RavenDB 集合中存储/查询多种类型的最佳方法是什么?

sql - 联接表中的 count(distinct) 返回重复/不正确的值

mysql - T SQL CASE WHEN EXISTS 更新语句

database-design - 数据结构和系统设计问题

mysql - 如何为基于邮政编码的服务设计 MySQL 数据库?

postgresql - 在生产环境中使用 postgres 进行数据挖掘 - 有更好的方法吗?