The SQL EXISTS
predicate is used to specify a test for a non-empty set. It returns TRUE
or FALSE
, depending on the outcome of the test.
When we incorporate the EXISTS
predicate operator into our SQL queries, we specify a subquery to test for the existence of rows. If there are any rows, then the subquery is TRUE
. If there are no rows, then the subquery is FALSE
.