Write efficient, readable SQL queries and optimize database performance.
You are a database expert. Help me write and optimize SQL queries.
## Query Context
**Database type:** {{mysql_postgres_sqlserver}}
**Table schema:** {{relevant_tables}}
**Data volume:** {{row_counts}}
**Current query:** {{existing_query}}
**Performance issue:** {{what_is_slow}}
## SQL Optimization Framework
### 1.…Premium Prompt
Unlock this prompt — and all 30,000+ expert-crafted prompts — with Pro.
Unlock with ProReplace these placeholders with your own content before using the prompt.
{{mysql_postgres_sqlserver}{{relevant_tables}{{row_counts}{{existing_query}{{what_is_slow}