Intellect Design Arena interview question

Write SQL query and java code to remove duplicates