SkillData & analytics
Review a SQL query and its callers
Analyze query correctness, parameter handling, and result assumptions using the supplied schema.
✳Claude Code
MIT · FreeView skill
An MCP server that provides on-demand skill loading for AI coding assistants.
--- name: sql-database-mastery description: "An MCP server that provides on-demand skill loading for AI coding assistants." --- # SQL Database Mastery ## Schema Design ```sql -- Users table CREATE TABLE users ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), email VARCHAR(255) UNIQUE NOT NULL, name VARCHAR(255), created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW() ); -- Indexes CREATE INDEX idx_users_email ON users(email); ``` ## Index Strategy | Query Pattern | Index Type | |--------------|-------------| | WHERE email = ? | Single column | | WHERE status = ? AND created > ? | Composite | | ORDER BY created_at DESC | B-tree (default) | | Full text search | GIN | ## Migration Safety ```sql -- Always add columns as nullable first ALTER TABLE users ADD COLUMN phone VARCHAR(20); -- Backfill data UPDATE users SET phone = 'unknown' WHERE phone IS NULL; -- Make not nullable ALTER TABLE users ALTER COLUMN phone SET NOT NULL; ``` ## Checklist - [ ] Use UUID for primary keys - [ ] Add timestamps (created_at, updated_at) - [ ] Create indexes for query patterns - [ ] Write safe migrations (backfill, nullable first) - [ ] Use EXPLAIN ANALYZE - [ ] Set up connection pooling--- name: sql-database-mastery description: "An MCP server that provides on-demand skill loading for AI coding assistants." --- # SQL Database Mastery ## Schema Design ```sql -- Users table CREATE TABLE users ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), email VARCHAR(255) UNIQUE NOT NULL, name VARCHAR(255), created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW() ); -- Indexes CREATE INDEX idx_users_email ON users(email); ``` ## Index Strategy | Query Pattern | Index Type | |--------------|-------------| | WHERE email = ? | Single column | | WHERE status = ? AND created > ? | Composite | | ORDER BY created_at DESC | B-tree (default) | | Full text search | GIN | ## Migration Safety ```sql -- Always add columns as nullable first ALTER TABLE users ADD COLUMN phone VARCHAR(20); -- Backfill data UPDATE users SET phone = 'unknown' WHERE phone IS NULL; -- Make not nullable ALTER TABLE users ALTER COLUMN phone SET NOT NULL; ``` ## Checklist - [ ] Use UUID for primary keys - [ ] Add timestamps (created_at, updated_at) - [ ] Create indexes for query patterns - [ ] Write safe migrations (backfill, nullable first) - [ ] Use EXPLAIN ANALYZE - [ ] Set up connection pooling
Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.