Snowflake Notebooks is a managed environment inside Snowsight for interactive data analysis where you switch between SQL, Python, and Markdown on a per-cell basis. It brings together Snowpark DataFrame integration, built-in visualization, Git-based version control, and team collaboration, all within Snowflake's security model.
Snowflake Notebooks runs on the following components:
You can create a notebook from the Snowsight UI or with SQL.
-- SQLでNotebookを作成
CREATE OR REPLACE NOTEBOOK analytics.notebooks.monthly_report
FROM '@analytics.notebooks.nb_stage'
MAIN_FILE = 'monthly_report.ipynb'
QUERY_WAREHOUSE = analytics_wh
COMMENT = '月次レポート分析ノートブック';
-- Notebookの一覧確認
SHOW NOTEBOOKS IN SCHEMA analytics.notebooks;
-- Notebookの権限付与
GRANT USAGE ON NOTEBOOK analytics.notebooks.monthly_report
TO ROLE analyst_role;SQL cells let you run regular Snowflake SQL as-is. Results are shown as a table and can be switched to a chart view.
-- SQLセルの例: 売上サマリ
SELECT
DATE_TRUNC('MONTH', order_date) AS order_month,
product_category,
COUNT(*) AS order_count,
SUM(amount) AS total_revenue,
AVG(amount) AS avg_order_value
FROM sales.orders
WHERE order_date >= '2025-01-01'
GROUP BY order_month, product_category
ORDER BY order_month, total_revenue DESC;Python cells let you process data with Snowpark DataFrames, and analyze or visualize using libraries like pandas, matplotlib, or plotly. There's also a built-in mechanism to reference SQL cell results from Python cells.
# Pythonセルの例: Snowpark DataFrameによる集計
from snowflake.snowpark.context import get_active_session
from snowflake.snowpark.functions import col, sum as sf_sum, count
session = get_active_session()
orders_df = session.table("sales.orders")
monthly_summary = (
orders_df
.filter(col("order_date") >= "2025-01-01")
.group_by("product_category")
.agg(
count("*").alias("order_count"),
sf_sum("amount").alias("total_revenue")
)
.sort(col("total_revenue").desc())
)
monthly_summary.show()SQL cell results are accessible by the cell's name, and you can reference them from a Python cell using that name.
# cell_name_of_sql_cell がSQLセルの名前の場合:
# SQLの結果をSnowpark DataFrameとして取得
df = cell_name_of_sql_cell.to_df()
# SQLの結果をpandas DataFrameとして取得
pdf = cell_name_of_sql_cell.to_pandas()
# pandasで追加分析
print(f"行数: {len(pdf)}")
print(pdf.describe())
# matplotlibで可視化
import matplotlib.pyplot as plt
pdf.plot(kind='bar', x='PRODUCT_CATEGORY', y='TOTAL_REVENUE')
plt.title('カテゴリ別売上')
plt.tight_layout()
plt.show()SQL cell results can be visualized with Snowsight's built-in chart features in addition to the table view.
Python cells can also use libraries such as matplotlib, plotly, and Altair for more advanced custom visualizations.
# Pythonセルでのplotlyによるインタラクティブ可視化
import plotly.express as px
pdf = cell_monthly_data.to_pandas()
fig = px.line(
pdf,
x='ORDER_MONTH',
y='TOTAL_REVENUE',
color='PRODUCT_CATEGORY',
title='月次売上推移(カテゴリ別)'
)
fig.show()Snowflake Notebooks supports Git repository integration, enabling notebook version control and team-based development.
-- Git Repository Integrationの作成
CREATE OR REPLACE GIT REPOSITORY analytics.notebooks.ml_repo
API_INTEGRATION = github_api_integration
GIT_CREDENTIALS = github_secret
ORIGIN = 'https://github.com/myorg/ml-notebooks.git';
-- Gitリポジトリからノートブックをフェッチ
ALTER GIT REPOSITORY analytics.notebooks.ml_repo FETCH;
-- リポジトリ内のファイル一覧
SHOW GIT BRANCHES IN analytics.notebooks.ml_repo;
ls @analytics.notebooks.ml_repo/branches/main/;
-- Gitリポジトリからノートブックを作成
CREATE OR REPLACE NOTEBOOK analytics.notebooks.feature_engineering
FROM '@analytics.notebooks.ml_repo/branches/main/'
MAIN_FILE = 'feature_engineering.ipynb'
QUERY_WAREHOUSE = ml_wh;Notebook permissions are managed by Snowflake's RBAC. Multiple users can edit the same notebook, with changes synchronized in real time.
-- アナリストロールにノートブックの使用権限を付与
GRANT USAGE ON NOTEBOOK analytics.notebooks.monthly_report
TO ROLE analyst_role;
-- データサイエンティストロールにノートブックの所有権を付与
GRANT OWNERSHIP ON NOTEBOOK analytics.notebooks.ml_experiment
TO ROLE data_scientist_role;
-- ウェアハウスの使用権限(ノートブック実行に必要)
GRANT USAGE ON WAREHOUSE analytics_wh
TO ROLE analyst_role;Python cells can add packages from Snowflake's Anaconda channel. You can search for and add packages directly from the notebook UI.
# ノートブック内でのパッケージ追加(Pythonセル)
# Snowsightの「Packages」パネルからGUIで追加するか、以下のようにセッションで追加
session.add_packages('pandas', 'scikit-learn==1.4.0', 'plotly')
# requirements.txtからの一括追加
# session.add_requirements('requirements.txt')By scheduling notebooks as tasks, you can automate periodic report generation and model retraining.
-- ノートブックをスケジュール実行するタスク
CREATE OR REPLACE TASK run_monthly_report
WAREHOUSE = analytics_wh
SCHEDULE = 'USING CRON 0 6 1 * * Asia/Tokyo'
AS
EXECUTE NOTEBOOK analytics.notebooks.monthly_report;
ALTER TASK run_monthly_report RESUME;SnowPro
問題 1
A data scientist wants to analyze data in Snowflake Notebooks, extracting data with SQL and training a model with scikit-learn in Python. Which sequence of steps is correct?
正解: B
In Snowflake Notebooks, you can access a SQL cell's result by name and convert it to a pandas DataFrame with to_pandas() for use in a Python cell. Data stays inside Snowflake, so there's no need to download a CSV or set up a JDBC connection manually. Mixing SQL and Python in the same notebook is fully supported.
How do Snowflake Notebooks differ from Jupyter Notebooks?
Snowflake Notebooks is a managed notebook environment that runs inside the Snowsight UI. Like Jupyter, it lets you run SQL/Python cell by cell, but the key differences are that data never leaves Snowflake and Snowflake's authentication, RBAC, and governance apply directly. The compute runs on Snowflake warehouses or Snowpark Container Services, so you don't need to install Python or libraries on your local machine.
Can you mix Python and SQL in Notebooks?
Yes. You can switch between SQL / Python / Markdown on a per-cell basis. A Python cell can receive a SQL cell's results as a Snowpark DataFrame or pandas DataFrame, so an end-to-end workflow like extract with SQL → train an ML model in Python → write results back with SQL can all live in a single notebook.
Does Notebooks support Git integration?
Yes. Snowflake Notebooks supports integration with Git repositories. From Snowsight you can connect a Git repository (GitHub / GitLab / Bitbucket, etc.) to version-control notebook files, switch branches, commit, and pull. With CI/CD pipeline integration, you can automate deploying notebook changes to production.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...