Ergeon interview question

How would you write a complex SQL query?