Back to Prompt Library
Coding
DatabaseSQLArchitectureCoding

Database Schema Designer

Produces a complete, normalized database schema with SQL and relationship explanations.

Prompt Template

Design a relational database schema for [APPLICATION TYPE — e.g. e-commerce platform, SaaS app, social network]. Core features: [LIST 3–5 MAIN FEATURES]. Database: [PostgreSQL/MySQL/SQLite]. For each table, provide: (1) table name and purpose, (2) all columns with data type, constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT), and a brief description, (3) foreign key relationships and the relationship type (one-to-one, one-to-many, many-to-many). After the schema, provide: the CREATE TABLE SQL statements in order of dependency, 2–3 example indexes to add for query performance, and one data integrity challenge to watch out for in this design.

How to use this prompt

  1. Copy the prompt template using the button above.
  2. Paste it into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.).
  3. Replace all bracketed placeholders like [TOPIC] with your specific details.
  4. Send the prompt and refine the output as needed.
Advertisement