So, as part of my assignment, I have to prove that any relation with two attributes is in BCNF.

As per my understanding, if for a relation we have 3rd normal form and one non key attribute functionally determine key attribute, it violates the BCNF.

Say my relation consists of two attributes A1,A2

Scenario1(only one functional dependency)

A1 -> A2 (so A1 is the key, and A2 does not FD A1 : so no violation)

same applies for

A2 -> A1

But what if

A1->A2 and A2->A1

Here key can be either A1, A2. And the other non key attribute functionally determines the key.

  • Your conclusion "And the other non key attribute functionally determines the key." is not correct. Because the "other" is a key attribute as wel.. Oct 31, 2015 at 22:48
  • "any relation with two attributes is in BCNF" is not true. {} is a determinant when every row has the same subrow value for the determined attributes. People often forget about {} as determinant. Including textbooks. PS When some FDs hold then others might have to also, per Armstrong's axioms. You need to analyze cases based on what all their non-trivial FDs are. Start from definitions.
    – philipxy
    Jan 19, 2021 at 20:50

1 Answer 1


A relation is in BCNF when, for all FDs that apply to the relation, the left hand side is a superkey. That is, it has to contain all the attributes of at least one key. Your relation must have at least one candidate key (that is, you can't have repeating rows in the relation), else it wouldn't even meet the conditions for 1NF.

Given this, your relation can have zero, one or two FDs. The case for zero FDs is trivial (ab->ab). For one FD (a->b) the left hand side attribute is clearly the key.

In the case where you have FDs in both directions (a->b and b->a) you simply have two different keys, and so the left hand side of each FD remains a superkey.

  • 1
    What about the (rather weird) case with these FDs?: ()->AB , A->B, B->A Nov 1, 2015 at 7:26
  • Not sure what you mean by ()->AB as I don't think nothing can ever imply something. Could you give an example?
    – beldaz
    Nov 1, 2015 at 8:35
  • 1
    A relation where the (only) candidate key is the empty set - and can therefore have only 1 or 0 rows. Nov 1, 2015 at 9:07
  • Hmmm. Well if the max number of rows is one then there's no opportunity for redundancy, so I'd say it was automatically BCNF and above. Wouldn't want to have to prove that, though..
    – beldaz
    Nov 1, 2015 at 9:16
  • "()->AB" doesn't say something implies something, it says something functionally determines something. See my comment on the question.
    – philipxy
    Jan 19, 2021 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.