Skip to content
Back to skills

Minimal

ASecurity

Customer name changes → Just update ```sql UPDATE dim_customer SET name = 'John Smith' WHERE customer_id = 123; ``` Pros: Simple | Cons: Lose history

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 10, 2026
datasql

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add snoodleboot-io/prompticorn --skill minimal --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Minimal?

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

Security grade badge for Minimal
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snoodleboot-io-minimal-76917711/badge)](https://www.skillsdirectory.com/skills/snoodleboot-io-minimal-76917711)

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
# Slowly Changing Dimensions (Minimal)

## Types

### Type 1: Overwrite
Customer name changes → Just update
```sql
UPDATE dim_customer SET name = 'John Smith' 
WHERE customer_id = 123;
```
Pros: Simple | Cons: Lose history

### Type 2: Add New Row
Customer name changes → Add new record with effective dates
```sql
-- Old record: end_date = 2026-04-10
INSERT INTO dim_customer 
(customer_id, name, start_date, end_date)
VALUES (123, 'John Smith', '2026-04-11', NULL);
```
Pros: Keep history | Cons: More rows

### Type 3: Add Column
```sql
ALTER TABLE dim_customer ADD previous_name VARCHAR;
UPDATE dim_customer SET previous_name = name 
WHERE customer_id = 123;
UPDATE dim_customer SET name = 'John Smith' 
WHERE customer_id = 123;
```
Pros: Keep previous + current | Cons: Only 2 versions

## When to Use

**Type 1 (Overwrite):** Not important (email, phone)
**Type 2 (New Row):** Important for analytics (address, price)
**Type 3 (Column):** Need previous + current (status change)

## Implementation Pattern

```sql
SELECT fact_id, customer_id, amount
FROM fact_sales fs
JOIN dim_customer dc 
  ON fs.customer_id = dc.customer_id
  AND fs.date_id BETWEEN dc.start_date AND dc.end_date
```

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.