Skip to main content
idapt
AccueilModèles IATarifs
Sign inStart free
All prompts

Prompt library

Explain what a SQL query really does

Execution-order walkthroughs match how SQL actually behaves rather than how it reads, which is where most misreadings start. The silent-behaviors section names the three mechanisms (join fan-out, NULL logic, quiet row loss) behind nearly every dashboard number that turned out wrong.

DataAnalyzeSuggested model: moonshotai/kimi-k2.7-code

Last reviewed July 17, 2026

The prompt
Explain the SQL query below.

{{query}}

Produce:
1. Plain-language answer first: what question does this query answer, in one sentence a stakeholder would accept.
2. The walk-through: step through the query in execution order (FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT, ORDER/LIMIT), one plain sentence per step, naming what rows exist after each.
3. The grain: one row of output represents what, exactly.
4. The silent behaviors: where rows quietly disappear (inner joins on nullable keys, WHERE on a NULL column), where duplicates could inflate numbers (fan-out joins before an aggregate), and how NULLs, ties, and timezones are treated.
5. The mismatch check: 3 plausible intents someone might have had, and whether this query serves each. Wrong-question bugs outnumber wrong-syntax bugs.
6. Suggested comment block: the header comment this query should carry so nobody has to do this again.

If the query references objects whose definition you cannot see, list the assumptions you are making about them.
Run in idaptOpens a new chat with the prompt prefilled. Nothing sends until you press send.

Fill in the variables

VariableWhat it isExample
{{query}}The query to explain[paste the SQL]

Frequently asked

Related prompts

Write SQL from a plain-language requestExplain legacy code before touching itDefine a metric before it defines you

Ready to get to work?

Free to start. No credit card. Never trained on your data.

Start free
  • Accueil
  • Tarifs
  • Modèles IA
  • Modèles d'image
  • Modèles de voix
  • Modèles vidéo
  • Classements
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Secrets
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • Code Execution
  • Computers
  • Computer Use
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • Blog
  • Cas d'usage
  • Comparisons
  • Best of
  • Learn
  • Free tools
  • Prompts
  • Templates
  • Changelog
  • Centre d'aide
  • FAQ
  • Confidentialité
  • Comparer tous les modèles
  • Support
  • Développeurs
  • Quickstarts
  • Référence API
  • Tarifs API
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]ConditionsPolitique de confidentialitéMentions légalesSignaler un contenu
X (Twitter)