Pregunta de entrevista de Alpha Payments

pattern question + sql query