locked
Back to school... Functional Dependencies and Attribute Closure RRS feed

  • Question

  • Alright everyone... here's a walk down memory lane, as I need some guidance on a theoretical question for a class I am taking.

    I have designed databases for years, but learned on the job, so now going backwards and learning the "theory"... this all just doesn't make sense.  Maybe this a weak excuse... either way, I have done the work, I am just looking for some critique of my train of thought and ultimate answer.

    The question is...

    Suppose you are given a relation R with four attributes ABCD and the following set of FDs: AB→C, C→D 
    and D→A.
    a. Identify the key(s) for R (recall that keys must be minimal)

    I determined the "Core" as B, so then I went to determine the closure of B.  Since AB --> C then A --> C and B --> C.  Then, Since C --> D and D --> A then B --> D and B --> A.  Also, due to the reflexitive property B --> C so I am saying B is the key, and it is minimal.

    Does this sound right?


    Wednesday, May 15, 2013 12:00 AM

Answers

  • I am not so strong in theoretical DBMS but I think "B" alone is not sufficient to be a candidate key. I think for AB->C, the LHS(here AB) cannot be decomposed unless you are finding EXTRANEOUS ATTRIBUTE. You can do this for RHS(say if A->BC was an FD, you can write A->B,A->C)

    AB,BD,BC are the candidate keys(minimum possible)

    AB+ : ->AB->ABC->ABCD

    BD+ : ->BD->BDA->BDAC

    BC+ : ->BC->BCD->BCDA

    • Proposed as answer by Kalman Toth Friday, May 17, 2013 12:12 PM
    • Marked as answer by Fanny Liu Wednesday, May 22, 2013 10:13 AM
    Thursday, May 16, 2013 5:24 PM

All replies

  • Can you elaborate with an actual example? Thanks.

    Kalman Toth Database & OLAP Architect sqlusa.com
    New Book / Kindle: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012

    Wednesday, May 15, 2013 7:13 AM
  • I spent 4 years in Italy with the military doing the same as today, IT work. I learned Italian with allot of wine and the required hand gestures from my landlord for about a year. I needed an elective for college so I took an Italian course. A month into it my landlord said I spoke worse and he was confused with what I was trying to say since I was try to speak with the proper conjugation of the verbs. Theory Relation is not the same as real life RDMS relationships in the business world as I remember. I remember leaving class confused but in the real world design it seems simpler. 😉

    john alverson


    • Edited by J Alverson Wednesday, May 15, 2013 10:13 PM
    Wednesday, May 15, 2013 10:13 PM
  • I am not so strong in theoretical DBMS but I think "B" alone is not sufficient to be a candidate key. I think for AB->C, the LHS(here AB) cannot be decomposed unless you are finding EXTRANEOUS ATTRIBUTE. You can do this for RHS(say if A->BC was an FD, you can write A->B,A->C)

    AB,BD,BC are the candidate keys(minimum possible)

    AB+ : ->AB->ABC->ABCD

    BD+ : ->BD->BDA->BDAC

    BC+ : ->BC->BCD->BCDA

    • Proposed as answer by Kalman Toth Friday, May 17, 2013 12:12 PM
    • Marked as answer by Fanny Liu Wednesday, May 22, 2013 10:13 AM
    Thursday, May 16, 2013 5:24 PM