Which rows will a JOIN between users and events return?

This query finds users who have had a view event. Examine how the tables are joined, then choose the table the query will return.

Predict the resultJOIN and row countsJuniorAnalystData EngineerBackendQA
Input data · iv_users
idemailtopics
1ann@example.comsql,python
2NULLmysql
3boris@example.compython,sql
4clara@example.comnosql,go
5dan@example.comsql
Input data · iv_events
iduser_idevent_typecreated_at
11login2026-01-31 23:59:00
21login2026-01-31 23:59:00
31view2026-02-01 00:00:00
42login2026-02-01 08:00:00
52view2026-02-01 08:05:00
62view2026-02-01 08:05:00
73login2026-02-02 10:00:00
8NULLview2026-02-03 11:00:00
91purchase2026-02-03 12:00:00
102logout2026-02-28 23:59:59

Query

SELECT u.id AS user_id
FROM iv_users u
JOIN (
  SELECT DISTINCT user_id
  FROM iv_events
  WHERE event_type = 'view'
    AND user_id IS NOT NULL
) v ON v.user_id = u.id
ORDER BY u.id