Pergunta de entrevista da empresa Logicsoft International

In coding question the interviewer asked me to find the second largest element in array by using brute force approach. In SQL there were like some datatype questions and find second max salary.