# SQL schema visualizer

Canonical page: https://datalens.flazetech.in/schema

Publisher: DataLens by Flazetech (https://datalens.flazetech.in/about).

From SQL definitions to a readable database diagram. Inspect tables, columns, and foreign-key relationships in one workspace.

## How to visualize a SQL database schema

1. Paste SQL CREATE TABLE statements or upload a text .sql file. Try the sample to see connected tables.
2. Select Visualize schema. The diagram shows column types, primary keys, and declared foreign keys.
3. Drag tables to arrange the diagram, zoom or fit it to the canvas, and inspect the table details below.

## Worked example

### Example input

```text
CREATE TABLE customers (id INT PRIMARY KEY);
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT REFERENCES customers(id)
);
```

### Example output

```text
2 tables: customers, orders
1 foreign-key relationship:
orders.customer_id → customers.id
```

## Common questions

### Which SQL schema definitions are supported?

The visualizer reads common CREATE TABLE syntax, including quoted and schema-qualified table names, composite keys, inline REFERENCES clauses, and foreign keys added with ALTER TABLE. It is a schema reader, not a full SQL engine; stored procedures, CREATE TABLE AS queries, and dialect-specific migrations may need a simplified schema export.

### Why is a relationship missing from my diagram?

Relationships come from declared foreign keys. A column named user_id alone does not establish a relationship. Include both referenced tables and an inline REFERENCES or FOREIGN KEY constraint in your SQL.

### Can I upload a SQLite database or binary backup?

No. Export the structure as text SQL first. SQLite .db files, SQL Server .bak files, and BSON are binary formats and are not supported by this text schema visualizer.

### Can I visualize MongoDB collections?

Yes. Supply a JSON object mapping collection names to sample documents, arrays of sample documents, or JSON schemas. DataLens displays the supplied fields and types; it does not infer relationships between collections.

## Data handling

[Processing and privacy](https://datalens.flazetech.in/privacy). Formatting and conversion run in the browser. Optional sharing and API requests can transmit supplied data. The interactive tools require JavaScript; this reference does not.
