Symmetric Reply Network
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L3
Problem
The chat_messages table has sender and reply_to columns. Produce a symmetric view of the reply network: if user A replied to user B, the output should include both (A, B) and (B, A). Show each pair of user IDs.
Summary
Who replies to whom? Both directions.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.