Wise Interview Question

How to structure a complex SQL query (technical test)