Investigating Problems Related to Prime Attributes and All Keys in 2NF
LIU Changqi , LIU Guohua , YU Xiaoxue , XU Yulu , ZHANG Limeng , ZHU Dongyan , ZHENG Xiang
Journal of Donghua University(English Edition) ›› 2026, Vol. 43 ›› Issue (2) : 128 -137.
In relational database normalization theory, identifying all keys and prime attributes is essential yet highly challenging. It has been shown that the prime attribute problem is nondeterministic polynomial-time complete (NP-complete). Additionally, the maximum number of keys in a relation scheme is exponential in the number of attributes. These conclusions hold when the normal form is unknown, and when the normal form is known they may change. For instance, when a relation scheme is in Boyce-Codd normal form (BCNF), the prime attribute problem falls within the polynomial-time complexity class (P-class), and listing all keys becomes less cumbersome. In the realm of normalization, second normal form (2NF) serves as a foundational stage, and any scheme that is in BCNF or third normal form (3NF) inherently satisfies the requirements of 2NF. Therefore, this paper focuses on the problems related to the prime attribute and all keys for 2NF. First, we present a necessary condition and a sufficient condition for a relation scheme to be in 2NF. Then, we demonstrate that the maximum number of keys is exponential in the number of attributes and functional dependencies of a relation scheme in 2NF. Furthermore, we propose an algorithm for finding all keys of a relation scheme in 2NF. Finally, we demonstrate that the prime attribute problem remains NP-complete in 2NF. This study deepens the theoretical understanding of the computational complexity inherent in 2NF normalization and provides practical references for database scheme design.
prime attribute / key / NP-complete / normalization / second normal form (2NF)
| [1] |
|
| [2] |
|
| [3] |
|
| [4] |
|
| [5] |
|
| [6] |
|
| [7] |
|
| [8] |
|
| [9] |
|
| [10] |
|
| [11] |
|
| [12] |
|
| [13] |
|
| [14] |
|
| [15] |
|
| [16] |
|
| [17] |
|
| [18] |
|
| [19] |
|
| [20] |
|
| [21] |
|
| [22] |
|
| [23] |
|
| [24] |
|
| [25] |
|
| [26] |
|
| [27] |
|
/
| 〈 |
|
〉 |