Write a SQL query to calculate a running total of daily balances by account for Crédit Agricole Cib.
Use the accounts and account_balances tables. Include accounts with balance records only, and calculate the cumulative total independently for each account.
account_id, account_name, balance_date, daily_balance, and running_total.account_id, then balance_date ascending.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_name | VARCHAR(120) | Account holder or institutional account name |
| account_type | VARCHAR(30) | Classification of the account |
| Column | Type | Description |
|---|---|---|
| balance_idPK | INT | Unique balance record identifier |
| account_id | INT | Referenced account identifier |
| balance_date | DATE | Date associated with the daily balance |
| daily_balance | NUMERIC(14,2) | Balance amount recorded for the date |