Orders in the First Quarter

Easy
Filtering

Orders in the First Quarter

The orders table records the month of each order.

Return order_id, order_month, amount for orders placed in months 1, 2, or 3. Sort by order_id ascending.

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

Input data

1 DataFrame

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

df.orders6 rows
order_id (int)order_month (int)amount (double)
1140
2225.5
3480
4312
5560
6199

Return these columns

order_id(int)
order_month(int)
amount(double)

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.