0
← Exercises/
Fundamentals•5 of 12
FundamentalsBeginnerPRO

Engineering Merit Compensation Audit

Scenario

The HR compensation committee is reviewing salary equity for engineering staff. They need a list of software engineers who received an outstanding performance rating (4.5 or above) but have an annual base salary under $160,000 to prioritize equity adjustments.

Task
Find all staff members in the `staff_roster` table who satisfy: 1. `department` is `'Engineering'` 2. `perf_rating` is greater than or equal to **4.5** 3. `base_salary` is strictly less than **$160,000.00** Return: 1. `emp_id` 2. `full_name` 3. `job_title` 4. `perf_rating` 5. `base_salary` Sort the output by `perf_rating` descending. If ratings match, sort by `base_salary` ascending.
Expected Output Format

High-performing engineers earning under $160k, sorted by rating descending and salary ascending.

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 “Engineering Merit Compensation Audit” SQL Problem

Business Scenario

The HR compensation committee is reviewing salary equity for engineering staff. They need a list of software engineers who received an outstanding performance rating (4.5 or above) but have an annual base salary under $160,000 to prioritize equity adjustments.

Expected Output & Criteria

High-performing engineers earning under $160k, sorted by rating descending and salary ascending.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

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

CREATE TABLE staff_roster (
        emp_id INT PRIMARY KEY,
        full_name VARCHAR(100) NOT NULL,
        department VARCHAR(50) NOT NULL,
        job_title VARCHAR(60) NOT NULL,
        perf_rating NUMERIC(3, 1) NOT NULL,
        base_salary NUMERIC(10, 2) NOT NULL
      );

Target SQL Clauses & Operators

WHEREANDORDER BY

Want more Fundamentals practice?

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

View Fundamentals Track→