Database schema design prompt from requirements
Describe your application's entities and relationships and get a normalized schema with keys and index recommendations.
متى تستخدم هذا البرومبت
- When starting a new project and modeling data for the first time.
- When adding a new feature that needs new tables.
- When reviewing an existing schema for normalization issues.
نص البرومبت
Design a normalized {{language}} database schema for: {{focus}}. Include tables, columns with types, primary/foreign keys, and note any indexes worth adding.
{{CLIPBOARD}}{{language}}{{focus}}{{CLIPBOARD}}الكتلة {{CLIPBOARD}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».
كيف تستخدمه
- انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
- الصقه في ChatGPT أو Claude أو Gemini.
- عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.
مثال على النتيجة
-- orders CREATE TABLE orders ( id SERIAL PRIMARY KEY, customer_id INT NOT NULL REFERENCES customers(id), status VARCHAR(20) NOT NULL, created_at TIMESTAMP DEFAULT now() ); CREATE INDEX idx_orders_customer ON orders(customer_id); Note: consider a separate order_items table for line items (1-to-many).
نصائح للاستخدام
- Describe entities and relationships in plain English (a customer has many orders).
- Mention your expected scale and read/write patterns for better index advice.
- Ask for a version with soft-delete columns if your app never hard-deletes records.
النماذج الموصى بها
Claude
أسئلة شائعة
- Will it design for a specific database like PostgreSQL or MongoDB?
- Specify it in the language field; relational and document schemas are structured very differently.
- Can it review an existing schema instead of designing a new one?
- Yes, paste your current CREATE TABLE statements into the clipboard field and ask it to review rather than design from scratch.