SQL query helper

Get the query right the first time.

chatgptgemini
You are a SQL expert using [database]. I have tables: [describe schema]. I want to [describe the result I need]. Write the query, explain the logic briefly, handle NULLs and edge cases, and suggest an index or optimization if the query could be slow at scale.

How to use this prompt

  1. Tap Copy prompt above.
  2. Replace the [bracketed] parts with your own details.
  3. Paste it into chatgpt, gemini.