SQL Quest

Lessons, hints, explained solutions, the in-browser PostgreSQL editor and practice answer checks in your browser are available. Graded assessments, recorded progress from answer checks and new certificates aren't available yet.

SQL for Business and Finance

Finance questions are definition questions. This track works through the reports finance and business analysts are asked for every month, on realistic fictional data: a retailer's revenue waterfall and product margins, a trading company's general ledger (opex, budget versus actual, variances, trial balance, P&L and balance sheet, bank reconciliation), a retail bank's balances and card spending, and a holding company's headcount, turnover and incentives. Every lesson states its accounting or HR definitions precisely (posted versus draft entries, fiscal periods, sign conventions by account type, favourable versus unfavourable variances, active-on-date headcount, salary in force) and shows the joins and filters that silently break them. Lessons 6 to 10 are advanced.

Lessons

  1. Revenue analysis: from gross sales to net revenueBuild the revenue waterfall from order lines: gross sales, discounts, net sales, refunds and net revenue, with precise definitions.22 min · 4 exercisesFree
  2. Product profitability and gross marginTurn sales into gross margin with unit costs: margin by category and product, products without a cost, and margin after returns.22 min · 4 exercises Members
  3. Operating expenses from the general ledgerRead journal lines correctly (posted only, by period, signed by account type) to report operating expenses by account, cost center and month.24 min · 4 exercises Members
  4. Budget versus actualPut budget and actual side by side at the same grain: aggregate first, then join, and keep unbudgeted spend and unspent budget visible.24 min · 4 exercises Members
  5. Variance reporting: favourable, unfavourable and materialCompute variance and variance %, label it favourable or unfavourable with the right rule for revenue and cost, flag material items and track year-to-date variance.24 min · 4 exercises Members
  6. The trial balanceBuild a trial balance at any period end, prove that debits equal credits, find the entries that break it, and roll prior-year profit into retained earnings.26 min · 4 exercises Members
  7. Financial statement extracts: P&L and balance sheetTurn ledger balances into a profit and loss statement with subtotals and a balance sheet that balances, using the account hierarchy and sign conventions.26 min · 4 exercises Members
  8. Bank and payment reconciliationMatch bank statement lines to the cash ledger and vendor payments by reference, then classify every difference: timing, amount, bank-only, ledger-only and duplicates.28 min · 5 exercises Members
  9. Account balances and activityDerive account balances at any date from an opening balance and signed transactions, follow running balances, and find accounts whose status no longer matches their activity.26 min · 4 exercises Members
  10. Transaction analysis: clean spending figuresMeasure customer spending correctly: define the transactions that count, remove reversed purchases and their reversals, roll categories up a hierarchy, and detect look-alike duplicates.26 min · 4 exercises Members
  11. Sales performance by channel, region and periodSlice net sales by channel, region and period, compute shares of total, year-over-year growth and average order value, and pick each channel's best month.24 min · 4 exercises Members
  12. Headcount, joiners, leavers and turnoverCount employees at a date from hire and termination dates, build monthly and yearly headcount series, measure joiners, leavers and turnover, and find the salary in force on a date.26 min · 4 exercises Members
  13. Incentive analysis: bonuses, ratings and payRelate bonus payouts to performance ratings and to salary in force, check who was eligible but not paid, and avoid the joins that multiply incentive totals.24 min · 4 exercises Members