Home > Database > Mysql Tutorial > body text

What index does not allow duplicate index values ​​in records?

青灯夜游
Release: 2020-09-02 12:46:32
Original
7187 people have browsed it

The indexes that do not allow duplicate index values ​​in records are: primary index and candidate index. A primary index is an index that does not allow duplicate values ​​in specified index fields or expressions. Like the primary index, candidate indexes require the uniqueness of field values ​​and determine the order in which records are processed; in databases and free tables, multiple candidate indexes can be established for each table.

What index does not allow duplicate index values ​​in records?

Indexes in Visual FoxPro can be divided into: ordinary indexes, unique indexes, candidate indexes and primary indexes. Indexes that do not allow duplicate index values ​​in records are primary indexes and candidate indexes.

Primary Index

Primary Index: (also called primary keyword) refers to the expression in the specified index field Indexes with duplicate values ​​are not allowed in the formula.

The primary index is mainly used to establish referential integrity in the parent table or referenced table of a permanent relationship. It can ensure the uniqueness of the input field value, and the field determines the order in which records are processed. A database table can only have one primary index

If you specify a primary index in a field that already contains duplicate data, the database will return an error message. If there is already a primary index in the table, you can only use Candidate index or ordinary index

Candidate index

Like the primary index, it requires the uniqueness of field values ​​and determines the order in which records are processed. In databases and free tables, multiple candidate indexes can be created for each table.

Related recommendations: "mysql tutorial"

The above is the detailed content of What index does not allow duplicate index values ​​in records?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template