Primary Key Definition
来源:互联网 发布:js滑动显示更多内容 编辑:程序博客网 时间:2024/05/22 06:12
Definition: The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server). Primary keys may consist of a single attribute or multiple attributes in combination. Imagine we have a student records database that contains three tables. The first table, STUDENTS, contains a record for each student at the university. The second table, CLASSES, contains a record for each class session offered. The third table, ENROLLMENT, contains student enrollment records (e.g. each record represents a single student enrolling in a single course). There would be multiple records for each student (representing all the classes that student is enrolled in) and multiple records for each class session (representing all the students enrolled in that class). A student's unique student ID number would be a good choice for a primary key in the STUDENTS table. The student's first and last name would not be a good choice, as there is always the chance that more than one student might have the same name.
表通常具有包含唯一标识表中每一行的值的一列或一组列。这样的一列或多列称为表的主键 (PK),用于强制表的实体完整性。在创建或修改表时,您可以通过定义 PRIMARY KEY 约束来创建主键。
一个表只能有一个 PRIMARY KEY 约束,并且 PRIMARY KEY 约束中的列不能接受空值。由于 PRIMARY KEY 约束可保证数据的唯一性,因此经常对标识列定义这种约束。
- Primary Key Definition
- PRIMARY KEY
- mysql primary key key
- PRIMARY KEY KEY
- key与PRIMARY KEY区别
- Primary key 与Unique Key
- key与PRIMARY KEY区别
- SQL primary key, foreign key
- sql primary key procedure
- 主键(Primary Key)
- SQL PRIMARY KEY 约束
- alter indentity primary key
- SQL PRIMARY KEY 约束
- INTEGER PRIMARY KEY简介
- INTEGER PRIMARY KEY简介
- SQL PRIMARY KEY 约束
- primary key 约束
- SQL SERVER PRIMARY KEY
- 避免资源死锁:识别已打开的事务
- 怎样用Javascript获得IE临时目录
- 查找没有索引的表
- 转换阿拉伯数字为汉字数码
- 通过SQL 模板提高工作效率
- Primary Key Definition
- 页面上的javascript判断
- sds
- 如何用Tomcat和Openssl构建HTTPS双向认证环境(HTTPS客户端认证)
- 过滤SQL Profiler 跟踪的输出
- HTML在线编辑器Word XP
- C#_个性化Combox中的元素
- Get/Set函数和public成员变量
- OOP In JS [JS脚本中的面向对象]