Skip to content
FunCoding

sql-best-practices

Use this skill when writing SQL queries — selects, joins, aggregations, window functions, or schema modifications. Apply whenever SQL is needed to ensure correctness, safety, and performance.

Star
3,473
Category
Data
License
MIT
Last commit
Jun 7, 2026

memory_data/skills/sql-best-practices/SKILL.md

View on GitHub

SQL Best Practices

Query quality:

  • Use SELECT col1, col2 — never SELECT * in production code.
  • Use CTEs (WITH) for readability instead of deeply nested subqueries.
  • Filter early: apply WHERE before JOIN when possible to reduce data scanned.
  • Use EXPLAIN / EXPLAIN ANALYZE to inspect query plans for slow queries.

Safety:

  • Always use parameterized queries from application code — never string interpolation.
  • Wrap destructive operations (DELETE, UPDATE, DROP) in a transaction.
  • Test on a staging/dev environment before running on production.

Naming: snake_case for tables/columns, descriptive names, consistent pluralization.

Similar Skills

Featured

agentic-os

Build persistent multi-agent systems without external databases, using file-based memory and scheduled tasks.

AFaffaan-m/ECC314k3,503 new stars in the last 7 days

health

GAgarrytan/gstack143k524 new stars in the last 7 days

deprecation-and-migration

ADaddyosmani/agent-skills122k1,421 new stars in the last 7 days

ccs-align

THthedotmack/claude-mem121k1,354 new stars in the last 7 days

handoff

THthedotmack/claude-mem121k1,354 new stars in the last 7 days

knowledge-agent

THthedotmack/claude-mem121k1,354 new stars in the last 7 days