About the “Clean Marketing Lead Ingestion” SQL Problem
Business Scenario
The demand generation team is auditing organic and paid acquisition leads. Some lead records contain missing utm_source values or duplicate records from retargeting pixels. They need a pristine list of unique, valid acquisition channels and countries.
Expected Output & Criteria
Unique list of acquisition_channel and country_code with no null or unknown values, alphabetically sorted.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE leads (
lead_id INT PRIMARY KEY,
email VARCHAR(120) NOT NULL,
acquisition_channel VARCHAR(50),
country_code VARCHAR(3),
lead_score INT NOT NULL
);Target SQL Clauses & Operators
Want more Fundamentals practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.