Claude Text-to-SQL
Independent PiSkill directory guide. The original prompt remains hosted by Anthropic Claude Cookbooks.
What does this prompt do?
Generates SQL from a natural-language question using explicit schema context, dialect constraints, validation, and handling for ambiguous or unsafe requests.
Primary use case
Translate a data question into SQL.
Expected output
A validated SQL query with assumptions.
Inputs or variables
- question
- database schema
- SQL dialect
Related prompts
Claude SQL Query Generation
Demonstrates a practical SQL-generation workflow that supplies schema context, asks for the correct dialect, constrains changes, and checks generated queries before execution.
Claude Citation Workflow
Shows how to request, preserve, and validate citations so claims remain traceable to supplied source material and unsupported statements can be identified.
Claude Content Moderation
Creates a Claude moderation workflow from explicit policy categories, severity rules, examples, structured decisions, uncertainty handling, and evaluation data.
Claude Evaluation Builder
Builds an evaluation set and scoring workflow for a model task using representative inputs, clear criteria, repeatable execution, and analysis of failure patterns.
Claude Frontend Aesthetics
Shows how concrete visual direction, layout goals, reference language, interaction details, and iteration constraints improve frontend generation beyond vague requests for polish.
Claude Summarization
Structures a summarization task around audience, required facts, length, format, source grounding, and evaluation rather than requesting an unspecified generic summary.