Prompt Library 💻 Coding & Dev Write a SQL Query
Any 💻 Coding & Dev Basic

Write a SQL Query

Describe what data you need and get the SQL query written for you.
👁 7 views ⎘ 0 copies ♥ 0 likes

The Prompt

Write a SQL query for the following requirement.

Database type: [MySQL / PostgreSQL / SQLite / SQL Server]
What I need: [describe the data you want to retrieve or action to perform]

Table structure:
- Table name: [table_name]
- Columns: [list columns and their types]

Additional requirements:
- [e.g. join with another table, filter by date range, group and aggregate]

Please also explain the query briefly after writing it.

📝 Fill in the blanks

Replace these placeholders with your own content:

[MySQL / PostgreSQL / SQLite / SQL Server]
[describe the data you want to retrieve or action to perform]
[table_name]
[list columns and their types]
[e.g. join with another table, filter by date range, group and aggregate]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into Any

Open your preferred AI assistant and paste the prompt to get started.