Loading the editor…
List the ledger accounts that hold cash or record operating expenses.
The controller is building a close checklist and wants the balance-sheet cash account next to the expense accounts that hit this month.
Return name and account_type for accounts whose type is asset or expense. Sort by name.
| id | name | account_type |
|---|---|---|
| 1 | Cash | asset |
| 2 | Accounts Payable | liability |
| 3 | Sales Revenue | revenue |
| id | name | category |
|---|---|---|
| 1 | Harbor Office | Facilities |
| 2 | Northwind Cloud | Software |
| 3 | City Clinic Supplies | Medical |
| id | vendor_id | amount_cents | issued_on | due_on | paid_on | status |
|---|---|---|---|---|---|---|
| 1 | 1 | 180000 | 2025-01-02 | 2025-01-31 | 2025-01-20 | paid |
| 2 | 2 | 42000 | 2025-01-05 | 2025-02-04 | 2025-02-10 | paid |
| 3 | 2 | 42000 | 2025-02-05 | 2025-03-07 | NULL | open |
| id | account_id | txn_date | amount_cents | direction | memo | status |
|---|---|---|---|---|---|---|
| 1 | 4 | 2025-01-20 | 180000 | debit | January rent | posted |
| 2 | 5 | 2025-02-10 | 42000 | debit | Cloud january | Posted |
| 3 | 6 | 2025-01-28 | 250000 | debit | Payroll | POSTED |
Ctrl or Cmd + Enter runs the query. The database resets on every run.
Run the query to see rows from the sample database.
Next exercise: Outpatient visits in 2025
Related: Trim vendor names, Monthly posted expenses