Buried Digits
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant feedback.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L4
Problem
The release team wants to compare deploy versions as plain numbers, but each log records the version with a leading 'v' and dots or dashes between the parts, like 'v1.2-3'. The environment field was typed with inconsistent capitalization, and only the deploys whose environment is stored as the exact lowercase word 'staging' should count, so 'STAGING' and 'Staging' fall outside the set. For those rows, drop the 'v' and the dot and dash separators so the digits run together, and return that value as an integer beside the service name.
Summary
The version number is buried in the log.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and checks it automatically.