Fraud

If you work in fraud, it's crucial to keep monitor suspicious behavior on your platform. Let's take a look at some popular queries to track and sample SQL queries:

Users with multiple accounts using the same email

SELECT email, COUNT(*) AS num_accounts 
FROM users 
GROUP BY email 
HAVING num_accounts > 1;

Users with abnormally high transaction amounts

SELECT user_id, COUNT(*) AS num_large_transactions
FROM transactions
WHERE amount > (SELECT AVG(amount) + 3 * STDDEV(amount) FROM transactions)
GROUP BY user_id;

Users with rapid succession of transactions

SELECT user_id, COUNT(*) AS num_fast_transactions
FROM transactions
WHERE TIMESTAMPDIFF(MINUTE, previous_timestamp, timestamp) < 1
GROUP BY user_id;

Transactions with mismatched billing and shipping addresses

SELECT transaction_id, billing_address, shipping_address 
FROM transactions 
WHERE billing_address <> shipping_address;

Users with transactions from multiple countries

Transactions with suspiciously high chargeback rates

Users with multiple failed login attempts

Users with abnormally high transaction frequency

Users with high count of declined transactions

Users with multiple credit cards

Transactions with unusually high shipping costs

Users who have used multiple IP addresses

User with multiple accounts using the same phone number

Transactions with perfectly round amounts

Users with a high rate of coupon usage

Transactions with suspiciously low selling price

Users who have made transactions in a short time frame

Transactions with unusually high quantities

Users with multiple transactions using different billing names

Last updated