Frequent Host-Guest Pairs
Problem
Table: `recording_session`
| Column Name | Type |
|---|---|
| host_id | int |
| guest_id | int |
| session_no | int |
`session_no` is the primary key. Each row records that a podcast host and a guest recorded an episode together.
Find every `(host_id, guest_id)` pair that has recorded together **at least three times**. Return the result in any order.
Tables
Example rows — the live problem includes the full dataset.
recording_session
| host_id | guest_id | session_no |
|---|---|---|
| 1 | 1 | 0 |
| 1 | 1 | 1 |
| 1 | 1 | 2 |
Expected output
Your answer should return 1 row with the columns host_id, guest_id.
Starter code (SQL)
SELECT *
FROM recording_session;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock