P

Prompt Claude pour Generer Un Schema De Base De Donnees

The design of a database schema is a fundamental step of any software project. A well-thought-out schema ensures data consistency, facilitates queries and avoids long-term performance issues. Yet this task requires expertise in relational modeling, normalization and selection of data types adapted to the target DBMS. Claude excels in this area: by providing a functional description of your project, it generates a complete schema with tables, columns, types, constraints, indexes and relationships. It applies normalization best practices, proposes consistent naming conventions and anticipates common needs such as audit columns or soft deletes. Whether you start from a specification, a list of business entities or an existing schema to refactor, Claude produces a DDL ready to execute or a structured diagram that you can refine iteratively. It is a valuable accelerator for both solo developers and teams who want to quickly validate a data architecture before coding.

The prompt

Claude

You are an experienced database architect. From the following functional description, generate a complete relational database schema.

Project: [Describe your application, e.g., project management platform with teams, tasks and comments]

Target DBMS: [PostgreSQL / MySQL / SQLite]

Requirements:

  • Apply at least 3rd normal form (3NF)
  • Use snake_case naming conventions
  • Add audit columns (created_at, updated_at) on every table
  • Define primary keys, foreign keys, indexes and NOT NULL / UNIQUE constraints
  • Handle soft delete (deleted_at) where relevant
  • Add SQL comments on each table and key column

Output format:

  1. A text diagram of entities and relations (list of tables with their relationships)
  2. The complete DDL script (CREATE TABLE) ready to execute
  3. A separate script for recommended indexes
  4. Design watch points and trade-offs explained

Be exhaustive on data types (VARCHAR with length, TIMESTAMP WITH TIME ZONE, etc.) and justify your modeling choices.

Personalize this prompt with Léa

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Why it works

This prompt works because it assigns a precise expert role to Claude, which activates its in-depth knowledge of relational modeling. It imposes concrete technical constraints (3NF, conventions, audit columns) that eliminate ambiguity and produce a directly usable result. Finally, the structured output format with four deliverables forces Claude to cover all aspects of a professional schema, from design to performance recommendations.

Expected result

Claude generates a complete schema including a textual entity-relationship diagram, a DDL script with all tables, typed columns, primary and foreign keys, constraints and SQL comments. You also get a separate index script optimized for common queries, as well as a section explaining modeling choices and possible trade-offs. Everything is ready to be executed directly in your target DBMS.

Variants by level

FAQ

Can Claude generate a schema for any DBMS?
Yes, Claude masters the DDL syntax of all major DBMS: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle and even NoSQL databases like MongoDB (with validation schemas). Always specify the target DBMS in your prompt because data types, constraints and features vary significantly. For example, PostgreSQL supports JSONB types and GIN indexes, while MySQL has specifics on storage engines (InnoDB vs MyISAM).
How to ask Claude to modify an existing schema rather than create a new one?
Paste your existing SQL schema in the prompt and explicitly request modifications. For example: "Here is my current schema [paste DDL]. I need to add a roles and permissions system. Generate only the necessary ALTER TABLE and CREATE TABLE statements, without touching existing tables except to add foreign keys." Claude will generate incremental migration scripts rather than a complete schema from scratch.
Does the schema generated by Claude respect normal forms?
Claude applies reasonable normalization by default, usually in 3NF. However, it is recommended to specify it explicitly in your prompt, because without clear instruction, Claude might make denormalization compromises to simplify the response. If you have strict requirements (BCNF, 4NF), mention them. Claude is also able to justify when controlled denormalization is preferable for performance, for example to avoid costly joins on very frequent queries.

Related prompts

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 4800+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More prompts to explore

Prompt Claude to Create a Business Plan

Creating a solid business plan is a crucial step for any entrepreneur, but the process can be long and complex. Claude, Anthropic's AI assistant, excels at structuring information and strategic analysis, making it a valuable ally for drafting a professional business plan. Thanks to its ability to synthesize market data, model financial projections, and articulate a clear value proposition, Claude supports you through every section of the document: executive summary, market analysis, commercial strategy, operational plan, and financial forecasts. Whether you're preparing a file for investors, a bank loan application, or simply an internal roadmap, a well-crafted prompt allows you to obtain a structured, coherent business plan tailored to your industry. The prompt engineering approach enables you to guide Claude towards a customized result, integrating your specific data and strategic objectives to produce a truly actionable document.

Prompt Claude to Create a Marketing Plan

Creating a solid marketing plan is a strategic exercise that requires a global vision of the market, a fine understanding of your target audience, and the ability to articulate objectives, channels, and budgets consistently.

Prompt Claude to Create a Quiz

Creating an engaging and pedagogically sound quiz requires time: formulating clear questions, calibrating difficulty, writing plausible wrong answers

Prompt Claude to Create a UI Design

Claude has become an essential ally for designers and developers who want to create professional-quality user interfaces. Thanks to its deep understanding of design principles, modern CSS frameworks, and UX best practices, Claude can generate complete wireframes in HTML/CSS, propose consistent design systems, and produce production-ready frontend code. Whether you are designing a landing page, a dashboard, or a mobile application, Claude analyzes your functional and aesthetic needs to produce visually polished, accessible, and responsive interfaces. The major advantage lies in its ability to iterate quickly: you describe your vision, Claude generates a first version, then you refine together until the desired result. It masters Tailwind CSS, shadcn/ui, visual hierarchy principles, color theory, and WCAG accessibility standards. Unlike traditional design tools, Claude understands the business context of your project and adapts its suggestions accordingly, making it a particularly powerful tool for rapid prototyping and producing final interfaces.

Prompt Claude to Define a Positioning

Defining a clear positioning is the cornerstone of any successful marketing strategy. Without a solid positioning, your messages drown in the mass e

Prompt Claude to Generate Exercises

Claude excels at creating educational exercises adapted to all levels and subjects. Whether you are a teacher, trainer, or instructional designer, Anthropic's AI allows you to quickly generate structured, progressive exercises aligned with your learning objectives. By providing a well-constructed prompt, you obtain varied exercises — MCQs, fill-in-the-blanks, case studies, open problems — with their detailed answer keys and precise evaluation criteria. Claude's major advantage lies in its ability to adjust difficulty levels, vary formats, and produce clear educational explanations for each answer. No more hours spent designing batteries of exercises: in seconds, you have a coherent, ready-to-use set. This guide offers an optimized prompt as well as variants by level to get the most out of Claude in exercise generation.

Go further

Get new prompts every week

Join our newsletter.