
Sql Expert
This is a comprehensive SQL reference that covers database design patterns, query optimization, and cross-platform syntax for PostgreSQL, MySQL, and SQL Server. You get normalized schema examples, complex join patterns, window functions, subqueries, and indexing strategies all in one place. The skill includes actual DDL examples showing proper foreign key constraints, check constraints, and index placement. Most useful when you're architecting a new database schema or debugging slow queries, since it demonstrates both the right way to structure relationships and how to write efficient queries with CTEs and window functions. The examples are production-ready, not toy datasets, which makes it easy to adapt patterns to real applications.
- skills.sh installs
- 257
- GitHub stars
- 44
- last updated
- Aug 21, 2026
Install
$ npx -y skills add personamanagmentlayer/pcl --skill sql-expert --agent claude-codeInstalls into .claude/skills of the current project.
Files
SQL Expert
You are an expert in SQL databases with deep knowledge of database design, query optimization, indexing strategies, and administration. You write efficient, maintainable SQL queries and design robust database schemas.
Best Practices
1. Use Prepared Statements
-- Prevent SQL injection
-- Bad (vulnerable)
query = "SELECT * FROM users WHERE email = '" + userInput + "'";
-- Good (safe)
PREPARE stmt FROM 'SELECT * FROM users WHERE email = ?';
EXECUTE stmt USING @email;
2. Normalize Data Appropriately
1NF: Atomic values, no repeating groups
2NF: 1NF + no partial dependencies
3NF: 2NF + no transitive dependencies
Denormalize only for performance when needed
3. Use Foreign Keys
-- Enforce referential integrity
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
title VARCHAR(200) NOT NULL
);
4. Add Appropriate Indexes
-- Index foreign keys
CREATE INDEX idx_posts_user_id ON posts(user_id);
-- Index columns used in WHERE, JOIN, ORDER BY
CREATE INDEX idx_posts_created_at ON posts(created_at);
-- Don't over-index (slows writes)
Sponsors
Details
- Repository
- github.com/personamanagmentlayer/pcl
- Categories
- Backend & APIs, Design & UI/UX, Databases
- First seen
- Jun 3, 2026
More from personamanagmentlayer/pcl
All 99- Research Expert253
- Cpp Expert248
- Helm Expert245
- Ai Engineer Expert239
- Quantum Expert238
- Finops Expert236
- Iot Expert236
- Snowflake Expert236
- Biological Expert233
- Security Expert228
- Aws Expert226
- Aerospace Expert225
- Scala Expert224
- Standards Expert224
- Flask Expert223
- Csharp Expert219
- Maritime Expert219
- Kafka Expert218
- Fastapi Expert216
- Nodejs Expert214
- Databricks Expert212
- Kubernetes Expert212
- Spring Boot Expert209
- Devops Expert207