About the “Card Transaction Velocity with Window COUNT()” SQL Problem
Business Scenario
Automated credit card fraud bots test stolen card numbers by making rapid micro-transactions in quick succession. Risk engineers use cumulative window counts to detect card usage frequency.
Expected Output & Criteria
Transaction log showing the incremental card usage sequence number.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE card_transactions (
txn_id INT PRIMARY KEY,
card_token VARCHAR(20) NOT NULL,
merchant_name VARCHAR(80) NOT NULL,
amount_usd NUMERIC(10, 2) NOT NULL,
txn_time TIMESTAMP NOT NULL
);Target SQL Clauses & Operators
COUNTOVERPARTITION BY
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.