Glossary · AI & ML

Schema Linking

Schema linking is the step in text-to-SQL where words in a user's question are matched to the specific tables and columns in the database that they refer to.

When you ask "show me revenue by region", nothing in your database is literally called "revenue" or "region"–the system has to figure out that revenue means SUM(order_items.price * quantity) and region means customers.country grouped into territories. That mapping is schema linking, and it is where most text-to-SQL errors originate: get the linking wrong and the SQL can be syntactically perfect yet answer a different question. Strong schema linking uses column names, data types, foreign keys, sample values, and any available descriptions to resolve what the user meant. It is why the same AI performs very differently on a well-documented schema versus a cryptic one.

In practice

How AI for Database applies it

AI for Database performs schema linking automatically using your introspected schema, so everyday business words map to the right tables and columns.
AI & ML · 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