Loading...

Latest Metric Values

A easy SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
easy
Seniority
junior

Problem

Some rows in the employee metrics table have outdated values for the same department and metric name. Treat the highest metric value as the current one, and keep only that row for each unique department and metric combination. If there are ties, return any one. Results should appear by department ascending.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.