You already know: the SQL path (joins, aggregation, window functions), enterprise RAG (retrieval over a large corpus) and the financial filings case (numbers that must be exactly right). This case adds two new risks: a query that runs perfectly and answers the wrong question, and a single careless query that costs more than a month of model calls.
How to read this lesson. No code, on purpose: the system writes queries, but the design discussion is about meaning, checks, permissions and cost. Numbers marked assumed are assumptions you state out loud; prices are illustrative.
1. The prompt, and the questions that change the design
The mid-level answer: "put the schema in the prompt, generate SQL, run it". A staff candidate sees four harder problems: meaning ("active users" has a specific, governed definition, and guessing it produces a plausible wrong number), scale of the schema (thousands of tables cannot fit in a prompt), permissions (users must see only data they are allowed to see), and warehouse cost (one unfiltered scan of an event table can be very expensive).
Assumptions you state: