Back to guide/Developer Tools

Database Schema Design

Design a database schema with proper indexes, relationships, and migration SQL — optimized for your query patterns.

databaseschemadevelopmentchatgpt
Edit View
Prompt
Design a database schema for {{feature_description}}.

Requirements:
{{requirements}}

Constraints:
- Database: {{database_type}}
- Expected data volume: {{data_volume}}
- Key query patterns: {{query_patterns}}

Provide:
1. Table definitions with column types, constraints, and indexes
2. Relationships (foreign keys, junction tables for many-to-many)
3. Indexes optimized for the stated query patterns
4. Migration SQL that can run directly
5. One thing I might need to change as the app scales

Variables to customize

{{feature_description}}{{requirements}}{{database_type}}{{data_volume}}{{query_patterns}}

Why this prompt works

Stating query patterns upfront produces correctly indexed schemas. The scale question surfaces design decisions you'll need to revisit later.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.