Customers Without Orders

Easy
Joins

Customers Without Orders

The customers table lists customers and the orders table lists their purchases. Some customers have never ordered.

Use a left join and return customer_id, customer_name, country for customers with no matching order. Sort by customer_id ascending.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

2 DataFrames

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.customers5 rows
customer_id (int)customer_name (string)country (string)
1MayaIndia
2LeoGermany
3NinaCanada
4OmarUAE
5SaraIndia
df.orders4 rows
order_id (int)customer_id (int)amount (double)
1001140
1002125
1003380
1004512.5

Return these columns

customer_id(int)
customer_name(string)
country(string)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.