Credit Risk & Banking Path · Mission 3 of 30Starter

Open accounts right now

COUNT with a WHERE filter using IS NULL

Back to Credit Risk & Banking

The Brief

Priya RamanathanVP Retail Bankingretail-banking

Weekly scorecard for the ops call — how many accounts are currently open? `banking_accounts` has a `close_date` that's NULL for any account still on the books. Single number, call the column `open_accounts`.

You'll practice

COUNTWHEREIS NULL

Tables & columns available

banking_accountsdim8 columns
ColumnTypeKey
account_idINTPK
customer_idINTFK → banking_customers
product_typeTEXT
open_dateTEXT
close_dateTEXT
credit_limitREAL
current_ficoINT
statusTEXT

Hints (3)

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

Hint 1

Accounts still on the books have a specific data pattern in the close column. How does SQL test for the absence of a value — and why can't you use = for this?

Hint 2

Count rows from banking_accounts where close_date is absent — alias the column open_accounts so the scorecard cell binds correctly.

Hint 3

You could also check `status = 'Open'` — in this seed the two are consistent, but `close_date IS NULL` is the more defensive query because it doesn't depend on status being kept up to date.