Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm going to assume that a couple of year's worth of data might look something like this. Correct me if I'm wrong. (I'm going to ignore the issue of whether using zeroes is a good idea or a bad idea.)</p> <pre><code>Frequency Year Quarter Month Value -- Monthly 2012 1 1 1 Monthly 2012 1 2 2 Monthly 2012 1 3 3 Monthly 2012 2 4 4 Monthly 2012 2 5 5 Monthly 2012 2 6 6 Monthly 2012 3 7 7 Monthly 2012 3 8 8 Monthly 2012 3 9 9 Monthly 2012 4 10 10 Monthly 2012 4 11 11 Monthly 2012 4 12 12 Quarterly 2012 1 0 2 Quarterly 2012 2 0 5 Quarterly 2012 3 0 8 Quarterly 2012 4 0 11 Yearly 2012 0 0 3 Monthly 2013 1 1 1 Monthly 2013 1 2 2 Monthly 2013 1 3 3 Monthly 2013 2 4 4 Monthly 2013 2 5 5 Monthly 2013 2 6 6 Monthly 2013 3 7 7 Monthly 2013 3 8 8 Monthly 2013 3 9 9 Monthly 2013 4 10 10 Monthly 2013 4 11 11 Monthly 2013 4 12 12 Quarterly 2013 1 0 2 Quarterly 2013 2 0 5 Quarterly 2013 3 0 8 Quarterly 2013 4 0 11 Yearly 2013 0 0 3 </code></pre> <p>From that data we can deduce two functional dependencies. A functional dependency answers the question, "Given one value for the set of attributes 'X', do we know one and only one value for the set of attributes 'Y'?"</p> <ul> <li>{Year, Quarter, Month}->Frequency</li> <li>{Year, Quarter, Month}->Value</li> </ul> <p>Given one value for the set of attributes {Year, Quarter, Month}, we know one and only one value for the set of attributes {Frequency}. And given one value for the set of attributes {Year, Quarter, Month}, we know one and only one value for the set of attributes {Value}. </p> <p>The problem you were running into involved including "Frequency" as part of the primary key. It's really not.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload