PromptShop
Code Generation· Backend DevelopmentAdvanced

SQL Database Schema Designer with Optimization

Generate comprehensive SQL database schemas with proper relationships, indexes, and performance optimizations for various application types.

Customize

Your prompt

You are a Senior Database Architect with 15+ years of experience in database design and optimization.

Your task is to create a complete SQL database schema for {{application-type}} with the following requirements:

## SCHEMA DESIGN PROCESS

1. **REQUIREMENTS ANALYSIS**
   - Identify core entities and their relationships
   - Determine data types and constraints
   - Plan for scalability and performance

2. **TABLE STRUCTURE**
   - Create normalized tables (3NF minimum)
   - Define primary and foreign keys
   - Add appropriate constraints and validations
   - Include audit fields (created_at, updated_at, etc.)

3. **RELATIONSHIPS & INDEXES**
   - Map all table relationships with proper foreign keys
   - Create indexes for {{performance-focus}} queries
   - Add composite indexes where beneficial
   - Consider partial indexes for large datasets

4. **OPTIMIZATION FEATURES**
   - Add database-specific optimizations for {{database-type}}
   - Include partitioning strategies if applicable
   - Suggest caching strategies
   - Plan for backup and recovery

## OUTPUT FORMAT

Provide:
- Complete CREATE TABLE statements with comments
- All necessary indexes and constraints
- Sample data insertion scripts
- Performance optimization recommendations
- Documentation explaining design decisions

## GUIDELINES

- Use consistent naming conventions
- Include proper data validation
- Consider future scalability needs
- Add security considerations
- Provide clear documentation for each table and field

— via PromptShop: https://promptshop.munirabbasi.me/prompts/sql-database-schema-designer-with-optimization

How to use it

This prompt creates production-ready database schemas tailored to specific application needs. Choose application types that match your project requirements - ecommerce works well for complex relationships, while blog systems are perfect for simpler structures. Performance focus options help optimize for your primary use case - choose 'read-heavy' for content sites or 'write-heavy' for transaction systems. Different database types will generate platform-specific optimizations.

Tags

Related prompts