Employees Sharing a Birthday
Medium
Pairing & Matching Queries
Return pairs of different employees (smaller id first) who share the same month and day of birth. Order by the pair.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(10), birth_date DATE)Sample data
id | name | birth_date
1 | Ann | 1990-03-05
2 | Bob | 1985-03-05
3 | Cy | 1992-07-21
4 | Dee | 2000-03-05
5 | Eli | 1991-07-22
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.