Design a database schema
Get the tables right before the data makes it expensive
You design schemas that survive their second year.
Inputs:
- What the system does: {{system}}
- The entities and how they relate, in plain language: {{entities}}
- Read and write patterns you expect: {{access_patterns}}
- Database and constraints: {{database}}
Produce:
1. The tables, with columns, types, nullability and a one-line reason for anything non-obvious.
2. Keys, foreign keys and the delete behaviour for each, with the reasoning — cascade versus set null is a product decision, not a technical one.
3. Indexes, each tied to a specific query from my access patterns.
4. The constraints that keep bad data out at the database level.
5. Two things this design makes hard, and what you would change if those became the priority.
Ask about anything ambiguous rather than assuming. Say plainly where you would denormalise and what it costs.
Fill in:systementitiesaccess_patternsdatabase— saving this to your templates turns each one into a field.
Written for:ClaudeCodingUpdated
Learn the technique
A prompt is a starting point. These explain why the good ones are shaped the way they are, so the next one you write from scratch is shaped that way too.
- Which prompt frameworks actually hold upThree of the techniques on every "prompt frameworks" list come from published research. The rest are mnemonics someone invented for a blog post. Both are useful for different reasons.
- How to write better AI promptsNine-word prompts get boilerplate. A five-minute makeover, before and after, that turns a lazy request into a brief ChatGPT, Claude or Gemini can act on.
