The route

Two inputs: joins

Download the exercise files

A SQL node can take more than one input — connect two sources and it sees two tables. This level wires customers and orders into one query and answers a question neither file can answer alone: which customers have never ordered anything?

Goal

A SQL node with two inputs that lists the 27 customers with no orders, using a LEFT JOIN.

You'll need

  • The exercise files for this level: customers.csv (the same 500 customers as World 1), orders.csv (3,000 orders from 2025) and products.csv (8 products — used from 3.3 on).
  • About 20 minutes.

Steps

1. Two sources, one SQL node

Create a pipeline w3-2-join. Add two CSV Source nodes, customers and orders, and a SQL node customers_without_orders.

Connect customers first, then orders.

2. Name the tables

Click the SQL node and look under the query editor, at Inputs — one row per connected source. Left empty, an input is numbered in the order you connected it: customers is input1, orders is input2 (with a single input, the table is also just input). Numbers are fragile — reconnect the sources the other way round and input1 becomes orders.

Give them names instead: type customers in the first box and orders in the second, pressing Enter after each. Letters, digits and _, not starting with a digit.

Each input named, so the query can use real table names

Now the query reads like the question:

SELECT c.customer_id, c.first_name, c.last_name, c.plan
FROM customers AS c
LEFT JOIN orders AS o
  ON o.customer_id = c.customer_id
WHERE o.order_id IS NULL
ORDER BY c.customer_id

3. Read the LEFT JOIN

  • LEFT JOIN keeps every customer, whether or not an order matches. Customers without a match get empty (NULL) values in every o. column.
  • WHERE o.order_id IS NULL then keeps only those unmatched rows — the customers who never ordered.

Replace LEFT JOIN with a plain JOIN and the result is empty: an inner join only keeps rows that match on both sides, so the customers you're looking for are exactly the ones it drops.

4. Execute

Add a Console (Row Limit 30) after the SQL node, Execute, and expand the output.

The 27 customers who never ordered

The log line for the SQL node reads 27 rows, while the sources read 500 and 3,000.

Expected result

  • 27 rows, starting with 1007 Priya Novak (free), 1023 Hana Esteves (free) and 1043 Sofia Gomes (starter).
  • An inner JOIN of the same two inputs has 3,000 rows — every order has a customer — and a LEFT JOIN without the WHERE has 3,027: every order, plus one row for each of the 27 customers without one.

Common pitfalls

table 'datafusion.public.customers' not found. The query uses a name no input has. The table name is what's in the Inputs box — not the source node's name. An empty box means the input is still input1, input2, …

The results look like the columns are swapped. You left the inputs numbered and connected orders first, so input1 is orders. Name the inputs and the connection order stops mattering.

The customers-without-orders query returns nothing. It's an inner JOIN, or the WHERE tests a column from the left side. The test has to be on a column from the right side (o.order_id), which is NULL only when nothing matched.

Named inputs in pipelines you didn't build. Pipelines created by the AI Assistant or imported from a file can carry names for their inputs — customers, orders — instead of numbers. Inputs always shows the names that apply.

What you built

A query over two sources, and the most useful join question in data work — what's missing? Next level adds a third input and starts summing money.

Check yourself

One question, drawn from a larger bank. Get it right to pass.

  1. What does a LEFT JOIN keep?