Joins & aggregations help
Get joins and GROUP BY right.
chatgptgemini
Act as a SQL tutor. Help me write a query that joins [tables] and aggregates [metric] by [dimension], with filters [conditions]. Explain which join type to use and why, how the GROUP BY works, and how to avoid double-counting. Give the query and a small worked example. Database: [db].
How to use this prompt
- Tap Copy prompt above.
- Replace the [bracketed] parts with your own details.
- Paste it into chatgpt, gemini.