Home >Common Problem >What are the attributes in candidate codes called?

What are the attributes in candidate codes called?

烟雨青岚
烟雨青岚Original
2020-07-03 14:21:1915590browse

The attributes in the candidate code are called: main attributes. If the value of a certain attribute or attribute group in a relationship can uniquely identify a tuple, and any subset of it cannot be identified anymore, then the attribute group is called a (super code) candidate code; when a relationship has N attributes or When the attribute group can be uniquely identified, it means that the relationship has N candidate codes, and one of them can be selected as the primary code.

What are the attributes in candidate codes called?

#The attributes in the candidate code are called: main attributes.

If the value of a certain attribute or attribute group in the relationship can uniquely identify a tuple, and any subset thereof cannot be identified anymore, then the attribute group is called (super code) Candidate code.

For example: among student entities, "student number" can uniquely distinguish student entities. At the same time, assuming that the attribute combination of "name" and "class" is sufficient to distinguish student entities, then {student number} and {name, class} are all (super code) candidate codes.

Simply put, the candidate code (super code) is the attribute or attribute group that can be selected as the main code. When a relationship has N attributes or attribute groups that can be uniquely identified, it means that the relationship has N candidate codes, and one of them can be selected as the primary code.

The attributes that appear in the candidate code are called main attributes; non-primary attributes are attributes that are not included in any candidate code

For example: related workers (employee number, ID number, name , gender, department). Obviously both the job number and the ID number can uniquely indicate this relationship, so they are both candidate codes. The two attributes of job number and ID number are the main attributes. If the primary key is an attribute group, then the attributes in the attribute group are all primary attributes.

For more related knowledge, please visit PHP Chinese website! !

The above is the detailed content of What are the attributes in candidate codes called?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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