Indian Users

Easy
Filtering
Databricks
Snowflake

Indian Users

Given users, return rows where country = 'India'. Project user_id, name, age and order by user_id ascending.

Sample input

user_idnamecountryage
1MiraUSA30
2KabirCanada36
3ZaraUK61
4ZaraGermany22
5YashBrazil57
6ArjunJapan28
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.users10 rows
user_id (int)name (string)country (string)age (int)
1MiraUSA30
2KabirCanada36
3ZaraUK61
4ZaraGermany22
5YashBrazil57
6ArjunJapan28
7AnshSingapore35
8KianCanada27
9AryanFrance79
10AditiCanada31

Return these columns

user_id(int)
name(string)
age(int)

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.