Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

SQL execution features of the JupyterLab SQL extension

Focus mode
SQL execution features of the JupyterLab SQL extension - Amazon SageMaker AI

You can execute SQL queries against your connected data sources in the SQL extension of JupyterLab. The following sections explain the most common parameters for running SQL queries inside JupyterLab notebooks:

When you run a cell with the %%sm_sql magic command, the SQL extension engine executes the SQL query in the cell against the data source specified in the magic command parameters.

To see the details of the magic command parameters and supported formats, run %%sm_sql?.

Important

To use Snowflake, users of the SageMaker distribution image version 1.6 must install the Snowflake Python dependency by running the following micromamba install snowflake-connector-python -c conda-forge command in a terminal of their JupyterLab application. Restart the JupyterLab server by running restart-jupyter-server in the terminal after the installation is complete.

For SageMaker distribution image versions 1.7 and later, the Snowflake dependency is pre-installed. No action is needed.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.