SQL QuestSQL Interview Questions › Joins

Users Who Never Sent Money

MediumFreeQuerying BasicsJoinsNULL Handling

The anti-join: find the people a table does NOT mention. Peer-to-peer sends are rows in transactions with type = 'transfer_out'. List the users who have never sent one, whatever its status.

Return user_id, country, plan and signup_date from users. Order by signup_date ascending, then user_id ascending.

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

users

user_idsignup_datecountryhome_currencyplanplan_sincekyc_verified_atreferred_bybirth_year
12025-06-01IEEURstandard2025-06-012025-06-03 16:00:00NULL1972
22025-06-02FREURstandard2025-06-022025-06-04 16:00:00NULL1979
32025-06-03GBGBPstandard2025-06-032025-06-08 04:00:00NULL1977

transactions

txn_iduser_idtstypeamountcurrencyamount_gbpfee_gbpmerchant_categorymerchant_countrycounterparty_user_idstatusdecline_reason
112025-06-14 11:01:51fx_exchange32271.15JPY167.811.68NULLNULLNULLcompletedNULL
212025-06-14 11:17:45bill_payment59.53EUR50.60utilitiesIENULLcompletedNULL
372025-06-16 10:06:38card_payment122.27EUR103.930shoppingESNULLcompletedNULL

Expected output: user_id=1, country=IE, plan=standard, signup_date=2025-06-01 ...

Hint

LEFT JOIN transactions t ON t.user_id = u.user_id AND t.type = 'transfer_out' — the type condition goes in the ON clause, not WHERE, or the LEFT JOIN turns into an inner one. Then WHERE t.txn_id IS NULL.

Concepts

SELECT LEFT JOIN NULL Handling WHERE Anti-Join

Practise the topic: SQL practice questions · JOIN practice · NULL handling practice

In these company practice sets

Revolut

A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.

Related questions

Customers Who Never OrderedMedium · FreeAbove-Average Departments (Derived Table)Medium · FreeLEFT JOIN NULL Semantics: Inactive CustomersMedium · FreeManagement Hierarchy OverviewMedium · FreeCount Direct ReportsMedium · FreeCustomer Recency AnalysisMedium · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test