{"buildings": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "City", "TEXT", 0, null, 0], [3, "Height", "INT", 0, null, 0], [4, "Stories", "INT", 0, null, 0], [5, "Status", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "Companies": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Headquarters", "TEXT", 0, null, 0], [3, "Industry", "TEXT", 0, null, 0], [4, "Sales_billion", "REAL", 0, null, 0], [5, "Profits_billion", "REAL", 0, null, 0], [6, "Assets_billion", "REAL", 0, null, 0], [7, "Market_Value_billion", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "Office_locations": {"columns": [[0, "building_id", "INT", 0, null, 1], [1, "company_id", "INT", 0, null, 2], [2, "move_in_year", "INT", 0, null, 0]], "primary_keys": ["building_id", "company_id"], "foreign_keys": [[0, 0, "Companies", "company_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "buildings", "building_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "building_id"], [1, 1, "company_id"]]], "check_constraints": []}}
CREATE TABLE buildings (
    id INT   PRIMARY KEY,
    name TEXT,
    City TEXT,
    Height INT,
    Stories INT,
    Status TEXT,
    UNIQUE (id)
);

CREATE TABLE Companies (
    id INT   PRIMARY KEY,
    name TEXT,
    Headquarters TEXT,
    Industry TEXT,
    Sales_billion REAL,
    Profits_billion REAL,
    Assets_billion REAL,
    Market_Value_billion TEXT,
    UNIQUE (id)
);

CREATE TABLE Office_locations (
    building_id INT   PRIMARY KEY,
    company_id INT   PRIMARY KEY,
    move_in_year INT,
    PRIMARY KEY (building_id, company_id),
    UNIQUE (building_id, company_id),
    FOREIGN KEY (company_id) REFERENCES Companies(id),
    FOREIGN KEY (building_id) REFERENCES buildings(id)
);