Design a Database Schema for a New Feature

8 Views
0 Uses

Prompt

ChatGPT
Claude
Grok
OpenRouter
Act as a senior engineer designing a relational schema. Design the tables for this feature, and show me the decisions you're making so I can challenge them.

Database: {{DIALECT}}
Feature and the main things users do with it: {{FEATURE}}
Existing related tables: {{EXISTING_SCHEMA}}
Expected volumes and the most frequent queries: {{ACCESS_PATTERNS}}

Produce:
1. Entities and relationships in plain English, including cardinality (one-to-many, many-to-many).
2. CREATE TABLE statements with types, primary keys, foreign keys with ON DELETE behavior, NOT NULL and CHECK constraints, unique constraints, and defaults.
3. Indexes driven by the access patterns, with the query each one serves.
4. The decisions, each with the alternative and why you chose this: surrogate versus natural keys, soft versus hard delete, how money and time are stored (integer minor units or decimal; UTC timestamps), enums versus lookup tables, JSON columns versus normalized tables.
5. Data integrity risks the schema can't prevent on its own, and where the application must enforce them.
6. Three sample queries for the main access patterns.

Keep it as simple as the feature allows. If my access patterns are unclear, list the questions that would change the design.

Customize this prompt

Fill in the variables below to personalize this prompt:

ChatGPT
Claude
Grok
OpenRouter

Model Settings

Recommended Models

ChatGPT Claude Gemini

Temperature

0.7

Max Tokens

2000

Additional Notes

Best for: Getting a schema right before data makes it hard to change

About this prompt

“Design a Database Schema for a New Feature” is a free prompt for ChatGPT in the Coding & Software category, 190 words long, added to The Prompt Index on October 28, 2026 by The Prompt Index. Copy it with the button above, paste it into ChatGPT or any other AI chat assistant, and send it.

It has 4 placeholders to fill in first: {{DIALECT}}, {{FEATURE}}, {{EXISTING_SCHEMA}}, {{ACCESS_PATTERNS}}. Use the “Customize this prompt” fields to personalise it before you copy.

Recommended models: ChatGPT, Claude, Gemini.

0 upvotes, sent to an AI tool 0 times, viewed 8 times.

Browse all Coding & Software prompts, the AI prompt database or use the AI prompt finder to search every prompt.