Left Join vs Right Join
LEFT keeps the left table complete. RIGHT keeps the right table complete. Same power. Teams pick LEFT and put the important table first.
Example: all students + marks if any → students LEFT JOIN marks. All marks + student name if any → marks LEFT JOIN students (or students RIGHT JOIN marks).
Trap — saying they return the same rows without swapping tables.
On the example next to this theory: Left Join vs Right Join — jOIN combines rows using a match condition between tables.
students.id
=
marks.student_id
│
▼
one result rowExam tip
LEFT vs RIGHT = which table is mandatory. Prefer LEFT.