Skip to content

Instantly share code, notes, and snippets.

View albertlieyingadrian's full-sized avatar
🤠

Albert Lie 이영덕 albertlieyingadrian

🤠
View GitHub Profile
@albertlieyingadrian
albertlieyingadrian / accounting.sql
Created July 19, 2019 06:35 — forked from 001101/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...