LG Electronics interview question

typical SQL questions and some coding