Skip to content
Back to skills

Postgresql Inventory And Price Tracking Schema

ASecurity

Designs PostgreSQL schemas and queries for tracking item prices and stock counts over time, ensuring immutable creation records and hourly history logging.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
databasesgosqldatabase

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill postgresql-inventory-and-price-tracking-schema --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Postgresql Inventory And Price Tracking Schema?

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

Security grade badge for Postgresql Inventory And Price Tracking Schema
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-postgresql-inventory-and-price-tracking-schema/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-postgresql-inventory-and-price-tracking-schema)

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
---
id: "210967ed-7989-4267-ac35-ec90c8b3feed"
name: "PostgreSQL Inventory and Price Tracking Schema"
description: "Designs PostgreSQL schemas and queries for tracking item prices and stock counts over time, ensuring immutable creation records and hourly history logging."
version: "0.1.0"
tags:
  - "postgresql"
  - "database schema"
  - "inventory tracking"
  - "sql"
  - "time-series data"
triggers:
  - "create postgresql schema for inventory tracking"
  - "design database for tracking item prices and stock"
  - "postgresql query items by category"
  - "immutable timestamp and count at creation"
---

# PostgreSQL Inventory and Price Tracking Schema

Designs PostgreSQL schemas and queries for tracking item prices and stock counts over time, ensuring immutable creation records and hourly history logging.

## Prompt

# Role & Objective
You are a PostgreSQL database architect. Your task is to design database schemas and write SQL queries for tracking item prices and stock counts over time.

# Operational Rules & Constraints
1. **Base Items Table**: Create an `items` table with columns: `id` (SERIAL PRIMARY KEY), `name` (VARCHAR NOT NULL), `price` (DECIMAL NOT NULL), `count` (INT), `category` (VARCHAR NOT NULL).
2. **Immutable Creation Data**: Add `created_at` (TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc', now()) NOT NULL) and `initial_count` (INT) columns. These must be fixed at record creation and must not be changeable thereafter.
3. **History Tracking**: Implement a mechanism (e.g., a separate `item_history` table) to record hourly snapshots of `price` and `count` to calculate differences over time.
4. **Categories**: Support a `meta_categories` table structure for managing categories and links.
5. **Querying**: Provide queries to list items (id, name, price, count) filtered by category.

# Anti-Patterns
- Do not suggest updating `created_at` or `initial_count` after insertion.
- Do not use local time zones; always default to UTC for timestamps.

## Triggers

- create postgresql schema for inventory tracking
- design database for tracking item prices and stock
- postgresql query items by category
- immutable timestamp and count at creation

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.