Guides

SQL & Database Guides

Practical guides for understanding database structures, reviewing table relationships, and writing more accurate SQL.

Table relationships

How to Find Table Relationships When Foreign Keys Are Missing

Use Investigate Relationships to identify, validate, and confirm likely table connections when foreign-key metadata is missing or incomplete.

Read guide

SQL generation

How to Select Tables and Review Joins in Generated SQL

Start with the tables you know are relevant, investigate disconnected tables, review bridge tables, and check the joins SQL Mocker generates.

Read guide

Existing SQL

How to Review and Update Existing SQL

Learn how to understand an existing query, review its structure, adjust output columns and update it as database requirements change.

Read guide

SQL explanation

How to Explain SQL in Plain English

Learn how to break a SQL query into its purpose, data flow, joins, filters, calculations and output columns.

Read guide

AI SQL generation

How to Generate SQL for Your Database Without Connecting It to AI

Use extracted schema metadata and natural-language questions to generate SQL tailored to your database without connecting it to AI.

Read guide