MySQL subquery with EXISTS and NOT EXISTS
When a subquery is used with EXISTS or NOT EXISTS operator, a subquery returns a Boolean value of TRUE or FALSE . The subquery acts as an existence check.
In the following example, we select a list of customers who have at least one order with total sales greater than 10K.
First, we build a query that checks if there is at least one order with total sales greater than 10K: