Apex Systems QA engineers use a test execution table to track results from automated and manual validation runs. Write a PostgreSQL query that returns the latest execution for every active test case.
ROW_NUMBER() to rank executions separately for each test_case_id.executed_at. If timestamps tie, use the greatest execution_id as the deterministic tie-breaker.| Column | Type | Description |
|---|---|---|
| test_case_idPK | INTEGER | Unique test case identifier |
| test_case_name | VARCHAR(150) | Descriptive test case name |
| is_active | BOOLEAN | Whether the test case is currently active |
| Column | Type | Description |
|---|---|---|
| execution_idPK | INTEGER | Unique execution identifier |
| test_case_id | INTEGER | Referenced test case |
| status | VARCHAR(20) | Execution result |
| environment | VARCHAR(30) | Execution environment |
| executed_at | TIMESTAMPTZ | Execution completion timestamp |
| tester_email | VARCHAR(150) | QA engineer or automation account |