GitHub Copilot Prompt for Generating a Database Schema
GitHub Copilot radically transforms how developers design their databases. Instead of starting from a blank page and manually writing every CREATE TABLE statement, you can now describe your business domain in natural language and obtain a complete schema in seconds. The tool excels particularly at generating relational schemas with appropriate primary keys, foreign keys, indexes, and constraints. Whether you work with PostgreSQL, MySQL, SQLite, or SQL Server, Copilot adapts the syntax and data types to the target SQL dialect. This approach significantly accelerates the modeling phase, reduces syntax errors, and allows you to focus on business logic rather than SQL mechanics. A well-crafted prompt is the key: by specifying the application context, entity relationships, and business constraints, you get a production-ready schema that respects normalization and performance best practices.
The prompt
Generate a complete PostgreSQL database schema for a [DESCRIBE_YOUR_BUSINESS_DOMAIN, e.g., meeting room booking management] application. The schema must include:
- All necessary tables with their columns, appropriate data types, and explanatory comments
- Primary keys (UUID or SERIAL as appropriate)
- Foreign keys with appropriate ON DELETE and ON UPDATE actions
- Relevant CHECK, UNIQUE, and NOT NULL constraints
- Indexes to optimize frequent queries (search, filtering, sorting)
- Audit columns created_at and updated_at with default values
- ENUM types if needed for statuses or categories
Respect 3rd Normal Form (3NF). Use snake_case for naming. Add SQL comments explaining modeling choices for each table. End with INSERT examples for reference data.
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 is effective because it provides a structured seven-point framework that guides Copilot to a comprehensive result, eliminating common omissions like indexes or constraints. Explicit mention of the SQL dialect (PostgreSQL) and normalization level (3NF) reduces ambiguity and produces directly usable code. Finally, the request for comments and sample data forces the model to justify its choices and deliver a complete output.
Expected result
Variants by level
FAQ
Can GitHub Copilot generate schemas for databases other than PostgreSQL?
How can I ensure the generated schema follows normalization best practices?
Can I generate Prisma, Drizzle, or TypeORM migrations from the SQL schema?
Related prompts
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- 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
GitHub Copilot Prompt for Generating Advertising Visuals
GitHub Copilot, the AI-powered coding assistant, is not limited to classic code generation. It can also help you create powerful visuals...
GitHub Copilot Prompt for Generating Exercises
GitHub Copilot, the AI-powered coding assistant from GitHub, proves to be a remarkable tool for generating educational exercises suitable for all levels.
GitHub Copilot Prompt for Grading Papers
GitHub Copilot, the AI assistant integrated directly into your code editor, can be creatively repurposed to grade student papers or employee documents. By leveraging its text analysis and structured generation capabilities, you can transform Copilot into an intelligent grader capable of evaluating grammar, spelling, argumentative coherence, and writing quality of any text. The major advantage of Copilot is its seamless integration with your workflow: paste the text to be graded into a file, launch the prompt in Copilot Chat, and get a detailed correction with annotations, score, and personalized recommendations. Whether you are a teacher grading essays, a trainer evaluating internship reports, or a manager reviewing professional documents, this approach saves considerable time while ensuring consistent and objective grading. The proposed prompt is optimized to produce constructive, kind, and pedagogical feedback, clearly distinguishing factual errors from stylistic clumsiness.
GitHub Copilot Prompt for Interview Preparation
GitHub Copilot, the AI development assistant integrated into code editors, can become a formidable ally for preparing a technical or professional interview.
GitHub Copilot Prompt for Optimizing SEO
GitHub Copilot, the AI-powered code assistant from GitHub, has become an essential tool for developers looking to optimize the natural referencing of their web projects. Beyond simple code completion, Copilot can generate optimized meta tags, structure schema.org data, create dynamic sitemaps, and implement technical SEO best practices directly in your codebase. By formulating precise prompts in your editor, you can automate the creation of SEO-friendly components, generate appropriate robots.txt files, optimize server-side rendering, and implement lazy loading to improve Core Web Vitals. This programmatic approach to SEO ensures technical consistency across your entire site, eliminates human errors, and significantly accelerates the deployment of optimizations. Whether you're working on a static site, a Next.js application, or an e-commerce project, the following prompts will enable you to fully leverage GitHub Copilot to transform your natural referencing.
GitHub Copilot Prompt for Organizing a Project
GitHub Copilot goes beyond code completion: it's a true project assistant that can help you structure, plan, and organize your entire development. Whether you're starting a new project from scratch or taking over an existing codebase, Copilot can generate consistent folder structures, suggest naming conventions, create essential configuration files, and even draft a technical roadmap. By crafting the right prompt, you turn Copilot into a software architect that analyzes your needs, anticipates dependencies, and produces a ready-to-use project skeleton. This approach saves hours of manual setup and ensures your project follows best practices from the first commit. On this page, you'll find a main optimized prompt, variants suited to your experience level, and answers to the most common questions about project organization with GitHub Copilot.
Go further
Get new prompts every week
Join our newsletter.