0
← Exercises/
Business Analytics•3 of 14
Business AnalyticsAdvanced

Sanctions List Screening with Case-Insensitive Pattern Matching

Scenario

Global banks must continuously screen wire transfer beneficiary names against OFAC (Office of Foreign Assets Control) sanctions lists to block terrorism and sanctioned state entities.

Task
Join `outgoing_wires` with `sanctions_blacklist` matching on normalized uppercase name comparison (`UPPER(TRIM(w.beneficiary_name)) = UPPER(TRIM(s.sanctioned_entity_name))`). Return: 1. `w.wire_id` 2. `w.beneficiary_name` 3. `w.amount_usd` 4. `s.sanction_program` 5. `s.listing_date` Order results by `w.amount_usd` descending, then by `w.wire_id` ascending.
Expected Output Format

Flagged wire transfers matching sanctioned names on official watchlists.

Input Tables & Sample Data0 tables
Loading database schema...
Need a hint?
query.sql|Local Sandbox
Loading SQL editor...
Click "Run" or press ⌘ + Enter to execute your query

About the “Sanctions List Screening with Case-Insensitive Pattern Matching” SQL Problem

Business Scenario

Global banks must continuously screen wire transfer beneficiary names against OFAC (Office of Foreign Assets Control) sanctions lists to block terrorism and sanctioned state entities.

Expected Output & Criteria

Flagged wire transfers matching sanctioned names on official watchlists.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

This challenge executes directly against the following relational schema in your browser:

CREATE TABLE sanctions_blacklist (
        sanction_id INT PRIMARY KEY,
        sanctioned_entity_name VARCHAR(100) NOT NULL,
        sanction_program VARCHAR(50) NOT NULL,
        listing_date DATE NOT NULL
      );

      CREATE TABLE outgoing_wires (
        wire_id VARCHAR(16) PRIMARY KEY,
        beneficiary_name VARCHAR(100) NOT NULL,
        amount_usd NUMERIC(10, 2) NOT NULL
      );

Target SQL Clauses & Operators

JOINUPPERORDER BY

Want more Business Analytics practice?

Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.

View Business Analytics Track→