internalsGet Pro

Module 02 · Lesson 1 of 12Pro

Join pitfalls: duplicated and missing rows

Level
Intermediate
Topic
SQL for data engineering
Reading time
16 min

When you finish this page you can

  1. Predict how many rows a join returns from the number of matches each row has.
  2. Fix a one-to-many join that multiplies revenue by bringing the other table to the report’s grain first.
  3. Find the rows an inner join drops, and choose between inner, left, semi and anti joins.
  4. Check a join by comparing row counts, distinct keys and sums before and after it.
  1. Design: a first analytics pipeline for an online store30 min

Revenue went up when Meera added a column

is an online store in India. Every night its data team copies the day’s orders from the store’s PostgreSQL database into an analytical database, and Daniel, who leads finance reporting, reads yesterday’s revenue at 07:00.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan