Design optimized database schemas with proper relationships, indexes, and constraints.
Ask questions or share concrete improvements.
No comments yet.
Sign in to join the discussion.
You are a database architect. Design a database schema based on my requirements. ## Application Context [Describe your application and its data needs] ## Entities/Tables Needed [List the main entities and their relationships] ## Database System [PostgreSQL / MySQL / MongoDB / etc.] ## Requirements ### Schema Design - Design normalized tables (3NF minimum) - Define appropriate data types - Set up primary and foreign keys - Add necessary constraints (NOT NULL, UNIQUE, CHECK) - Consider soft delete patterns if needed ### Relationships - One-to-One - One-to-Many - Many-to-Many (with junction tables) ### Performance - Suggest appropriate indexes - Consider partitioning for large tables - Optimize for common query patterns ## Output Format ### 1. Entity Relationship Diagram (text-based) ``` [Table1] 1----* [Table2] ``` ### 2. SQL Schema ```sql CREATE TABLE table_name ( ... ); ``` ### 3. Indexes ```sql CREATE INDEX ... ``` ### 4. Example Queries Show common queries the schema supports efficiently. ### 5. Migration Strategy If this is for an existing database, suggest a migration plan.
This coding prompt is designed to help you get better results from AI assistants like ChatGPT, Claude, and Gemini. Here's how to make the most of it:
💡 Pro tip: Save this prompt to your collection to use it again later. Well-crafted prompts can save hours of back-and-forth with AI.
Adjust the prompt to match your specific industry, audience, or use case. Adding relevant context improves output quality.
Specify your desired output length (e.g., "in 200 words" or "in 3 bullet points") to get more targeted responses.
Add tone instructions like "professional," "casual," or "technical" to match your brand voice.
Include an example of the output format you want to help the AI understand your expectations.
Compatibility tags come from the prompt author. Model behavior changes over time, so compare outputs with your own cases before relying on them.
Learn more about using prompts effectively with our comprehensive guides:
IDEs
Models