Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jamestorrevillas/database-design
Use this skill when designing database schemas, choosing between SQL and NoSQL, optimizing queries, designing indexes, modeling relationships, working with vector databases, or planning data migrations. Trigger on keywords: database, schema, SQL, NoSQL, index, query optimization, data model, migration, ORM, PostgreSQL, MongoDB, Redis, vector database, N+1.
Passed 18 of 22 test cases with the skill, and 17 of 22 without it.
1 fixed17 passed either way4 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Write a PostgreSQL query using standard window functions like DENSE_RANK() and PARTITION BY to calculate monthly sales rankings per region.
| Checked | Without skill | With skill |
|---|---|---|
| The response outputs standard SQL analytical window function queries calculating dense ranks partitioned by region. | Missed | Passed |
The instructions your model reads when the skill loads.
user_id not uid, created_at not tscreated_at, updated_atdeleted_at instead of hard deleting rows you might need to recover| Relationship | Implementation |
|---|---|
| One-to-One | Foreign key on either table + UNIQUE constraint |
| One-to-Many | Foreign key on the "many" side |
| Many-to-Many | Junction/pivot table with two foreign keys |
Rule: Index columns you filter, sort, or join on frequently.
-- Index for common query patterns
CREATE INDEX idx_orders_user_status ON orders(user_id, status);
CREATE INDEX idx_posts_created ON posts(created_at DESC);
-- Partial index for active records only
CREATE INDEX idx_active_users ON users(email) WHERE deleted_at IS NULL;
test cases passed, vs 17 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.