The Snowflake SQL tool executes SQL queries directly on your Snowflake data warehouse. Perfect for data analysis, reporting, business intelligence, and accessing large-scale datasets with Snowflake’s cloud performance.
Requires Snowflake Integration: You need to set up a Snowflake integration before agents can use this tool.
SELECT DATE_TRUNC('month', order_date) as month, SUM(revenue) as total_revenue, COUNT(DISTINCT customer_id) as unique_customersFROM sales_data WHERE order_date >= '2024-01-01'GROUP BY monthORDER BY month DESC;
SELECT customer_segment, AVG(lifetime_value) as avg_ltv, COUNT(*) as customer_countFROM customer_analyticsWHERE last_purchase_date >= DATEADD(month, -6, CURRENT_DATE())GROUP BY customer_segmentORDER BY avg_ltv DESC;
SELECT warehouse_name, AVG(execution_time) as avg_execution_time, SUM(credits_used) as total_creditsFROM query_historyWHERE start_time >= DATEADD(day, -7, CURRENT_DATE())GROUP BY warehouse_nameORDER BY total_credits DESC;
SELECT table_name, COUNT(*) as row_count, COUNT(DISTINCT primary_key) as unique_keys, SUM(CASE WHEN primary_key IS NULL THEN 1 ELSE 0 END) as null_keysFROM information_schema.tables tJOIN your_database.your_schema.your_table data ON 1=1GROUP BY table_name;
WITH monthly_cohorts AS ( SELECT customer_id, DATE_TRUNC('month', first_purchase_date) as cohort_month, DATE_TRUNC('month', order_date) as order_month FROM customer_orders)SELECT cohort_month, COUNT(DISTINCT customer_id) as cohort_size, AVG(DATEDIFF(month, cohort_month, order_month)) as avg_months_activeFROM monthly_cohortsGROUP BY cohort_monthORDER BY cohort_month;