About the “Department Salary Percentile with PERCENT_RANK()” SQL Problem
Business Scenario
Compensation committees evaluate how an individual employee's salary compares relative to peers in the exact same department on a normalized 0.0 to 1.0 percentile scale.
Expected Output & Criteria
Employee salary percentile within department on a 0.00 to 1.00 scale.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE corp_payroll (
emp_id INT PRIMARY KEY,
full_name VARCHAR(100) NOT NULL,
department VARCHAR(50) NOT NULL,
salary NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
PERCENT_RANKOVERPARTITION BYROUND
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.