ERD Generation

Visualise and review how your database tables connect

Use SQL Mocker to review the relationships in your database schema before generating SQL, or upload a pre-existing query to see which tables it uses and how they are joined.

Two ERD workflows

Review a schema or understand an existing query

Review relationships before generating SQL

Extract, upload, or build your schema, then open Relationships Overview to inspect the ERD. Use relationships already defined in the database and fill in missing or unclear connections before asking AI to generate SQL tailored to your structure.

Open the schema workflow

View the ERD of pre-existing SQL

Paste or upload a SQL script to break it down into its tables and relationships. Open Join Map to see which tables are used, the join type for each connection, and the columns that join the tables together.

Open the existing SQL workflow

Schema relationship workflow

From schema metadata to a reviewed relationship map

  1. 01

    Add your database structure

    Extract, upload, or manually build schema metadata containing the tables and columns you want to use.

  2. 02

    Review tables and keys

    Check the detected columns, primary keys, foreign keys, and any relationships suggested by SQL Mocker.

  3. 03

    Open Relationships Overview

    View the tables as an ERD-style map and inspect the columns used to connect each table pair.

  4. 04

    Adjust and confirm

    Add, correct, or remove connections, review validation warnings, and confirm the relationships for the workspace.

Relationships Overview

2 tables · 1 relationship

customers
customer_id PK
customer_name
region_id
1 to many
orders
order_id PK
customer_id FK
order_date
customers.customer_id → orders.customer_id

Review and adjust

Correct the diagram in Relationships Overview

The visual map and Properties panel work together. Select a connection in the map to inspect it, or create a missing link directly between the relevant columns.

Viewing joins in pre-existing SQL

Select Join Map in the Imported SQL workspace to see which tables are used, how they are joined, the join type, and the columns connecting them.

  • Click a relationship line to highlight the connected columns.
  • Drag between column dots to create a missing relationship.
  • Use Properties to correct the source table, source column, target table, or target column.
  • Delete a relationship that should not be used.
  • Review warnings when connected columns use different data types or other details need attention.
  • Confirm the reviewed relationships before generating SQL or dummy data.

The reviewed ERD stays in your workspace

Confirming a relationship updates the schema context SQL Mocker uses when generating SQL and dummy data. It does not add keys, alter tables, or make any other change to your real database.

Choose the ERD workflow you need

Review your schema before generating SQL, or inspect the joins in a pre-existing query.