Write a SQL query to verify that a user transaction was successfully recorded with the correct status flags. Compare each transaction's recorded flags with its expected flags and retain transactions even when no expectation record exists.
verification_status.verification_status to MATCH, MISMATCH, or MISSING_EXPECTATION.transaction_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | Display name of the user |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| recorded_at | TIMESTAMP | Time the transaction was recorded |
| is_recorded | BOOLEAN | Whether the transaction was recorded |
| is_successful | BOOLEAN | Whether the transaction succeeded |
| is_posted | BOOLEAN | Whether the transaction was posted |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Transaction being validated |
| expected_is_recorded | BOOLEAN | Expected recorded flag |
| expected_is_successful | BOOLEAN | Expected successful flag |
| expected_is_posted | BOOLEAN | Expected posted flag |