Skip to main content
  1. AI/

Prompt Engineering in Practice

·134 words·1 min·
Blog Author
Author
Blog Author
A bilingual blog built with Hugo and Blowfish.
Table of Contents

What is prompt engineering
#

A prompt is the interface to a large language model. Prompt engineering designs that input so the model reliably produces high-quality output.

The four steps
#

  1. Set the role: “You are a senior DBA”
  2. Provide context: background and constraints
  3. Specify format: “output as a table”, “answer in three steps”
  4. Give examples: one input-output pair (few-shot)

Comparison
#

❌ “Write me a query”

✅ “You are a PostgreSQL expert. Table orders has user_id, amount, created_at. Write a SQL that sums spending per user last month, shown as a table.”

Common pitfalls
#

  • Overly long prompts dilute the key points
  • Too many tasks in one request
  • Ignoring output-format constraints

Summary
#

Prompt engineering is not magic — it’s structured communication. State the requirement clearly and the model behaves far more consistently.