Candidate Keys Calculator

Published: August 26, 2025, updated: August 26, 2025

This learning tool shows you how you can derive superkeys and candidate keys from functional dependencies. This is useful for when you want to determine the specific normal form of a relation.

How to use

Here's how to use the candidate key calculator:

  1. Specify the attributes in your relation.
  2. Enter the functional dependencies in your relation.
  3. Check that the tool parses your functional dependencies correctly.
  4. Review the calculated superkeys for your relation.
  5. Identify the candidate keys (minimal superkeys).

Relation attributes

    Parsed attributes: {}

    Functional Dependencies

    Input format description

    Enter each functional dependency on a separate line using single letters: A -> B
    Write multiple attributes without spaces: AB -> CD

    Example input
    A -> B
    B -> C
    AC -> D
    CD -> EF

    Parsed Dependencies

    These are the determinants and dependents from your functional dependencies:

    α (Determinant) β (Dependent)

    Superkeys

    These are all sets of attributes that uniquely determine all other attributes in your relation:

    Superkey Size

    Candidate keys

    These are the minimal sets of attributes that uniquely determine all other attributes in your relation. This implements the algorithm find_candidate_keys(A, F) described in the Candidate key Wikipedia article.

    Candidate Key

    Further reading

    Tags

    I would be thrilled to hear from you! Please share your thoughts and ideas with me via email.

    Back to Index