SQL Query Review Checklist

SQL Query Review Checklist

Review a SQL query for correctness, authorization, performance and unsafe mutation risks before execution.

Create review a sql query for correctness, authorization, performance and unsafe mutation risks before execution.

Use these inputs:
- query: [query]
- database engine: [database engine]
- expected result: [expected result]

Return the finished result first. Then add a short assumptions note and three practical improvements. Do not invent facts, research, testimonials or results. If one essential detail is missing, use the safest reasonable assumption and label it instead of restarting with a long questionnaire.