Procurement & Sourcing Analytics · Mission 4 of 30Starter

Active contract count

COUNT with date range filter

The Brief

Maya ChenProcurement Directorprocurement-ops

How many contracts in `dim_contracts` are active as of 2025-06-01? Active means today is between start_date and end_date.

You'll practice

COUNTWHERE

Tables & columns available

dim_contractsdim7 columns
ColumnTypeKey
contract_idINTPK
supplier_idINTFK → dim_suppliers
category_idINTFK → dim_categories
start_dateTEXT
end_dateTEXT
contracted_unit_priceREAL
discount_threshold_qtyINT

Hints (3)

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

Hint 1

A contract is active when today's date falls inside its window — there's a SQL operator for 'falls between two values'.

Hint 2

Use COUNT(*).

Hint 3

Alias as active_contract_count.