database-schema

Design normalized database schemas with tables, indexes, constraints, and PostgreSQL DDL output.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill database-schema-kalilurrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema
Source: https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts/tree/main/01-software-dev/database-schema
Command: npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill database-schema-kalilurrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Translating business requirements into a well-structured database schema is error-prone: missing constraints, wrong data types, and absent indexes lead to data integrity issues and slow queries. This Skill turns data requirements into a complete, normalized schema with executable SQL DDL. ## Core Features & Use Cases - Entity and Relationship Modeling: Identifies entities, defines one-to-many and many-to-many relationships, and normalizes to 3NF with documented denormalization exceptions. - Complete DDL Generation: Produces PostgreSQL CREATE TABLE and CREATE INDEX statements with primary keys, foreign keys, CHECK constraints, and query-driven indexes. - Migration Planning: Documents zero-downtime migration patterns such as column type changes via backfill-and-rename and adding foreign keys to existing tables. - Use Case: Given requirements for an e-commerce platform, generate users, orders, products, and order_items tables with proper constraints, partial indexes for active records, and an ER relationship summary. ## Quick Start Ask the AI to design a database schema from your data requirements, listing the entities, their relationships, and expected query patterns.

Frequently Asked Questions about database-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a normalized database schema from requirements?

Identify core entities from the requirements, define one-to-many and many-to-many relationships, then normalize to 3NF to eliminate redundancy. Add primary keys, foreign keys, CHECK constraints, and indexes based on expected WHERE, JOIN, and ORDER BY clauses.

What data types should I use for money and timestamps in PostgreSQL?

Use DECIMAL for monetary values, never FLOAT or DOUBLE, since floating point causes rounding errors. Use TIMESTAMPTZ for timestamps so timezone information is preserved, and default them with NOW().

Should I use UUID or BIGSERIAL for primary keys?

Use UUID for user-facing IDs because they are non-sequential and harder to enumerate. Use BIGSERIAL for internal IDs when UUID storage and index overhead is too high for the table's scale.

How do I change a column type in PostgreSQL without downtime?

Add a new column with the target type, backfill data from the old column, switch the application to read the new column, then drop the old column and rename the new one. This dual-write pattern avoids locking the table.

When should I denormalize a database schema?

Denormalize only for read-heavy tables where join cost is proven to be a bottleneck, and always document the justification. The default target is 3NF; partitioning is preferred when scale, not joins, is the issue.