Database Schema Designer
Design a production-ready database schema from a plain-language description, including tables, relationships, indexes, and migration SQL.
Content
Design a database schema for the following application: **Application Type:** {{app_type}} **Database:** {{database}} (e.g., PostgreSQL, MySQL, SQLite, MongoDB) **Core Features:** {{core_features}} **Scale Requirements:** {{scale}} (e.g., 10K users, 1M records, multi-tenant) **Special Requirements:** {{special_requirements}} (e.g., soft deletes, audit trail, multi-currency) Please provide: ## 1. Entity-Relationship Overview Describe the main entities and their relationships in plain language before any SQL. ## 2. Schema Design For each table: ```sql CREATE TABLE table_name ( -- columns with types, constraints, defaults ); ``` Include: - Primary keys (use UUIDs for distributed systems, integers for performance-critical) - Foreign keys with ON DELETE behavior - NOT NULL constraints - Default values - Check constraints where appropriate ## 3. Indexes List all recommended indexes with justification: ```sql CREATE INDEX ... ``` ## 4. Relationships Summary Table showing: Table โ Relationship โ Table (1:1, 1:N, N:M) ## 5. Design Decisions - Why you chose this structure over alternatives - Any denormalization decisions and why - Scalability considerations ## 6. Common Queries Show the SQL for the 5 most common queries this schema will serve. ## 7. Migration Notes If migrating from an existing schema, note the migration order and risks.
Related Prompts
MCP Server Integration Planner
Plan and design Model Context Protocol server integrations for AI applications
Agentic Code Architect
Design autonomous AI agent systems for complex tasks
Agentic Workflow Orchestrator
Design and coordinate multi-agent AI workflows that delegate tasks to specialized AI assistants
AI Agent System Behavior Tester
Generates a comprehensive test suite of adversarial, edge-case, and functional prompts to stress-test any AI agent or chatbot for reliability, safety, and performance.