เขียนคิวรีฐานข้อมูล (SQL)
A ready-to-use “Programming” AI prompt template, designed and tested with ChatGPT. Replace the (bracketed) parts below with your own needs.
Prompt template
เขียน SQL: 1) คิวรีตามความต้องการที่ฉันอธิบาย; 2) อธิบายทีละส่วนว่าทำอะไร; 3) ชี้ปัญหาประสิทธิภาพที่อาจเกิด (ขาดดัชนี, การสแกนทั้งตาราง) และวิธีแก้; 4) เตือนฉันถึงกรณีขอบ (NULL, ข้อมูลซ้ำ, เขตเวลา) โครงสร้างตาราง: "อธิบายตารางและคอลัมน์" สิ่งที่ฉันอยากคิวรี: "อธิบายความต้องการ"
How to use this prompt
- Copy the whole prompt above and paste it into ChatGPT or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: ChatGPT — ChatGPT – OpenAI’s Conversational AI Assistant