Pregunta de entrevista de Finastra

How do I search the specific information in SQL and sort it?