Skip to content
Back to skills

Sql Database

ASecurity

```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); ``` | Query Pattern | Index Type | |--------------|-------------| | WHERE email = ? | Single column | | WHERE status = ? AND created > ? | Composite | | ORDER BY created_at DESC | B-tree (de

  • 21 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 7, 2026
databasessqldatabase

Security analysis

A100/100

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill sql-database --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sql Database?

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

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

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
# 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

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.

View all in databases →

Comments

Loading comments…

Newsletter

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