Anonymous interview question

I was asked write sql query