简体   繁体   中英

SQL-Show that R is not in Boyce-Codd Normal Form

R = (J,K,L,M,N) with a set of functional dependencies {J->KL,LM->N,K->M,N->J} .

I understand the definition of BCNF. I believe that there exists no trivial functional dependencies and there may not be a super key. I'm not sure about the second part. How would you determine a super key from letters? Would appreciate some input on this.

The relation would be in Boyce-Codd Normal Form (BCNF), if the closure of the left-side attributes for all functional dependencies contains all relation attributes (J, K, L, M, N) . In other words, the left-side attributes of each functional dependency contain a key.

Let's analyze your functional dependencies:

  1. J -> KL . Then K -> M , then LM -> N and N -> J . So, J -> KL satisfies BCNF.
  2. LM -> N . Then N -> J , then J -> KL and that is all, we have all attributes.
  3. K -> M . This functional dependency is obviously a violation of BCNF, because we cannot get more attributes from set of dependencies.
  4. N -> J . Then J -> KL and K -> M . It satisfies BCNF.

So, the third dependency violates BCNF and K attribute is not the key itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM