Consumer Lending Analyst Path · Mission 10 of 30Easy

Originations by LO (top 10)

GROUP BY a TEXT column with a trailing-space defensive TRIM

The Brief

Jennifer WhitmanMortgage Sales Directorconsumer-lending

Comp committee meets Friday. Pull the top 10 LOs by funded count from the last 6 months — `funded_date >= '2025-11-01'`. Two columns: `lo_name`, `origination_count`. Sort by count descending, name ascending for tie-breaks. Heads up — the data quality team flagged a trailing-space issue on `lo_name`. Sarah Chen's record sometimes has a trailing space and her counts get split across two rows. TRIM the names so her totals consolidate before the comp grid sees this.

You'll practice

GROUP BYORDER BYTop-NTrailing-space gotcha

Tables & columns available

lending_originationsfact17 columns
ColumnTypeKey
origination_idINTPK
app_idINTFK → lending_applications
account_idINTFK → retail_accounts
funded_dateTEXT
funded_amountREAL
term_monthsINT
interest_rateREAL
rate_typeTEXT
arm_reset_dateTEXT
fico_at_origINT
dti_at_origREAL
ltv_at_origREAL
property_valueREAL
lo_nameTEXT
channelTEXT
current_statusTEXT
closed_dateTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Date filter on `funded_date` for the 6-month window, GROUP BY the LO, count and Top-N — standard rollup shape.

Hint 2

Trailing-space gotcha: identical-looking names with and without trailing whitespace group separately. Apply a string-trim function to the column in BOTH the SELECT projection AND the GROUP BY so the rows merge into one count.

Hint 3

Two-key sort (count desc, name asc) and a row cap at the comp committee's review window. If the count comes back at 11 rows, the trim isn't applied consistently across both clauses.