Skip to content
Back to skills

Sql Kprsnt2

ASecurity

SQL and database best practices including query optimization, indexing, and schema design.

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
databasessqldatabaseperformance

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill sql-kprsnt2 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sql Kprsnt2?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sql Kprsnt2
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-sql-kprsnt2/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-sql-kprsnt2)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sql
description: SQL and database best practices including query optimization, indexing, and schema design.
globs: ["**/*.sql", "**/migrations/**", "**/prisma/**", "**/drizzle/**"]
priority: 80
tags: ["database"]
---

# SQL Best Practices

## Query Writing
- Use parameterized queries (prevent SQL injection)
- Select only needed columns (avoid SELECT *)
- Use appropriate JOINs
- Add WHERE clauses to limit results
- Use EXPLAIN to analyze queries

## Indexing
- Index columns used in WHERE/JOIN/ORDER BY
- Use composite indexes for multi-column queries
- Don't over-index (slows writes)
- Consider covering indexes
- Monitor index usage

## Schema Design
- Use appropriate data types
- Add constraints (NOT NULL, UNIQUE, FK)
- Normalize to 3NF, denormalize for performance
- Use UUIDs for distributed systems
- Add created_at/updated_at columns

## Transactions
- Keep transactions short
- Use appropriate isolation levels
- Handle deadlocks gracefully
- Use optimistic locking when appropriate

## Migrations
- Make migrations reversible
- Test migrations on copy of prod data
- Use small, focused migrations
- Never modify existing migrations
- Back up before migrating

## Performance
- Use connection pooling
- Implement pagination
- Cache frequent queries
- Use read replicas
- Monitor slow queries

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.