About the “Recursive Loan Balance Paydown Schedule” SQL Problem
Business Scenario
Consumer lending systems calculate loan repayment schedules. Simulate 4 monthly payments of $300 on an initial $1,000 principal loan with 0% interest using a Recursive CTE.
Expected Output & Criteria
Monthly paydown schedule showing remaining loan balance after 4 periods.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE loan_config (
loan_id INT PRIMARY KEY,
initial_principal NUMERIC(10, 2) NOT NULL,
monthly_payment NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
WITHRECURSIVEUNION ALL
Want more CTEs practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.