Cells and cell types
功能的Every kind of cell a notebook can hold, what each one is for, and where its guide is.
Every cell has a kind. SQL and Markdown are the core; the rest read another cell's result and do something with it, without sending a query of their own unless they say so. Add a cell with the row of buttons under the last cell (SQL cell, Markdown cell, Chart cell and so on), with the + that appears when you hover between two cells, with A / B 或者 I insert menu in command mode, or from a Markdown cell's / menu, and turn a cell into SQL or Markdown with Y / M.


Cell kinds
| 种类 | 它的用途 | Guide |
|---|---|---|
| SQL | A query on a connection, or on the notebook's local data, with its own result grid. Read-only unless you allow writes. | 运行中, 连接 |
| Markdown | Notes, headings and links, rendered. Can show formula values and parameters with {{…}}, and an attachment cell's picture with . Double-click to edit. | Getting started, Writing Markdown, Pictures |
| Parameter | One notebook parameter's input (a date picker, a dropdown, a slider) placed between other cells. | 参数 |
| 图表 | One of 17 chart kinds over another cell's result, with suggestions. | 图表 |
| 表 | A result in the results grid with saved formats, colours, computed and frozen columns and a search. Can be locked to its rows, pivot or chart view. | 表 |
| 数据透视表 | A cross-tab of another result, with its layout kept in the notebook. | Pivots |
| KPI | A row of up to eight KPI tiles, each compared with the previous period, another result or a target. | KPIs |
| 公式 | One value computed from earlier results and parameters, such as an average order value. | Formulas |
| 转换 | Filter, join, group, pivot and reshape another result step by step, without writing SQL; runs on downloaded rows. | Transforms |
| 个人资料 | A card per column: types, missing and distinct values, ranges, percentiles, histograms and key candidates. | 配置文件 |
| 测试 | Checks on a result (row counts, uniqueness, ranges, patterns, drift and more) with the evidence behind each outcome. | 测试 |
| 差异 | Compares two results, a result with an earlier run or snapshot, or the same query on another connection. | Diffs |
| Query plan | The estimated or actual plan of another cell's query, plan comparison and parameter sweeps. | 计划 |
| Entity detail | One record and the rows related to it through foreign keys. | Entity detail |
| Attachment | A CSV, Parquet, JSON, NDJSON or SQLite file imported into the notebook's local data, or a PNG or JPEG picture. | Attachments |
| AI | A question for the notebook agent, in one of six modes, with its findings, evidence and proposed changes. | AI agent |
| 仪表板 | A 12-column layout of other cells' outputs, with sections, tabs and a filter bar. | 仪表板 |
How non-SQL cells get their data
Chart, table, pivot, KPI, profile, tests and diff cells have an Input picker listing the cells above that produce a result. They read that cell's result as it is on screen, from a snapshot of up to 100,000 rows, and say when that is not the whole result. When the input runs again they update by themselves; when the input is out of date, so are they. Profile, tests, diff and plan cells do their work when they run; charts, tables, pivots, KPIs and formulas recompute as soon as their input has a new result, without a query.
Writing in a Markdown cell
Double-click a Markdown cell (or press 输入 on it in command mode) to edit it. The editor treats the text as Markdown, not SQL: headings, emphasis, inline code, code blocks, links, lists, quotes and tables are coloured as you type, and you never get SQL keywords, table names, SQL warnings, formatting or AI SQL suggestions there. Press ESC to see it rendered again.
- Snippets. 类型 / at the start of a line for the slash menu, or press Ctrl+空格 anywhere: headings, bulleted, numbered and check lists, a table, a code block, a quote, a callout, a divider, bold, italic, inline code, a link and a picture. At the start of a line you get all of them, in the middle of a line only the ones that format text. 标签页 moves through a snippet's placeholders. The slash menu also adds a new cell of any kind below.
- Values from the notebook. 类型 {{ to list what Markdown can show: formula cells, each with its current value, and
param.. Type {{param. to list the parameters with their current values (andstart,end和end_exclusiveof a date range). A sensitive parameter is listed as hidden and its value never appears in the editor; the rendered text shows dots. Other cells aren't listed, because Markdown leaves a reference to a SQL or chart cell as written. - Pictures. 内部
 lists the notebook's picture attachments. See Pictures in Markdown cells. - Code blocks. After three backticks at the start of a line, the list offers a language (
sql,json,pythonand others) and closes the block for you. - Hover. Rest the pointer on a
{{…}}reference to see what it is, its current value (hidden for a sensitive parameter) and whether that value is stale, computed from partial results, or not there yet. - Gentle warnings. A reference to a name the notebook doesn't have, such as
{{totl}}或者{{param.zone}}, a date-range part that doesn't exist, or a picture naming a missing attachment gets a dotted underline that says so. A reference to a cell that isn't a formula gets a quieter note explaining that it stays as written. - Lists and brackets. 输入 on a list item starts the next one (numbers count up, a checked task starts an unchecked one, a quote continues), and 输入 on an empty item ends the list. 标签页 和 ⇧Tab on a list item nest and un-nest it. Typing [, (, a backtick, * 或者 _ adds the closing half, typing the closer steps over it, and 退格键 between an empty pair removes both. With text selected, those keys wrap the selection, so * twice makes it bold.
notebook-markdown-editor-valuesnotebook-markdown-editor-paramsPictures in Markdown cells
A Markdown cell shows a picture only from an attachment cell in the same notebook. Write , using the attachment cell's name or id (put the reference in angle brackets when the name has spaces: ). The picture is checked before it is shown (a real PNG or JPEG, at most 8 MiB and 8192 pixels on a side), it loads without running the attachment cell, and it shows only in a trusted notebook.
Every other image in Markdown, a web address, a file: path, a data: image or an attachment that isn't a picture, shows as a small placeholder and is never fetched. A notebook can't use an image to tell a server that you opened it. The same rule applies wherever notebook Markdown is drawn: embedded outputs, dashboard text tiles and tile notes.


Working with a cell
- 折叠 a cell from its header (or O in command mode) to hide its body; the header says how many lines are hidden. Collapsing is saved in the file.
- Move cells with the header's Move up and Move down, by dragging the handle at the left of the header, or with ⌥↑ / ⌥↓. Order matters only for reading and for Run Cells Above / Run Cell and Below: dependencies, not position, decide what runs first.
- Select several cells 与 ⇧-click, ⌘-click or ⇧J / ⇧K, and act on all of them from the bar above the cells: run, copy, cut, duplicate, move, collapse, convert, merge, bookmark or delete.
- Copy, cut and paste cells within a notebook or into another one; pasted cells get new ids and always start read-only. 拆分 a SQL or Markdown cell at the cursor and merge cells from the cell menu or the keyboard.
- 删除 from the header (or D D in command mode) shows an 撤销 toast, and every change to the cells can be undone with Z in command mode.
- Bookmark, fold (a Markdown heading hides its section) and pin (the output stays in a strip above the cells) from the cell menu. These are saved in the file.
- Embed output in the cell menu (or E) shows the cell as its output alone, and Lock view keeps a SQL or table cell's grid on its rows, pivot or chart. See Embedded outputs and report-style notebooks.
- Cells created by the AI agent carry an AI badge naming the AI cell that proposed them, and are otherwise ordinary cells.
Every key is on the keyboard reference.
Cells SQLly can't run
A cell of a kind this version doesn't know (one written by a newer SQLly), or a .sqllynb cell of kind python, shows "This … cell needs a newer version of SQLLY. It is shown read-only and saved unchanged." It never runs, nothing reads from it, and saving keeps it exactly as it was. Notebooks have no Python runtime; see what notebooks don't do.
Code cells in a Jupyter .ipynb file are different: every code cell, whatever its language, opens as a SQL cell, so a Python cell from Jupyter shows its Python text in a SQL cell and fails if you run it. See Jupyter and older notebooks.