CCAO-F Prompting and Context Engineering Practice Question
A team is using Claude to generate SQL queries from natural-language questions against a complex schema. They want to improve correctness on multi-table joins. They decide to include a step where Claude first outlines the relevant tables and join keys, then writes the final SQL. Where should this reasoning step be placed, and how should it be handled, to best improve the final query?
⚠ Common exam trap
The trap here is assuming that any inclusion of reasoning improves results, when placing the reasoning after the deliverable turns it into rationalization rather than planning.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Have Claude generate the reasoning outline first in a separate step, then in a second step provide that outline along with the question to produce the final SQL.
For complex generation tasks, separating planning from the final deliverable improves both quality and usability. Producing the outline in a first step and then using it in a second step to generate SQL keeps reasoning out of the executable output and lets the model focus on each stage. Combining reasoning with the final SQL, generating multiple candidates, or placing the outline after the SQL all fail to provide the same planning benefit.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Ask Claude to produce the outline and the final SQL together in one response, then have the application extract only the SQL portion.
Why it's wrong here
Producing the outline and final SQL together can work, but it mixes reasoning with the deliverable and requires the application to parse and separate them. That parsing adds fragility and may allow stray reasoning text to leak into the executed query. A cleaner approach separates the reasoning step from the final output so the SQL can be used directly without extraction logic.
- ✗
Instruct Claude to skip the outline and instead generate three different SQL queries, then choose the one that looks most efficient.
Why it's wrong here
Generating multiple queries and picking one by appearance does not systematically improve correctness for multi-table joins and may introduce inconsistent or invalid SQL. Without a reasoning step, the model may miss relevant tables or join keys. The scenario specifically aims to improve correctness through outlining, so replacing that with multiple candidates and a subjective choice does not address the stated goal.
- ✓
Have Claude generate the reasoning outline first in a separate step, then in a second step provide that outline along with the question to produce the final SQL.
Why this is correct
Separating the reasoning into its own step and then feeding it back for the final SQL generation keeps the reasoning from contaminating the deliverable and gives the model a chance to focus. The second step can be constrained to output only SQL, making it directly usable. This staged approach is well suited to complex multi-table joins where intermediate planning improves correctness.
- ✗
Place the outline instruction after the final SQL in the prompt so Claude can verify its query against the outline before responding.
Why it's wrong here
Asking for the outline after the final SQL does not give the model the benefit of planning before writing the query; it becomes a post-hoc check. The outline may be rationalized to match an already-written query rather than guiding it. To improve correctness on complex joins, the reasoning should inform the generation, not follow it as an afterthought.
About these practice questions
One of 259 original CCAO-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAO-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAO-F exam.