<script src="https://unpkg.com/pondpilot-widget"></script>
<pre class="pondpilot-snippet">
SELECT 'Hello World' as greeting;
</pre>
Your SQL code blocks are now interactive. Users can modify and run queries directly in the browser.
Click "Run" on any of the examples below to see the widget in action. Feel free to modify the queries and experiment!
Start with a simple SELECT statement:
SELECT 'Hello from PondPilot Widget!' as greeting, CURRENT_DATE::STRING as today, 42 as answer_to_everything;
Create tables and analyze data entirely in the browser:
-- Create a sample products table CREATE TABLE products AS SELECT * FROM (VALUES ('Laptop', 'Electronics', 999.99, 50), ('Mouse', 'Electronics', 29.99, 200), ('Desk', 'Furniture', 299.99, 25), ('Chair', 'Furniture', 199.99, 40), ('Monitor', 'Electronics', 349.99, 75) ) AS t(name, category, price, stock); -- Analyze inventory by category SELECT category, COUNT(*) as product_count, ROUND(AVG(price), 2) as avg_price, SUM(stock) as total_stock, ROUND(SUM(price * stock), 2) as inventory_value FROM products GROUP BY category ORDER BY inventory_value DESC;
Window functions, CTEs, and complex queries work seamlessly:
-- Create sales data CREATE TABLE daily_sales AS SELECT date, ROUND(RANDOM() * 1000 + 500, 2) as revenue FROM generate_series( DATE '2025-01-01', DATE '2025-01-14', INTERVAL 1 DAY ) AS t(date); -- Calculate moving averages and growth SELECT date::STRING as date, revenue, ROUND(AVG(revenue) OVER ( ORDER BY date ROWS BETWEEN 2 PRECEDING AND CURRENT ROW ), 2) as ma_3day, ROUND(revenue - LAG(revenue) OVER (ORDER BY date), 2) as daily_change, ROUND(100.0 * (revenue - LAG(revenue) OVER (ORDER BY date)) / LAG(revenue) OVER (ORDER BY date), 1) as pct_change FROM daily_sales ORDER BY date;
Query remote CSV and Parquet files directly:
-- Query a remote Parquet file SELECT o_orderstatus, COUNT(*) AS total_orders, ROUND(AVG(o_totalprice), 2) AS avg_order_value FROM 'https://shell.duckdb.org/data/tpch/0_01/parquet/orders.parquet' GROUP BY o_orderstatus ORDER BY total_orders DESC;
Quick and easy - just include the script tag:
<script src="https://unpkg.com/pondpilot-widget"></script>
For modern build systems:
npm install pondpilot-widget
Alternative package manager:
yarn add pondpilot-widget
Customize the widget's appearance and behavior:
// Set theme
window.PondPilot.config.theme = 'dark'; // or 'light'
// Hide powered by footer
window.PondPilot.config.showPoweredBy = false;
// Set custom height
window.PondPilot.config.height = '400px';
// Enable syntax highlighting
window.PondPilot.config.highlightSyntax = true;
Teach SQL with hands-on, interactive examples
Provide runnable examples in your technical docs
Engage readers with interactive data analysis
Showcase your SQL skills interactively
Interactive SQL training and tutorials
Live demonstrations in presentations