Your first analysis.

Ten minutes from cold install to a chart you can show someone. We'll use the Chinook sample database that ships with Orchid, so there's nothing to provision.

What you'll build

A two-cell notebook: a SQL cell that pulls the top-selling genres from Chinook, and a Python cell that turns the result into a bar chart. By the end you'll have touched every major surface of the IDE — the notebook, SQL execution, the kernel, and the chart renderer.

Prerequisites

Orchid installed (see install) and at least one project created (see first project). No external database needed.

1. Open Orchid

Launch Orchid. If this is your first time, you'll land on the project shelf. Click New project, pick an empty folder anywhere on disk (something like ~/orchid/first-analysis is fine), and Orchid opens with a blank notebook.

The Orchid IDE with a fresh project — empty notebook in the middle, schema browser on the left, agent panel on the right./docs-images/tutorials/your-first-analysis/01-empty-notebook.png
A fresh Orchid project. The dark earth panels are the workbench; the cream slab in the middle is where notebooks live.

2. Connect to the Chinook sample

Chinook is a classic SQLite database modeling a digital music store — invoices, customers, tracks, genres. Orchid bundles a copy so you can experiment without setting anything up.

Open Integrations (the plug icon in the activity bar), click + Add connection, and choose Sample » Chinook (SQLite). Orchid registers a read-only connection profile pointed at the bundled file. The schema browser on the left fills in with tables: Album, Artist, Customer, Invoice, InvoiceLine, Track, and friends.

The Add Connection dialog with the Chinook sample option selected./docs-images/tutorials/your-first-analysis/02-add-chinook.png
One click — no host, port, or password. The sample lives inside the app bundle.

3. Add a SQL cell

Click the + SQL button below the empty notebook to add a SQL cell. In the cell's integration dropdown (top-right of the cell), pick Chinook. Now any query you write runs against the sample.

Paste this into the cell — it asks for the ten genres with the most invoice line revenue:

SELECT
  g.Name AS genre,
  ROUND(SUM(il.UnitPrice * il.Quantity), 2) AS revenue,
  COUNT(*) AS line_count
FROM InvoiceLine il
JOIN Track t  ON t.TrackId = il.TrackId
JOIN Genre g  ON g.GenreId = t.GenreId
GROUP BY g.Name
ORDER BY revenue DESC
LIMIT 10;
A SQL cell containing the genre revenue query, with Chinook selected as the integration./docs-images/tutorials/your-first-analysis/03-sql-cell.png
SQL cells highlight syntax, autocomplete on schema, and badge the active connection in the top-right.

4. Run it

Hit Cmd-Enter (macOS) or Ctrl-Enter (Linux). The cell runs, the result table appears beneath it, and Orchid exposes the rows to the Python kernel as a DataFrame named after the cell — genres if you didn't rename it.

The SQL cell now has a result table beneath it showing genres ordered by revenue./docs-images/tutorials/your-first-analysis/04-sql-result.png
Rock leads, Latin second. The pill in the cell footer shows the variable name the kernel will use.
Rename the variable

Click the variable pill in the cell footer to rename it. Anything you set is what the next Python cell will reference — keep it short.

5. Chart the result in Python

Click + Python to add a code cell below. The kernel is already warm (Orchid booted a project-scoped Python environment when you opened the notebook) and it has the SQL result in scope.

import plotly.express as px

fig = px.bar(
    genres,
    x="genre",
    y="revenue",
    title="Top 10 Genres by Revenue (Chinook sample)",
    labels={"genre": "Genre", "revenue": "Revenue (USD)"},
)
fig.update_layout(template="plotly_dark", margin=dict(l=20, r=20, t=60, b=80))
fig

Run the cell with Cmd-Enter. The bar chart renders inline. Hover any bar for tooltips, click the legend to filter, drag a region to zoom.

A dark-themed Plotly bar chart of revenue by genre rendered inline in the notebook./docs-images/tutorials/your-first-analysis/05-chart.png
Interactive Plotly chart — same renderer the agent uses when it builds charts on your behalf.

6. Add a markdown narrative

A notebook isn't just code. Click + Markdown and write a short explanation of what you just found. Markdown cells render live as you type and accept the full GitHub-flavored syntax.

## What I learned

- **Rock** dominates revenue — roughly **2x** the runner-up.
- Latin and Metal trail close behind, but with very different line counts.
- Niche genres (Sci-Fi, Comedy) barely register; safe to drop from the next merch order.

Drag the markdown cell above the chart if you want it as a section header. Cells reorder by drag handle on the left edge.

7. Save and you're done

Orchid autosaves on every edit. The notebook is a plain YAML file inside your project folder — open it in any text editor to inspect the format.

orchid: '1.0'
metadata:
  title: First analysis
  created: '2026-05-14T09:00:00Z'
  python_version: '3.11'
blocks:
  - id: blk_01
    type: sql
    integration: chinook
    output_variable: genres
    source: |-
      SELECT g.Name AS genre, ...
  - id: blk_02
    type: code
    language: python
    source: |-
      import plotly.express as px
      fig = px.bar(genres, ...)
      fig
Diff-friendly

Because notebooks are YAML, git diff produces sensible output. Commit them like any other source file.

Where to go next