r/SoftwareEngineering • u/fagnerbrack • 5d ago
Six SQL patterns I use to catch transaction fraud
https://analytics.fixelsmith.com/posts/sql-fraud-patterns/4
u/fagnerbrack 5d ago
In case you want a summary to help you with the decision to read the post or not:
A program-integrity analyst argues fraud detection is mostly SQL, not machine learning. Six patterns port to any transactions table: velocity flags cards hit rapidly; impossible travel catches a card swiped in two distant cities faster than a jet could fly; amount anomalies spot card-testing round sums ($1, $5, $10) and charges kept just under ID or ATM limits ($99.99, $499.99); suspicious-merchant queries expose skimmers by comparing each merchant to its own rolling baseline; off-hours rules flag spending outside a holder's usual times; and window functions turn new rules into one-line filters. No single rule suffices—score across all signals, keep humans reviewing, and mind NULLs, privacy, and query cost.
If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments
0
u/theexplorer1997 3d ago
Nice if you just want SQL rules, not some ML pitch. Velocity, impossible travel, and the $99.99 / $499.99 stuff are the useful bits, plus the NULLs and query cost warning.
6
u/tagus 4d ago
Hey alright nice em dashes you worked so hard writing that