Thomson Reuters Interview Question

How do you convert stack to queue? SQL query to find the peak element.