Frage im Vorstellungsgespräch bei Amazon

SQL medium hard question and a simple reverse a sentence string.