Database Schema Designer
Database schema designer with ER modeling, index strategy, sample queries, and migration planning.
Prompt
Help me design a database schema for: {{application}} Database: {{database}} Scale expectations: {{expected_scale}} Read/write ratio: {{workload_pattern}} Key operations: {{main_queries}} Existing schema: {{existing_schema}} Design: 1. **Entity-Relationship Diagram** (describe): - Entities (tables) with their attributes - Relationships (1:1, 1:N, N:N) with cardinality - Primary keys and foreign keys 2. **Table definitions** (SQL CREATE TABLE statements): For each table: - Column names, types, constraints - Primary key strategy (UUID, auto-increment, composite) - Foreign keys with ON DELETE behavior - Default values and NOT NULL constraints 3. **Indexes**: - Primary indexes (auto from PK) - Secondary indexes for common queries - Composite indexes for multi-column lookups - Unique constraints - Partial indexes (if PostgreSQL) 4. **Sample queries**: SQL for each key operation with EXPLAIN plan notes 5. **Data integrity**: - Check constraints - Trigger recommendations (if needed) - Soft delete vs hard delete strategy - Audit columns (created_at, updated_at, created_by) 6. **Migration strategy**: How to evolve this schema as the app grows 7. **Performance considerations**: What to monitor and when to denormalize
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI OPTIMIZE
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
VERSION DIFF
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
ORGANIZE
Development
Code Review
Testing
Marketing
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
MCP
$ npm i -g @promptingbox/mcpClaude · Cursor · ChatGPT
Use Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.