Unknown Planner interview question

Write a query and procedure while attending interview