The Freshest Record
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L5
Problem
The observability team is cleaning up server logs ahead of a weekly review. Same server emitting the same message multiple times should appear only once, keeping the most recent occurrence. After that, narrow the result to entries from the last 7 days. Show every column from the surviving rows.
Summary
Duplicates everywhere. Only the most recent version of the truth survives.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.