> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with Tables

> Query, change, link, import and export tables with Genie

Genie reads and queries [tables](/platform/tables/overview) with SQL straight away, including the read-only platform tables over flows, runs and agents. Changes go through a card.

<Frame>
  <img src="https://mintcdn.com/spot-16018069/-bbmkLWC1Zq7pX8k/images/genie/tables-hero.png?fit=max&auto=format&n=-bbmkLWC1Zq7pX8k&q=85&s=9f81e7754ae3acd1bf5a1a07c1b77d49" alt="The Leads table with Genie's reply after marking every new lead from Portugal as Contacted" width="3200" height="2000" data-path="images/genie/tables-hero.png" />
</Frame>

## Changing data

* **Give the rule, not the rows.** "Mark every new lead from Portugal as Contacted" becomes one SQL statement; the card shows it and how many rows it touches.
* **Columns** can be added, renamed, retyped or dropped.

<Frame>
  <img src="https://mintcdn.com/spot-16018069/-bbmkLWC1Zq7pX8k/images/genie/tables-statement-card.png?fit=max&auto=format&n=-bbmkLWC1Zq7pX8k&q=85&s=3eabe00c66667c54136cb7be9015066b" alt="A Run a SQL statement card that updates 2 rows of Leads" style={{ maxWidth: "440px" }} width="816" height="610" data-path="images/genie/tables-statement-card.png" />
</Frame>

## Linking tables

A **Reference** column holds the `id` of a row in another table, and shows that row's name in the grid. Choose what happens when the linked row is deleted (default **Restrict**):

| Choice | Effect |
| :- | :- |
| **Restrict** | The delete is blocked |
| **Cascade** | Linking rows are deleted too |
| **Set null** | The cell is emptied |

Ask for the link when creating a table or add it later; the card shows the linked table and the rule.

## Import and export

* **Import** a CSV or TSV into a new or existing table. Genie checks it against the table first.
* **Export** any query as a CSV file in the chat.

## Examples

* "Which country has the most open deal value in Leads?"
* "Create a Meetings table with a lead reference, the time, notes and a follow-up flag."
* "Export the leads from Canada as a CSV."


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.