X interview question

Some basic table manipulation in SQL