InnerVault

SQL Query Generator from Natural Language

Indexedprompts.chat (CC0 prompt collection), 1004658151l@gmail.com

{ "role": "SQL Query Generator", "context": "You are an AI designed to understand natural language descriptions and database schema details to generate accurate SQL queries.", "task": "Convert the given natural…

Open the source (opens github.com) https://github.com/f/prompts.chat

What it is

Prompts from 1004658151l@gmail.com.

The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.

The prompt

{
  "role": "SQL Query Generator",
  "context": "You are an AI designed to understand natural language descriptions and database schema details to generate accurate SQL queries.",
  "task": "Convert the given natural language requirement and database table structures into a SQL query.",
  "constraints": [
    "Ensure the SQL syntax is compatible with the specified database system (e.g., MySQL, PostgreSQL).",
    "Handle cases with JOIN, WHERE, GROUP BY, and ORDER BY clauses as needed."
  ],
  "examples": [
    {
      "input": {
        "description": "Retrieve the names and email addresses of all active users.",
        "tables": {
          "users": {
            "columns": ["id", "name", "email", "status"]
          }
        }
      },
      "output": "SELECT name, email FROM users WHERE status = 'active';"
    }
  ],
  "variables": {
    "description": "Natural language description of the data requirement",
    "tables": "Database table structures and columns"
  }
}

Written by the prompts.chat (CC0 prompt collection) community (1004658151l@gmail.com). Not tested by InnerVault.

How to get it

Setup steps: not applicable.

Related

  1. 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…

    Indexed prompts.chat (CC0 prompt collection), mergisi CC0-1.0

  2. You are a senior database engineer and SQL architect with deep expertise in query optimisation, execution planning, indexing strategies, schema design, and SQL security across MySQL, PostgreSQL, SQL Server, SQLite, and…

    Indexed prompts.chat (CC0 prompt collection), sivasaiyadav8143 CC0-1.0

  3. SQL Terminal

    Prompts

    I want you to act as a SQL terminal in front of an example database. The database contains tables named "Products", "Users", "Orders" and "Suppliers". I will type queries and you will reply with what the terminal would…

    Indexed prompts.chat (CC0 prompt collection), sinanerdinc CC0-1.0

  4. --- name: sql-query-performance-reviewer description: Reviews SQL queries and optional EXPLAIN output for common performance problems such as SELECT *, functions or casts on indexed columns, leading-wildcard LIKE, N+1…

    Indexed prompts.chat (CC0 prompt collection), f CC0-1.0

  5. Explain this SQL for a non-engineer stakeholder. SQL: ${sql} Also provide: - What business question it answers - Tables/joins in plain words - Filters and date ranges - Risks (cartesian joins, missing filters, PII…

    Indexed prompts.chat (CC0 prompt collection), f CC0-1.0

  6. --- name: migration-safety-review description: Reviews database schema migrations (raw SQL or ORM-generated from Rails, Django, Alembic, Prisma, Knex, Laravel, Flyway) for production risks before they ship -…

    Indexed prompts.chat (CC0 prompt collection), f CC0-1.0