SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Tenure-Based Salary Analysis

Build mastery in Aggregations with this scenario-based SQL challenge and live execution support.

Problem Statement

Bucket employees by tenure measured from the frozen anchor date 2025-01-01: • "New (< 2 years)" → hired on or after 2023-01-01 • "Mid (2-4 years)" → hired on or after 2021-01-01 and before 2023-01-01 • "Senior (4+ years)" → hired before 2021-01-01 Return tenure_group, employee_count, avg_salary (rounded to 2 decimals), min_salary, max_salary. Sort by avg_salary descending.

Relevant Tables

employees

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: