I have a list of email addresses in the Java code and I would like to check if any of these already exists in the MySQL database.

For example:

1. `a@a.com`
2. `b@b.com`
3. `c@c.com`

I want to know if any of the above email ids is already present in the table, and if they do, I would like to pull or separate them out. 

I am not sure how to achieve this. Should I try this in Java or use SQL to achieve the desired result?