AiTeky Original Interactive Learning & Practice Advanced
Text-to-SQL and analytics agents: schemas, checks, guardrails and metrics that mean one thing
Build and test the parts around a model that answers questions from a database: describe the schema, score the SQL by its results, fence the connection, run a draft-repair-check loop, define metrics once in a semantic layer, and review the assistant before launch.
A chat box on top of a company database looks like a small project: a model writes SQL, the SQL runs, the answer comes back. In practice the model is the easy part. The failures that matter happen around it: the model was not told what a column means, a query runs and returns a wrong number, the connection allows more than it should, "revenue" has four meanings, and nobody measured how often the answer is wrong.
This course builds those surrounding parts with SQLite, numpy and pandas only, so everything runs in the browser. You describe a shop database so that columns can be found; score generated SQL by what it returns, and see how a test can be fooled; fence the connection with a read-only mode, an allow-list of columns and a work budget, and test it against 12 hostile queries; build the loop that reads a database error, repairs it, reconciles the result with a second method and declines when a check fails; define metrics once in a semantic layer and test a request parser on neat and sloppy phrasings; and finish with the launch review a head of finance would ask for.
We do not call a language model. Where a lesson needs one, a small stand-in plays its part, and the lesson says so. The data are simulated with a fixed seed. The numbers describe the harness and the stand-ins; a real model must be put through the same tests, and it will have its own results. What you keep is the method.
You need the SQL course and the generative AI course (or the AI agents course); the statistics course helps for the intervals.
- Learn lessons explain one idea at a time and let you compute it.
- Industry ready lessons decide and plan. Each ends with the interview questions that go with it.
- βΆ Run code in your browser. Nothing to install
- β Exercises that check themselves
- π Tap a word to see what it means
Locked. Sign up free
Learn
Understand each idea with everyday examples. No coding background needed.
- 01 50 min π AiTeky Pass The schema is the prompt: giving a model the right tables and columns Build a small shop database in SQLite, show what a model has to be told about it, and measure how often a simple word-matching step finds the right columns for 16 business questions with bare column names and with plain-English descriptions.
- 02 55 min π AiTeky Pass Is the SQL right? Execution accuracy, and the ways a test can fool you Score 21 candidate queries for 12 business questions three ways (it runs, the text matches the reference, the result matches the reference), find the queries each score gets wrong, and put an honest interval on an accuracy measured on only 12 questions.
- 03 50 min π AiTeky Pass Guardrails for generated SQL: read-only, allowed columns, a time budget Run 12 hostile queries and 8 ordinary ones against a keyword filter and against a guard built from SQLite's own authorizer, progress handler and read-only mode, and see which attacks each stops and what ordinary questions each wrongly refuses.
- 04 55 min π AiTeky Pass The agent loop: draft, run, read the error, repair, check, answer or decline Build the loop around a text-to-SQL model with a stand-in drafter: run the query read-only, repair the errors the database reports, reconcile the number with a second method, check that the answer's numbers come from the rows, and decline when a check fails, then count what each step adds over 12 questions.
- 05 55 min π AiTeky Pass Metrics defined once: a semantic layer, so "revenue" means one thing Show that four sensible definitions of Q1 revenue differ by up to 3.2 times, define each metric once with its own filters and allowed breakdowns, generate the SQL from a request of metric, breakdown and period, refuse what cannot be sliced, and test a stand-in request parser on 13 phrasings including one it gets wrong silently.
Industry ready
Real problems from real jobs, and the questions interviewers ask about them.

