Run SQL, Python, Pandas & PySpark queries in real time and view the code visually at every stage to enhance your learning.
It supports complex queries and shows the expected output for CTEs, recursive CTEs, Joins, Grouping, Window Functions, Window Frames, Window Ranges. The maximum tested single SQL query is 5,000 lines.
Python, Pandas & PySpark pipelines — including creating data pipelines and exporting results to your PC.
By continuing, you agree to our privacy policy.
Select the power tier that fits your query and analytics needs.
[{"id":1,"name":"…"}, …]) or array of arrays.
EXPLAIN QUERY PLAN command.
It shows which tables are scanned, what indexes (if any) are used, and the order of operations.
from sqlframe import activate activate("duckdb") from pyspark.sql import SparkSession from pyspark.sql.functions import col, avg spark = SparkSession.builder.getOrCreate() ============================== # Write your code below like: data = [ ("Alice", "Engineering", 95000), ("Bob", "Engineering", 65000), ("Charlie", "Sales", 80000), ("David", "Sales", 50000), ("Eve", "Marketing", 120000), ("Frank", "Engineering", 85000) ] df = spark.createDataFrame(data, ["name", "department", "salary"]) result = ( df.filter(col("salary") > 70000) .groupBy("department") .agg(avg("salary").alias("avg_salary")) ) result.show()
from sqlframe.duckdb import DuckDBSession from sqlframe.duckdb.functions import col, avg spark = DuckDBSession() ============================== # Write your code below like: data = [ ("Alice", "Engineering", 95000), ("Bob", "Engineering", 65000), ("Charlie", "Sales", 80000), ("David", "Sales", 50000), ("Eve", "Marketing", 120000), ("Frank", "Engineering", 85000) ] df = spark.createDataFrame(data, ["name", "department", "salary"]) result = ( df.filter(col("salary") > 70000) .groupBy("department") .agg(avg("salary").alias("avg_salary")) ) result.show()