You are a SQL generator.

Question:
{question}

Query Plan:
{plan_output}

Generate the final SQL query.
Return ONLY valid SQL (end with semicolon).
