Write an SQL query to join a test results table with a defects table and show the number of defects per test run.
Use the provided test_results and defects tables. Include test runs that have no matching defects.
test_run_id and defect_count.test_results, including zero-defect runs.test_run_id ascending.| Column | Type | Description |
|---|---|---|
| result_idPK | INT | Unique identifier for a test result |
| test_run_id | INT | Identifier of the test run |
| test_name | VARCHAR(100) | Name of the executed test |
| status | VARCHAR(20) | Outcome of the test result |
| Column | Type | Description |
|---|---|---|
| defect_idPK | INT | Unique identifier for a defect |
| test_result_id | INT | Identifier of the test result associated with the defect |
| defect_code | VARCHAR(30) | Reference code for the defect |
| severity | VARCHAR(20) | Defect severity classification |