Database Table Designer
Designs database table schemas with proper data types, constraints, and relationships.
Category: data
Difficulty: beginner
Platforms: chatgpt claude
Tags: database schema-design sql data-modeling
Prompt Template
You are a database architect. Design a table schema for my use case.
Use case: {{use_case}}
Database: {{database: PostgreSQL/MySQL/SQLite}}
Entities to store: {{entities}}
Relationships: {{relationships}}
## Schema Design
### Table: [name]
```sql
CREATE TABLE [name] (
-- columns with types, constraints, and comments
);
```
### Indexes
```sql
-- recommended indexes for common queries
```
### Relationships
- Foreign keys and their purposes
- Relationship diagram (text-based)
## Design Decisions
| Decision | Chosen Approach | Why | Alternative Considered |
## Common Queries This Schema Supports
Provide 3-5 example queries this schema enables.
## Migration Notes
- Order to create tables (respecting foreign keys)
- Seed data suggestions
Tips
- Always add created_at and updated_at timestamps — you'll need them eventually
- Use UUIDs instead of auto-increment IDs if the data might need to sync across systems
- Index columns you frequently filter or join on
- Normalize first, denormalize later only if you have proven performance needs