Database schema design prompt from requirements

Describe your application's entities and relationships and get a normalized schema with keys and index recommendations.

بواسطة ‪Ahmed Eid‬‏Claude0 نسخة

متى تستخدم هذا البرومبت

  • 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}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».

كيف تستخدمه

  1. انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
  2. الصقه في ChatGPT أو Claude أو Gemini.
  3. عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.

مثال على النتيجة

-- 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.

برومبتات ذات صلة

Generate a GraphQL Schema from a Description

Describe your data and operations in plain English and get a complete, documented GraphQL schema.

Design a GraphQL schema (types, queries, mutations) for: {{focus}}. Use {{language}} conventions and include field-level descriptions. {{CLIPBOARD}}

{{focus}}{{language}}{{CLIPBOARD}}

Generate Realistic Mock Data for Testing

Get realistic, varied mock data, including edge cases, matched to your schema, ready to seed a test database.

Generate {{focus}} realistic mock/test data records in {{language}} format for this schema or type, with varied and edge-case values. {{CLIPBOARD}}

{{focus}}{{language}}{{CLIPBOARD}}

Explain What This Legacy Code Actually Does

Paste unfamiliar or legacy code and get a plain-language walkthrough, with dead code and possible bugs flagged.

Walk through this {{language}} code line by line and explain what it does, in plain language. Flag anything that looks like dead code, a workaround, or a potential bug. {{CLIPBOARD}}

{{language}}{{CLIPBOARD}}

Generate a Dockerfile for Your App

Get a secure, optimized Dockerfile tailored to your language and framework, ready to build and run.

Write a production-ready Dockerfile for a {{language}} app using {{framework}}. Use multi-stage builds where useful, minimize image size, and run as a non-root user. Notes: {{focus}}. {{CLIPBOARD}}

{{language}}{{framework}}{{focus}}{{CLIPBOARD}}
المزيد في برمجة