How would you recognize potential fraud within a dataset?
Using the supplied transactions, customers, and devices tables, identify transactions with at least two of these indicators: amount of at least 1,000, country different from the customer's home country, device first seen within seven days, or another transaction by the same customer within ten minutes.
Output
- One row per potential fraud transaction with
transaction_id, customer_id, transaction_timestamp, amount, high_amount, country_mismatch, new_device, rapid_repeat, and risk_score.
- Include only transactions with at least two indicators, ordered by
risk_score descending, then timestamp ascending, then transaction ID ascending.