SQL material
How to get started with the SQL lesson
You can work through Greg Wilson’s Introduction to SQL. I got started by:
- Setting up an environment that lets me run marimo notebooks:
uv init comp_earth_sci_sql
cd comp_earth_sci_sql
uv add "marimo[sql]"
uv add sqlalchemy
- Downloading and uncompressing the example databases:
curl https://raw.githubusercontent.com/gvwilson/sqlshort/main/docs/databases.zip > databases.zip
unzip databases.zip
- Starting a marimo notebook
uv run marimo edit sql_example.py
- In this notebook running a python cell containing
import marimo as mo, using the “Add database connection” tool (hamburger, top right) to use sqlalchemy to create an engine for the path./penguins.dband then creating a new SQL cell using the “SQLite (engine)” database connection to run the SQL codeselect sex, island, species from penguins;
Hopefully this will get you started with the rest of the material!