SpinTheMic
Pro

Interview practice question

Join missing matches due to messy keys

Data Engineering · SQL · Beginner

A join between two tables on product_code returns far fewer matches than expected, though the codes look the same. What do you check?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Hidden spaces, different case or leading zeros make keys differ.
  • Different data types, like number vs string, can drop zeros.
  • Compare LENGTH and sample values from both sides.
  • Clean keys with TRIM, UPPER or LPAD in staging.
  • Add tests so dirty keys are caught early.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics