How would you implement a data validation check in SQL?
Validate each record for a nonblank record key, an allowed status, an event date in 2025, and a non-null amount that is zero or greater. Return every record, including valid records, and identify all applicable validation issues.
record_id, record_key, validation_status, and validation_errors.validation_status to VALID or INVALID; combine multiple issues in validation_errors.record_id ascending.| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique identifier for the record |
| record_key | VARCHAR(40) | Business key that should be present and nonblank |
| status_code | VARCHAR(20) | Status that must exist in the allowed-status reference table |
| event_date | DATE | Date required to fall within calendar year 2025 |
| amount | NUMERIC(10,2) | Value that must be non-null and non-negative |
| Column | Type | Description |
|---|---|---|
| status_codePK | VARCHAR(20) | Recognized status code |
| status_label | VARCHAR(60) | Description of the recognized status |