What SQL queries have you used to validate data during testing?
Using the supplied tables, write one query that identifies orders whose stored total does not agree with their item total or payment total. The query must also identify orders with no items or no payments.
order_id, order_total, item_total, payment_total, and validation_statusorder_id ascending| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| order_total | NUMERIC(10,2) | Stored total expected for the order |
| Column | Type | Description |
|---|---|---|
| item_idPK | INT | Unique order item identifier |
| order_id | INT | Order associated with the item |
| line_total | NUMERIC(10,2) | Total value of the item line |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| order_id | INT | Order associated with the payment |
| payment_amount | NUMERIC(10,2) | Amount applied by the payment |