Inner Join
INNER JOIN is the default JOIN. Only rows with a match on both sides. A student with no marks row disappears from the result. A marks row with a bad roll (no student) also disappears.
SELECT s.name, m.score FROM students s INNER JOIN marks m ON s.roll = m.roll; Same as JOIN without the word INNER.
Use INNER when you only want complete pairs. Use LEFT when you still need students with no marks.
Trap — INNER JOIN then wondering why 2 of 30 students vanished — they had no child rows.
On the example next to this theory — Inner Join — jOIN combines rows using a match condition between tables.
students.id
=
marks.student_id
│
▼
one result rowINNER JOIN = only matches. LEFT JOIN if you need unmatched left rows.