Bcnf paradigm, bcnf

Source: Internet
Author: User

Bcnf paradigm, bcnf

3.5 paradigm -- what is the bcnf paradigm?

For the bcnf paradigm, my understanding through reading materials is -- Removing primary key dependencies. For example, a warehouse management table has the following attributes (Administrator number, Warehouse number, cargo number, and cargo quantity), where each administrator manages a warehouse, this situation occurs:

1. The Warehouse Number and cargo number can determine the number of goods, and the Warehouse Number and cargo number can be determined by the Administrator number.

2. The Administrator number and cargo number can determine the Warehouse number, and the Administrator number and cargo number can determine the number of goods.


3. The repository number can be determined by the Administrator number.


4.The administrator ID can determine the Warehouse number.


The Warehouse number, Administrator number, and cargo number are both primary attributes, and the number is non-primary. Their relationship conforms to the three paradigm. However, it is not bcnf, because in the main attribute, the repository number can be released as the administrator number, and the Administrator number can be released as the repository number. There is a transfer dependency between them. This is not in line with bcnf.

The method is to split the table and get the following results: Table 1 (Warehouse number, Administrator number); table 2 (Administrator number, cargo number, and quantity ).

However, some bcnf paradigms may lead to the loss of relationships. For example, there is a table (workshop number, worker number, part number, and quantity) indicating the pieces of factory workers. The relationship is as follows:

1. One worker can only work in one workshop, and one workshop has multiple workers.


2. A worker produces multiple types of parts, and the parts in a workshop are not repeated.


The workshop number, worker number, and part number are both primary attributes, and the number is non-primary. Their relationship conforms to the three paradigm. However, "workshop number" + "part number" can be used to launch "Worker Number" and "Worker Number" can be used to launch "workshop Number". There is a transmission dependency between their main attributes, this is not in line with the bcnf paradigm.

The solution is to split the table into two tables: Table 1 (employee number, part number, quantity) and table 2 (employee number, workshop number ). In this case, the relationship between "workshop number + part number" and "Worker Number" will be lost.


The 3.5 paradigm has been completed, and the next step is the fourth paradigm.


What is the BCNF paradigm for databases?

No, but X must contain candidate codes. Here, candidate codes and codes are a concept.

X determines Y. X may not be an attribute or a group of attributes, but this group cannot contain Y. Otherwise (x, y)-> y cannot explain anything! Because y-> y, augmented ratio (x, y)-> y, so here X cannot contain Y or Y is not in X. For example, if U is a code, x must contain U, for example (u, z)-> y, X must contain the code. But if this is not the case, U is (a, B), and x is (B, c, d) Then X-> Y, then, because there is no (a, B) in x, So x does not contain code, it must not be BCNF!

In fact, this BCNF concept is defined above and below 1NF. If 1NF is defined as negative, X is determined by Y, and Y is not included in X. If X does not exist, this must not be BCNF.

Of course, we can also define the third paradigm. The relationship belongs to the third paradigm, and X is the real subset of the Code. If X-> Y does not exist, the relationship belongs to BCNF.

BCNF is the correction of the third paradigm, but it does not eliminate the transfer dependencies. This is a mistake downstairs, but it eliminates some dependencies! That is to say, a non-Code cannot depend on a part of the code. If (a, B, c) is a code, if (a, B) This Part can determine a non-code attribute, it does not match BCNF!

Eliminating transmission dependency is a condition for the second paradigm to the third paradigm specification. On the basis of the second paradigm, if there is no dependency transfer, it belongs to the third paradigm! Oh, some people are not skillful!

What is the BCNF paradigm in database design?

If every deterministic factor in the relational model contains a code, the relationship is the BCNF paradigm.
In your example, it should be that (WNO, PNO) is the primary code, so it can determine other attributes, that is, as long as the (WNO, PNO) given in a single tuple) then its QNT is determined (when querying the table)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.