Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the attributes in the candidate code

Shulou Source: shulou.com Published: 2022-06-03 03:12:36 10月03日 Update

What are the attributes in the candidate code? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

The attribute in the candidate code is called: primary attribute. If the value of an attribute or attribute group in a relationship can uniquely identify a tuple, and any subset of it can no longer be identified, the attribute group is called a (supercode) candidate code; when a relationship has N attributes or attribute groups that can be uniquely identified, it means that there are N candidate codes in the relationship, and one of them can be selected as the main code.

The attribute in the candidate code is called: primary attribute.

If the value of an attribute or attribute group in a relationship can uniquely identify a tuple, and any of its subsets can no longer be identified, the attribute group is called a (supercode) candidate code.

For example, in the student entity, the "student number" is the only one that can distinguish the student entity, and at the same time, assuming that the attribute combination of "name" and "class" is enough to distinguish the student entity, then {student number} and {name, class} are all candidate codes.

In a nutshell, a candidate code (supercode) is an attribute or group of attributes that can be selected as a master 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 master code.

Attributes that have appeared in candidate codes are called primary attributes; non-primary attributes are attributes that are not included in any candidate code.

For example: relationship workers (job 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 work number and ID card number are the main attributes. If the master code is an attribute group, then all the attributes in the attribute group are primary attributes.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Attribute logo name student entity that is job number certificate number identity subset student number class help clear two content at the same time worker gender Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Redmi Linux Huawei MariaDB