Create a Complete and Optimized Database Schema
A comprehensive prompt to generate a professional database schema with DDL, relationships, indexes and test data.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un architecte de bases de données expérimenté. Conçois un schéma de base de données complet pour une application de type [TYPE_APPLICATION] utilisant [SYSTEME_SGBD]. Le domaine métier est : [DESCRIPTION_METIER].
Ton livrable doit inclure :
-
Modèle conceptuel : Liste toutes les entités principales, leurs attributs et les relations entre elles (1-1, 1-N, N-N).
-
Script SQL de création : Génère le DDL complet avec :
- Tables avec colonnes typées correctement
- Clés primaires (préfère les UUID ou SERIAL selon le SGBD)
- Clés étrangères avec ON DELETE / ON UPDATE appropriés
- Contraintes NOT NULL, UNIQUE, CHECK pertinentes
- Index sur les colonnes fréquemment requêtées
- Timestamps created_at et updated_at sur chaque table
-
Normalisation : Assure-toi que le schéma respecte au minimum la 3NF. Justifie toute dénormalisation volontaire.
-
Diagramme textuel : Fournis un diagramme ERD en notation Mermaid.
-
Données de test : Génère 3 à 5 INSERT par table avec des données réalistes.
-
Recommandations : Propose des optimisations (partitionnement, index partiels, vues matérialisées) adaptées au volume estimé de [VOLUME_DONNEES] enregistrements.
Contraintes techniques supplémentaires : [CONTRAINTES_SPECIFIQUES]
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Why this prompt works
<p>This prompt guides the AI to produce a professional-quality database schema. By specifying the <strong>application type</strong> and <strong>target DBMS</strong>, you get directly usable output with the appropriate SQL syntax (PostgreSQL, MySQL, SQLite, etc.).</p><p>The 6-point structure ensures a complete deliverable: from the conceptual model to the SQL script, including the ERD diagram in Mermaid that you can visualize instantly. Test data allows you to validate the schema immediately.</p><p>For better results, be specific in the <strong>business description</strong>: list the key features of your application. For example, instead of "e-commerce", specify "multi-vendor marketplace with inventory management, customer reviews and coupon system". The richer the context, the more relevant the schema will be.</p>
Use Cases
Expected Output
A complete database schema including a conceptual model, a ready-to-execute DDL SQL script, a Mermaid ERD diagram, test data and optimization recommendations.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour éviter des jointures coûteuses, pense à spécifier dans '[VOLUME_DONNEES]' une estimation haute. Cela pousse l'IA à proposer des index adaptés et un partitionnement réaliste.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Design IAM least-privilege policy
Apply least-privilege IAM
Sora Prompt for Debugging Code
Sora, OpenAI's video generation model, may seem like a surprising choice for debugging code. Yet its ability to produce dynamic visualizations opens up unique perspectives for understanding and resolving complex bugs. By generating visual representations of execution flow, data structures, or interactions between components, Sora allows developers to literally see their code's behavior. This visual approach is particularly effective for bugs related to user interfaces, animations, state transitions, or rendering issues. Instead of sifting through endless logs, you can ask Sora to create a video illustrating expected versus observed behavior, making problem identification easier. The prompts on this page guide you in using Sora for debugging, turning textual bug descriptions into clear visualizations that accelerate resolution. Whether you're working on front-end, visual algorithms, or complex data flows, these techniques help you adopt a visual debugging approach.
Design a Versioned API
Evolving a public API without breaking integrations
Writing Your Landing Page
To launch quickly and test your value proposition