Products in a Price Band

Easy
Filtering

Products in a Price Band

The products table contains product prices.

Return product_id, product_name, price for products priced between 20 and 100 inclusive. Sort by product_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.products8 rows
product_id (int)product_name (string)price (double)
1Desk80
2Lamp19.99
3Chair100
4Mug15
5Shelf20
6Monitor120
7Cable45.5
8Stand99.99

Return these columns

product_id(int)
product_name(string)
price(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.