PwC interview question

Some medium difficulty questions from SQL