A functional dependency is a constraint between two sets of attributes in a relation, in relational algebra, databases and type systems.