Templates/Finance

Insurance policies database schema

Policyholders, products, policies with coverages, premiums and claims.

6 tables, 6 relationships

Opens as a new diagram you can change. Free.

Tables

policyholders

  • iduuid not null
  • full_nametext not null
  • emailtext not null
  • date_of_birthdate not null
  • created_attimestamptz not null

insurance_products

  • iduuid not null
  • nametext not null
  • linetext not null
  • created_attimestamptz not null

policies

  • iduuid not null
  • policyholder_id> policyholdersuuid not null
  • product_id> insurance_productsuuid not null
  • numbertext not null
  • starts_ondate not null
  • ends_ondate not null
  • created_attimestamptz not null

coverages

  • iduuid not null
  • policy_id> policiesuuid not null
  • kindtext not null
  • limit_amountnumeric(14,2) not null
  • deductiblenumeric(14,2) not null
  • created_attimestamptz not null

premiums

  • iduuid not null
  • policy_id> policiesuuid not null
  • amountnumeric(10,2) not null
  • due_ondate not null
  • paid_ondate
  • created_attimestamptz not null

claims

  • iduuid not null
  • policy_id> policiesuuid not null
  • coverage_id> coveragesuuid
  • incident_ondate not null
  • amount_claimednumeric(14,2) not null
  • statustext not null
  • created_attimestamptz not null

As PostgreSQL

The same diagram exports to MySQL, MariaDB, SQLite, SQL Server and Oracle, and to Prisma, Drizzle, SQLAlchemy and Convex models.

CREATE TABLE "claims" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "policy_id" UUID NOT NULL,
  "coverage_id" UUID,
  "incident_on" DATE NOT NULL,
  "amount_claimed" NUMERIC(14,2) NOT NULL,
  "status" TEXT DEFAULT 'open' NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "coverages" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "policy_id" UUID NOT NULL,
  "kind" TEXT NOT NULL,
  "limit_amount" NUMERIC(14,2) NOT NULL,
  "deductible" NUMERIC(14,2) NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "insurance_products" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "name" TEXT NOT NULL,
  "line" TEXT NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "policies" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "policyholder_id" UUID NOT NULL,
  "product_id" UUID NOT NULL,
  "number" TEXT NOT NULL UNIQUE,
  "starts_on" DATE NOT NULL,
  "ends_on" DATE NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "policyholders" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "full_name" TEXT NOT NULL,
  "email" TEXT NOT NULL UNIQUE,
  "date_of_birth" DATE NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "premiums" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "policy_id" UUID NOT NULL,
  "amount" NUMERIC(10,2) NOT NULL,
  "due_on" DATE NOT NULL,
  "paid_on" DATE,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

ALTER TABLE "policies" ADD CONSTRAINT "fk_policies_policyholder_id" FOREIGN KEY ("policyholder_id") REFERENCES "policyholders" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "policies" ADD CONSTRAINT "fk_policies_product_id" FOREIGN KEY ("product_id") REFERENCES "insurance_products" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "coverages" ADD CONSTRAINT "fk_coverages_policy_id" FOREIGN KEY ("policy_id") REFERENCES "policies" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "premiums" ADD CONSTRAINT "fk_premiums_policy_id" FOREIGN KEY ("policy_id") REFERENCES "policies" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "claims" ADD CONSTRAINT "fk_claims_policy_id" FOREIGN KEY ("policy_id") REFERENCES "policies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "claims" ADD CONSTRAINT "fk_claims_coverage_id" FOREIGN KEY ("coverage_id") REFERENCES "coverages" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

More Finance templates

Start with one diagram, free

One diagram with two branches, no card needed. Upgrade when your team needs more.