-- Schema: spider__county_public_safety
CREATE SCHEMA IF NOT EXISTS "spider__county_public_safety";

-- Table: city
CREATE TABLE "spider__county_public_safety"."city" (
    "City_ID" BIGINT NOT NULL,
    "County_ID" BIGINT,
    "Name" TEXT,
    "White" DOUBLE PRECISION,
    "Black" DOUBLE PRECISION,
    "Amerindian" DOUBLE PRECISION,
    "Asian" DOUBLE PRECISION,
    "Multiracial" DOUBLE PRECISION,
    "Hispanic" DOUBLE PRECISION,
    CONSTRAINT "city_pkey" PRIMARY KEY ("City_ID")
);

-- Table: county_public_safety
CREATE TABLE "spider__county_public_safety"."county_public_safety" (
    "County_ID" BIGINT NOT NULL,
    "Name" TEXT,
    "Population" BIGINT,
    "Police_officers" BIGINT,
    "Residents_per_officer" BIGINT,
    "Case_burden" BIGINT,
    "Crime_rate" DOUBLE PRECISION,
    "Police_force" TEXT,
    "Location" TEXT,
    CONSTRAINT "county_public_safety_pkey" PRIMARY KEY ("County_ID")
);

-- Foreign Keys
ALTER TABLE "spider__county_public_safety"."city" ADD CONSTRAINT "fk_city_0" FOREIGN KEY ("County_ID") REFERENCES "spider__county_public_safety"."county_public_safety" ("County_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
