Shell interview question

I was asked about to write a complex SQL statement