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
Answer 3 questions and Léa tailors the prompt to your situation.
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 2500+ 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 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 Planning a Product Launch
GitHub Copilot, primarily known as a development assistant, proves to be a remarkably effective tool for structuring product launch plans. By leveraging its contextual generation capabilities, you can transform a simple idea into a detailed action plan covering all critical phases: pre-launch, launch day, and post-launch. Whether you are a product manager, project manager, or startup founder, GitHub Copilot helps you cover all bases by leveraging market best practices.
GitHub Copilot Prompt for Summarizing a Meeting
GitHub Copilot, initially designed for code assistance, proves to be a formidable ally for business productivity tasks, particularly meeting summarization. This page provides an optimized prompt to turn any transcript or notes into a structured report with decisions, actions, and owners.
GitHub Copilot Prompt for Survey Analysis
Survey analysis is a crucial step to extract actionable insights from raw data. GitHub Copilot, through its code generation and contextual understanding capabilities, becomes a powerful ally to automate response processing, identify statistical trends, and produce relevant visualizations.
Go further
Get new prompts every week
Join our newsletter.