Hint and exampleShowHide
Every row of the first table must appear even without a match, so use LEFT JOIN; the missing values come back as NULL.
Example: students(id, name) and hostels(student_id, room)
students hostels
id | name student_id | room
1 | Asha 1 | A-101
2 | Ravi
SELECT s.name, h.room
FROM students s
LEFT JOIN hostels h ON h.student_id = s.id;
-- Asha | A-101, Ravi | NULL