Appitsimple interview question

stack or queue difference , some SQL query