Explaining the approach to solving a few complex SQL queries.