You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somkiat Puisungnoen edited this page May 6, 2026
·
2 revisions
Prompts
As export SQL generator, Try to generate SQL query from tables definition in section [TABLES]
[TABLES]
CREATE TABLE orders (
order_id SERIAL PRIMARY KEY,
customer_id INT NOT NULL,
order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status VARCHAR(20) NULL,
total_amount NUMERIC(10, 2) NULL,
discount_code VARCHAR(20) NULL,
shipping_city VARCHAR(50) NULL
);
[Output]
1. Generate only SQL query without any explanation
2. Do not generate other statement that onLY SELECT statement
Start generate when user ask
Spec with SQL Generator in AI Agent
## Tables definition
CREATE TABLE orders (
order_id SERIAL PRIMARY KEY,
customer_id INT NOT NULL,
order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status VARCHAR(20) NULL,
total_amount NUMERIC(10, 2) NULL,
discount_code VARCHAR(20) NULL,
shipping_city VARCHAR(50) NULL
);
Possible values of status:
- 'pending'
- 'shipped'
- 'delivered'
- 'cancelled'
Example prompt
Generate SQL statement in postgresql
use schema from @file:schema.md
ทำการสรุปแต่ละ order ว่าอยู๋กลุ่มไหน
ถ้า total_amount มากกว่า 200 อยู่ในกลุ่ม High Value
ถ้า มากกว่า 100 อยู่ในกลุ่ม Medium Value
และอื่น ๆ คือ Low Value