主键的设计标准是什么? [英] What are the design criteria for primary keys?

查看:122
本文介绍了主键的设计标准是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选择好的主键,候选键以及使用它们的外键是一个至关重要的数据库设计任务 - 与科学一样多的艺术。设计任务有非常具体的设计标准。

Choosing good primary keys, candidate keys and the foreign keys that use them is a vitally important database design task -- as much art as science. The design task has very specific design criteria.

有什么标准?

推荐答案

考虑主键的条件是:


  • 唯一性 $ b
  • 不可避免(表中没有子集的键唯一标识一行)

  • 简单

  • 熟悉(不应经常更改)
  • / strong>(对用户有意义)
  • Uniqueness
  • Irreducibility (no subset of the key uniquely identifies a row in the table)
  • Simplicity (so that relational representation & manipulation can be simpler)
  • Stability (should not be altered frequently)
  • Familiarity (meaningful to the user)

这篇关于主键的设计标准是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆