PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #schema-design tag
Design efficient database schemas. Normalization forms: 1. 1NF (atomic values, no repeating groups). 2. 2NF (no partial dependencies). 3. 3NF (no transitive dependencies). Balance normalization with performance (denormalize for read-heavy). Design principles: Use surrogate keys (auto-increment IDs). Foreign keys for relationships. Indexes on frequently queried columns. Avoid NULL when possible. Use appropriate data types. Naming conventions (plural table names, singular columns). Document relationships (ERD diagrams). Consider ACID properties. Use constraints (UNIQUE, NOT NULL, CHECK). Plan for scalability (partitioning, sharding).
Design scalable GraphQL schemas. Patterns: 1. Types for domain models. 2. Queries for reads, mutations for writes. 3. Input types for complex arguments. 4. Interfaces and unions for polymorphism. 5. Connection pattern for pagination. 6. DataLoader for N+1 prevention. 7. Directive for custom logic. 8. Federation for microservices. Use schema-first approach. Implement authorization at field level.
Generate a SQL schema for a simple e-commerce website. It should include tables for Products, Customers, Orders, and Order_Items. Define the columns for each table, specify data types, and set up primary and foreign key relationships.