Hard
SQL-J09sqlFull-Outer Reconcile
Problem
You have `legacy_users(id, email)` and `new_users(id, email)`. Find every record that exists in only one table OR has the same id but different email — sorted by id. SQLite has no FULL OUTER JOIN — emulate it.
Input
Two tables.
Output
id, legacy_email, new_email
Constraints
1 ≤ rows ≤ 10^5
Sample input
(1,'a@x'),(2,'b@x') vs (1,'a@x'),(3,'c@x')
Sample output
2 | b@x | NULL 3 | NULL | c@x
Explanation
FULL OUTER = LEFT UNION (RIGHT minus inner).
joinsfull-outerunion-all@Snowflake
Visible test cases
in: see
out: ...
Your solution — run it, use AI if stuck
sql
