This prompt

SQL Query Generator
Context:
This prompt is used by AI2sql to generate SQL queries from natural language.
AI2sql focuses on correctness, clarity, and real-world database usage.

Purpose:
This prompt converts plain English database requests into clean,
readable, and production-ready SQL queries.

Database:
${db:PostgreSQL | MySQL | SQL Server}

Schema:
${schema:Optional — tables, columns, relationships}

User request:
${prompt:Describe the data you want in plain English}

Output:
- A single SQL query that answers the request

Behavior:
- Focus exclusively on SQL generation
- Prioritize correctness and clarity
- Use explicit column selection
- Use clear and consistent table aliases
- Avoid unnecessary complexity

Rules:
- Output ONLY SQL
- No explanations
- No comments
- No markdown
- Avoid SELECT *
- Use standard SQL unless the selected database requires otherwise

Ambiguity handling:
- If schema details are missing, infer reasonable relationships
- Make the most practical assumption and continue
- Do not ask follow-up questions

Optional preferences:
${preferences:Optional — joins vs subqueries, CTE usage, performance hints}

Related prompt

Plan a redesign for this web page before making any edits.

Goal:
Improve visual hierarchy, clarity, trust, and conversion
while keeping the current tech stack.

Your process:
1. Inspect the existing codebase, components, styles, tokens, and layout primitives.
2. Identify UX/UI issues in the current implementation.
3. Ask clarifying questions if brand/style/conversion intent is unclear.
4. Produce a design-first implementation plan in markdown.

Include:
- Current-state audit
- Main usability and visual design issues
- Proposed information architecture
- Section-by-section page plan
- Component inventory
- Reuse vs extend vs create decisions
- Design token changes needed
- Responsive behavior notes
- Accessibility considerations
- Step-by-step implementation order
- Risks and open questions

Constraints:
- Reuse existing components where possible
- Keep design system consistency
- Do not implement yet

How to use it

  1. Copy the sql query generator prompt template.
  2. Paste your specific details into any bracketed placeholders.
  3. Run in ChatGPT, Claude, or Gemini to get targeted results.

Things to check

  • Review AI-generated outputs for factual accuracy before production use.
View all 807 Coding prompts →
Codingintermediate

Integrate a React Component

Copy-and-use AI prompt for integrate a react component with role framing, constraints, and instructions.

Codingintermediate

3D Sneaker Showcase Website

Copy-and-use AI prompt for 3d sneaker showcase website with role framing, constraints, and instructions.

Codingintermediate

3D FPS Game

Copy-and-use AI prompt for 3d fps game with role framing, constraints, and instructions.

Codingintermediate

3D Racing Game

Copy-and-use AI prompt for 3d racing game with role framing, constraints, and instructions.

Codingintermediate

3D Space Explorer

Copy-and-use AI prompt for 3d space explorer with role framing, constraints, and instructions.

Codingintermediate

7v7 Football Team Generator App

Copy-and-use AI prompt for 7v7 football team generator app with role framing, constraints, and instructions.

Codingadvanced

SEO Chrome Extension Builder

Copy-and-use AI prompt for seo chrome extension builder with role framing, constraints, and instructions.

Codingadvanced

CLI Project Preferences

Copy-and-use AI prompt for cli project preferences with role framing, constraints, and instructions.