GEP interview question

Sql question to find out second highest salary And java question to write count of string