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.
In Depth
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.
How AI for Database Helps
AI for Database performs schema linking automatically using your introspected schema, so everyday business words map to the right tables and columns.
Related Terms
Schema-Aware AI
Schema-aware AI is an AI system that knows the structure of your specific database—its tables, columns, types, and relationships—and uses that knowledge to generate correct queries.
Text-to-SQL
The process of converting natural language questions into structured SQL queries that can be executed against a database.
Column Descriptions
Column descriptions are human-readable annotations attached to database columns that explain what each column contains and how its values should be interpreted.
Join Inference
Join inference is the ability of an AI query system to automatically determine which tables to join, and on which keys, to answer a question that spans multiple tables.
Semantic Layer
An abstraction layer that translates complex database structures into business-friendly terms and metrics.
Ready to try AI for Database?
Query your database in plain English. No SQL required. Start free today.
Free plan available · No credit card required