SQLSQL
#15

Financial Reconciliation with FULL OUTER JOIN in SQL

MediumPwC
Interview Question #15
Asked at PwC

You have `bank_settlements` and `internal_ledger`. Write a SQL query using a `FULL OUTER JOIN` to show all transactions from both sources, indicating whether each transaction exists in 'Both', 'Bank Only', or 'Internal Only'.

Input Table: bank_settlements & internal_ledger
3 rows preview
bank_txn_idinternal_txn_id
TXN_101TXN_101
TXN_102NULL
NULLTXN_103
Expected Output Structure3 rows
txn_referencereconciliation_status
TXN_101Matched Both
TXN_102Bank Only
TXN_103Internal Only
Interview Context

Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.

SQLPostgreSQL 15
Ready to execute

Click "Run Query" or press Ctrl + Enter to test your query.

Output will be verified against the test dataset.

Chat with us