About the “Customer Loyalty Tier Classification with CASE WHEN” SQL Problem
Business Scenario
LuxeApparel is launching a VIP reward program. Marketing wants a segmented view of customer accounts categorizing their spend into loyalty tiers: 'Platinum' for $5,000+, 'Gold' for $2,000 - $4,999.99, 'Silver' for $500 - $1,999.99, and 'Bronze' for below $500.
Expected Output & Criteria
Customer profiles with computed loyalty tier labels sorted by lifetime spend.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE loyalty_members (
member_id INT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
lifetime_spend NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
Want more Fundamentals practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.