# Data Explorer and SQL console
Source: https://docs.infraista.com/en/data-storage/databases/data-explorer-and-sql-console



You can work with your data from the console, without installing a database client.

## Data Explorer [#data-explorer]

Open the database and select **Data Explorer**. The tree on the left lists the databases on the server,
then each database's **Tables**, **Views**, **Functions & procedures** and **Triggers**.

**Browse and edit rows**

* Open a table to see its rows. Double-click a cell to edit it; add a row with the insert button; delete
  a row from its menu.
* Edits made here in the last 7 days are listed in the table's history, newest first, with **Undo**.
  (Changes made with SQL or by your apps aren't listed.)

**Change the structure**

A table's structure view lists its **Columns**, **Indexes** and **Foreign keys**, with **Add column**,
**Add index** and **Add foreign key**, and its **CREATE statement**.

**Table and database actions**

From a table's menu: **Query in SQL console**, &#x2A;*Import CSV…** (rows are added; if any row fails, nothing
is imported), &#x2A;*Rename…**, &#x2A;*Empty…** (deletes every row, keeps the table) and &#x2A;*Delete…**.

From a database's menu: **New table**, &#x2A;*Import SQL file…**, &#x2A;*Export (SQL dump)** and **Open in SQL
console**. **New database** adds an empty database to the server.

<Callout type="warn">
  Emptying or deleting a table can't be undone. Take a


  [backup](/en/data-storage/databases/backups-and-restore)

   first if you might need the data.
</Callout>

## SQL console [#sql-console]

Select **SQL console** to run SQL against a database.

* It starts in **Read-only** mode: statements that change data or structure are blocked. Switch to
  **Write mode** when you need to change something; write-mode runs are recorded in the audit log.
* Select **Run** (or press the shortcut shown) to run the query, or only the selected text.
* **Preview** runs the script inside a transaction, shows what it would change (rows before and after),
  then rolls everything back. Nothing is saved.
* Queries stop after 30 seconds and show up to 1,000 rows per result. **Export as CSV** downloads a
  result.
* **Explain plan** shows how the database will run a query.
* **History and saved queries** keeps the queries you ran; **Save query** keeps one for later (saved
  queries are only visible to you).
* **Database tools** downloads a dump (`.sql.gz`) or imports a SQL file.

## Fleet query [#fleet-query]

For apps with a database per tenant, **Fleet query** runs one script on many databases of the server in
the background, a few at a time, and merges the results into one table.

Scripts that change data always run on the first database first and wait for you to check the result
before the rest. Changes made by a script can't be undone from here.

## Schema history and compare [#schema-history-and-compare]

**Schema history** keeps snapshots of a database's structure and shows what changed in each. **Compare**
picks another database on the server, or an earlier snapshot, and writes the SQL that makes this database
match it. Nothing changes until you run it.

## Related [#related]

* [Backups and restore](/en/data-storage/databases/backups-and-restore)
