Thank you for your response, Martin.
What I meant by database processing in code was that to perform operations (like remove) in
Java after I fetch the records. To give an example, I want to remove all invalid telephone numbers that have bypassed the form validation.
The third possibility mentioned above looks like it will come in handy. Any way MySQL supports this? Searching the internet did not give any relevant results.