Write SQL queries to extract and validate specific test data.
Use the test_cases, test_runs, and test_results tables. Return the latest available result for every active test case and classify whether the result matches the expected status.
test_case_id, test_name, latest_run_id, executed_at, expected_status, actual_status, and validation_result.VALID, MISMATCH, or NOT_EXECUTED; order by test_case_id ascending.| Column | Type | Description |
|---|---|---|
| test_case_idPK | INT | Unique test case identifier |
| test_name | VARCHAR(150) | Name of the automated test |
| suite_name | VARCHAR(100) | Test suite containing the case |
| expected_status | VARCHAR(20) | Expected result status |
| is_active | BOOLEAN | Whether the test case is active |
| Column | Type | Description |
|---|---|---|
| run_idPK | INT | Unique test run identifier |
| executed_at | TIMESTAMP | Time when the run was executed |
| environment | VARCHAR(30) | Execution environment |
| Column | Type | Description |
|---|---|---|
| result_idPK | INT | Unique test result identifier |
| test_case_id | INT | Referenced test case |
| run_id | INT | Referenced test run |
| actual_status | VARCHAR(20) | Observed result status |