04 Try it yourself Interactive

Step one student at a time through all four joins

Four student rows, three department rows, one condition: s.did = d.did. Pick a join type and press Next. Each press takes one student row and tests it against all three department rows: it emits one result row per pairing that came out true, and for a join that protects the left table it emits a single NULL-extended row when none came out true. RIGHT and FULL then take one more press per department row that nothing matched. Kiran has no department and MECH has no students, and what each join type does with those two rows is the entire exercise. The mentor column plays no part in this join, so it is left out of the panes. Nothing plays on its own: Next, Back and Reset, or the arrow keys.

INNER JOIN
unmatched rows on both sides are dropped
Indigo is the row being worked on now, and the result row it produces. Emerald is a department row the condition just matched. Amber is a department row nothing has matched. Rose is a row that is about to be thrown away.
Press Next to begin. Each press takes one student row.


      
Now scanning
Pairings tested0
Rows emitted0
Carried with NULLs0
step 0 / 0