What are some risks with this schema?
Inspect the supplied tables and write a SQL query that identifies transaction records affected by common integrity and data-quality risks. Include records with missing or invalid relationships, inactive or incomplete accounts, invalid amounts, missing currencies, and duplicate external references.
Output
- One row per transaction with at least one detected risk
- Include the transaction identifier, reference, related identifiers, risk flags, and duplicate-reference count
- Sort by
transaction_id ascending