WebXpress interview question

SQL query for fetch data