Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL statement to prove that A->B in a R(ABCD)

Tags:

sql

How do I write a SQL statement that proves the functional dependency A → B holds given a relation with attributes ABCD knowing that no record has NULL values?

like image 442
Cata Avatar asked Oct 18 '25 20:10

Cata


1 Answers

SELECT * from R r1, R r2 where r1.A=r2.A and r1.B <> r2.B

This should return an empty set if the FD holds.

like image 117
Greg Avatar answered Oct 20 '25 09:10

Greg