Practice a LEFT JOIN unmatched check by predicting which orders keep NULL customer cells after the join and filter.

highlighted = computed this step

Orders input

Mark each order key as matched, missing, or NULL before looking at the query.

classify order keys\text{classify order keys}
Ordersorder_idcustomer_idamounto1c1120o2c280o3c_missing50o4NULL40

Customers input

Use the customer table as the exact list of keys that can match.

available customer keys\text{available customer keys}
Customerscustomer_idsegmentc1retailc2wholesale

Join query

LEFT JOIN first, then keep only rows where the right customer key is NULL.

LEFT JOIN unmatched check\text{LEFT JOIN unmatched check}
LEFT JOIN unmatched exercisewhere is_nullarity 5 rows 2left join customer_id=customer_idarity 5 rows 4Ordersarity 3 rows 4Customersarity 2 rows 2

Joined output

The output is the hand-check list of unmatched left rows.

check unmatched orders\text{check unmatched orders}
Joined outputorder_idcustomer_idamountCustomers.customer_idsegmento3c_missing50NULLNULLo4NULL40NULLNULL