# Databases, data import, and SQL Editor

After opening the MatrixOne **database management console** through **Connect > Connect via Cloud Platform** on an instance, you can browse databases and manage cross-instance data sharing, import sample or object-storage datasets, run queries and visualize results in the SQL Editor, and inspect query history, CU usage, and execution plans.

## Browse databases and share data

Open **Database** in the left navigation to inspect databases and tables in the current instance (table count, database size, owner, and creation time) and search objects by keyword.

### Publications and subscriptions

Use **Publication** and **Subscription** to share read-only data across instances:

1. **Add a publication**: On the **Publication** tab, click **Add Publication**, enter a unique **Publication name** (letters, digits, underscores, and `$` only), select a **Publication database** (system databases and subscribed databases cannot be published), and select target instances from your organization or other organizations under **Publication target**. Publications provide read-only (`READONLY`) access.
2. **Manage publications**: Search by database or target instance ID, and edit or delete publications as needed. Deleting a database that is actively published requires deleting its publication first; after deletion, downstream subscriptions lose access to its data.
3. **Manage subscriptions**: Switch to the **Subscription** tab to view shared databases and manage subscription access.

## Load data

Open **Load Data** to bring sample datasets or external object-storage files into tables:

- **Explore with sample data**: Load the built-in **TPC-H** sample dataset (such as `mo_sample_data_tpch_sf1`) into your instance and query it directly in the SQL Editor. Keep the browser tab open until sample loading completes.
- **Import CSV / JSON from object storage**: Choose **CSV File** or **Json File**, enter the object-storage bucket URL, configure credentials (**IAM Role ARN** or **Alibaba Cloud AccessKey / AWS Access Key**), and choose or enter the target **Database** and **Table**. If another query is actively running in the SQL Editor, wait for it to finish as prompted before starting an import.

> For unstructured documents, REST APIs, Kafka streams, or workflow orchestration pipelines, use AI Studio [Data Sources](../ai-studio/data-sources/index.md) and [Processing](../ai-studio/processing/index.md).

## Use the SQL Editor

Open **SQL Editor** to run interactive queries and save scripts in workbooks:

1. Select a database from the left tree and open or create a workbook (workbooks can be searched, renamed, or deleted; each workbook has a **1 MB** content limit—create a new workbook when approaching the limit).
2. Write SQL in the editor and execute it; collapse, minimize, maximize, or reset the results pane as needed.
3. Switch to the **Chart** tab after receiving query results to choose a chart type (**Bar**, **Pie**, or **Line**) and configure columns, axes, and aggregations.

For SQL syntax, data types, and built-in functions, see [Reference: SQL](../../reference/sql/index.md).

## Query history and execution profile

Open **Queries History** to audit executed statements and analyze query performance:

1. Filter by status (**ALL**, **Running**, **Success**, **Failed**) or expand **Filters** to search by SQL text, database, user, query ID, session ID, transaction ID, minimum duration, or time range, and download filtered results locally.
2. Review SQL text, status, query type, duration, timestamps, rows read, bytes scanned, result count, and **CU** consumption in the table.
3. Open **Query Details** for any record to inspect full query metadata, **Query Result**, and **Query Profile** (interactive execution plan tree showing operator nodes, SQL slices, CPU, and memory overview).

## Completion check and next steps

- Confirm newly imported or subscribed tables appear under **Database**, a test `SELECT` succeeds in **SQL Editor**, and the corresponding `Success` record is visible in **Queries History**.
- To inspect instance resource metrics or manage instance users and IP allowlists, continue with [Monitoring](monitoring.md) and [Access control and permissions](permissions.md).
