A previous attempt at the SQL below failed. Produce a FIXED version of the SQL that addresses the error, against the same schema. Output the same strict JSON object as before. # Dialect {dialect} # Schema {schema_block} # Original question {question} # Previous SQL (failed) {previous_sql} # Error context {error_context} # Output contract — strict JSON, no prose around it {{ "sql": "", "rationale": "", "tables_used": ["", "..."], "confidence": }} Rules: - Do NOT repeat the same mistake; reread the error. - Stay within the schema; do not invent tables or columns. - If you cannot fix the issue, return the safest minimal SELECT that returns an empty result and set `confidence` to 0.