Advanced
sql
database
Write an SQL query
Query data correctly. Tuned for Gemini.
Prompt
Write an SQL query for [DATABASE] that [GOAL]. Tables: [SCHEMA]. Explain the query and suggest an index. Where relevant, format the output for Google Docs or Sheets.
Replace the [HIGHLIGHTED] parts with your own details.
Example output
A query with joins, grouping and an index tip.
Tips
- Give table and column names exactly.
