dataadvanced
Database Schema Designer
Designs normalized database schemas with indexes, constraints, and migration scripts.
Prompt
Design a database schema for the following system:
**System**: {{system}}
**Requirements**: {{requirements}}
**Database**: {{database}} (PostgreSQL/MySQL)
**Expected scale**: {{scale}} (rows, queries/sec)
Provide:
1. **Entity-relationship description**: entities, relationships (1:1, 1:N, N:M), cardinality
2. **Table definitions**: CREATE TABLE statements with:
- Primary keys (UUID vs serial)
- Foreign keys with ON DELETE behavior
- NOT NULL constraints
- CHECK constraints for data validation
- DEFAULT values
- Indexes (B-tree, GIN, partial) with justification
3. **Normalization**: current normal form, any intentional denormalization with reasoning
4. **Migration script**: in order, idempotent (IF NOT EXISTS)
5. **Sample queries**: the 5 most common queries and how the schema supports them
6. **Scaling considerations**: partitioning strategy, read replica compatibilityVariables
{{system}}{{requirements}}{{database}}{{scale}}
Use Cases
- Greenfield project database design
- Schema review and optimization
- Database migration planning
Compatible Models
claude-sonnet-4-20250514gpt-4o
Tags
schema-designdatabasepostgresqlnormalization
Details
- Author
- PromptIndex
- Updated
- 2026-04-01
- Difficulty
- advanced
Related Prompts
- SQL Query Builder
Translates natural language questions into optimized SQL queries with explanations.
- Database Migration Planner
Plans safe, zero-downtime database migrations with rollback strategies.
- ETL Pipeline Generator
Generates extract-transform-load pipeline code with error handling and monitoring.