Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Roommate Pairs

Return every pair of students who share a room (smaller id first), ordered by room then pair.

Table schema

Students(id INT PRIMARY KEY, name VARCHAR(10), room INT)

Sample data

id | name | room
1 | Ann | 101
2 | Bob | 101
3 | Cy | 102
4 | Dee | 102
5 | Eli | 103

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.