Skip to main content
Text-to-SQL metrics help you measure how well your AI systems generate SQL queries from natural language inputs. These metrics evaluate multiple dimensions of SQL generation quality—from syntactic correctness to security—helping you build reliable and safe Text-to-SQL applications. Use these metrics when you want to:
  • Validate that generated SQL queries are syntactically correct for your target database dialect.
  • Ensure generated queries only reference tables, columns, and data types that exist in your schema.
  • Verify that SQL queries accurately reflect the user’s natural language intent.
  • Protect against SQL injection attacks and malicious query patterns.
  • Detect performance anti-patterns that could impact database availability.
Below is a quick reference table of all Text-to-SQL metrics:

Next steps