Build Schema

Build a schema manually and generate SQL with AI

Create the database structure SQL Mocker needs by entering the tables, columns, data types, keys, and relationships yourself. Once reviewed, the schema becomes the context used to generate SQL tailored to that structure.

Manual workflow

From an empty schema to a tailored query

Four guided steps, with no direct connection to your database.

  1. 01

    Choose Build Schema

    Open Write SQL with AI and select Build Schema when you want to define the database structure yourself.

  2. 02

    Select the database profile

    Choose the database system so SQL Mocker can use the appropriate SQL dialect and data type options.

  3. 03

    Add tables and columns

    Enter table names, column names, data types, primary keys, and foreign-key references for the structure you need.

  4. 04

    Review and generate SQL

    Confirm the table relationships, ask a question in natural language, and review the generated SQL and dummy results.

Schema builder

customers

ColumnData typePKReferences
customer_idIntegerYes-
customer_nameVarcharNo-
region_idIntegerNoregions.region_id
Add columnAdd table

Define the structure

Add the context needed for accurate multi-table SQL

The builder gives you direct control over the structure supplied to the assistant. You can keep it focused on the database area or reporting task you are working on.

  • Add only the tables and columns relevant to the SQL you want to create.
  • Choose a data type for every column.
  • Mark the columns that uniquely identify table rows as primary keys.
  • Connect foreign-key columns to the table and column they reference.
  • Reorder columns or remove details that are no longer needed.
  • Review the relationship map before using the schema as AI context.

Build and generate

See a manually built schema become AI-generated SQL

The demonstration shows how to build the tables and relationships, confirm the schema, ask for the required data in natural language, and review the generated SQL and dummy results.

Only the structure is added

Building a schema manually does not connect SQL Mocker to your database. The tables, columns, data types, keys, and relationships you enter are saved as workspace metadata and do not create or alter objects in your real database.

Ready to build your schema?

Define the structure, review the relationships, and ask your first SQL question.

Open Build Schema