Skip to content
Advanced
sql
database

Write an SQL query

Query data correctly. Tuned for Any AI tool.

Prompt

Write an SQL query for [DATABASE] that [GOAL]. Tables: [SCHEMA]. Explain the query and suggest an index.

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.

Related prompts

Intermediate

Analyse a dataset

Turn numbers into insights. Tuned for Any AI tool.

1,689 copies