How would you write a SQL query to analyze loan origination data with multiple joins and aggregations at BHG Financial?