Loading...
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
- junior, mid
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.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.