Anonymous Interview Question

I was asked write sql query