Career Hub/Interview questions/Inactive Traders
Robinhood logo

Inactive Traders

Robinhood·easy·SQL

Find all users who signed up more than 30 days ago but have never placed a trade. Return their user_id, name, and signup_date, ordered by signup date ascending.

Schema

users
user_idINTEGER
nameVARCHAR
cityVARCHAR
signup_dateDATE
trades
trade_idINTEGER
user_idINTEGER
symbolVARCHAR
quantityINTEGER
priceDECIMAL
trade_dateDATE

Target output

Target output
user_idnamesignup_date
11Tina Alvarez2023-11-02
3Sarah Chen2024-01-05
7Marcus Webb2024-01-19

What this question tests

Tests the anti-join: finding rows in one table that have no match in another, plus a date cutoff. Interviewers use it to see whether you reach for NOT EXISTS or a LEFT JOIN with an IS NULL check rather than NOT IN, and whether you can express a rolling cutoff like more than 30 days ago cleanly.

More SQL interview questions

  • Underperforming Drivers · Lyft · medium
  • Longest Trading Streak · Coinbase · hard
  • Sending vs Opening Snaps · Snapchat · medium
Queryusers, trades
Cmd+Enterto runLoading...
Output

Loading sample data...