A hands-on guide to text-to-SQL and AI agents for data analysis: schema context, semantic layers, read-only execution, self-correction loops, evaluation, and showing the SQL behind every number.