{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Snowflake Tutorial for Data Science Teams\n",
        "Xenors practice notebook. Run each cell and compare the output with the tutorial page.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Create a small warehouse and table\n",
        "Auto-suspend is an easy first control for warehouse cost.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "CREATE WAREHOUSE IF NOT EXISTS ds_wh WAREHOUSE_SIZE='XSMALL' AUTO_SUSPEND=60;\n",
        "CREATE TABLE IF NOT EXISTS sales(order_id INT, amount NUMBER(10,2));\n",
        "INSERT INTO sales VALUES (1,120.50),(2,75.00);\n",
        "SELECT COUNT(*) AS rows, SUM(amount) AS revenue FROM sales;\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Expected/checkpoint**\n",
        "```text\nROWS | REVENUE\n2    | 195.50\n```\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Check pruning-friendly filters\n",
        "Use the query profile to verify pruning instead of assuming a filter is cheap.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "SELECT *\n",
        "FROM events\n",
        "WHERE event_date BETWEEN '2026-10-01' AND '2026-10-07';\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Expected/checkpoint**\n",
        "```text\nQuery profile should show reduced partitions scanned.\n```\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.x"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}