Explain functional dependency with example.
A functional dependency occurs when one attribute in a relation uniquely determines another attribute.
OR
Consider a relation say R(X,Y), where X and Y are one or more than one attribute, attribute X is functionally dependent on attribute Y if every value in X in the relation R has exactly one value of Y in the given relation. The functional dependency is represented as X→Y, which specifies Y is functionally dependent on X or X attribute functionally determine the attribute Y. Consider the schema, student(rollno, name, sscper). rollno→name, rollno→sscper are the functional dependencies. rollno uniquely identifies name and sscper. That is, given rollno of a student, the name and sscper can be determined or searched.