Given the following database schema:
[PASTE SCHEMA]
Write an optimized SQL query to: [DESCRIBE WHAT YOU NEED]. Include: proper JOINs, WHERE clauses, GROUP BY if needed. Add comments explaining the logic. Also suggest an index that would improve this query's performance.
Pro Tip
Copy this prompt and paste it directly into ChatGPT, Claude, or any AI assistant. Modify the placeholders to fit your specific needs.