Wag! Interview Question

Technical PHP/JS/SQL challenges, not very difficult to resolve it.