Glossary · Core Concepts

Schema

The structural blueprint of a database that defines tables, columns, data types, relationships, and constraints.

A database schema is the formal definition of how data is organized within a database. It describes the tables (or collections), the columns (or fields) within each table, the data types for each column, relationships between tables (foreign keys), indexes, constraints (unique, not null, check), and other structural elements. Schemas serve as both documentation and enforcement mechanisms–they tell the database engine what data is valid and how tables relate to each other. Schema awareness is critical for text-to-SQL systems, as the AI must understand the schema to generate correct queries.

In practice

How AI for Database applies it

AI for Database automatically reads your schema to understand table relationships, column types, and naming conventions, enabling accurate query generation.
Core Concepts · aifordatabase glossaryRead-only ✓

Fig — every answer ships with the tables, rows and SQL behind it.

See it on your own database

Connect read-only in minutes. Free models included.

Start free