{"repair": {"columns": [[0, "repair_ID", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Launch_Date", "TEXT", 0, null, 0], [3, "Notes", "TEXT", 0, null, 0]], "primary_keys": ["repair_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "repair_ID"]]], "check_constraints": []}, "machine": {"columns": [[0, "Machine_ID", "INT", 0, null, 1], [1, "Making_Year", "INT", 0, null, 0], [2, "Class", "TEXT", 0, null, 0], [3, "Team", "TEXT", 0, null, 0], [4, "Machine_series", "TEXT", 0, null, 0], [5, "value_points", "REAL", 0, null, 0], [6, "quality_rank", "INT", 0, null, 0]], "primary_keys": ["Machine_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Machine_ID"]]], "check_constraints": []}, "technician": {"columns": [[0, "technician_id", "REAL", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Team", "TEXT", 0, null, 0], [3, "Starting_Year", "REAL", 0, null, 0], [4, "Age", "INT", 0, null, 0]], "primary_keys": ["technician_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "technician_id"]]], "check_constraints": []}, "repair_assignment": {"columns": [[0, "technician_id", "INT", 0, null, 1], [1, "repair_ID", "INT", 0, null, 2], [2, "Machine_ID", "INT", 0, null, 3]], "primary_keys": ["technician_id", "repair_ID", "Machine_ID"], "foreign_keys": [[0, 0, "machine", "Machine_ID", "Machine_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "repair", "repair_ID", "repair_ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "technician", "technician_id", "technician_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "technician_id"], [1, 1, "repair_ID"], [2, 2, "Machine_ID"]]], "check_constraints": []}}
CREATE TABLE repair (
    repair_ID INT   PRIMARY KEY,
    name TEXT,
    Launch_Date TEXT,
    Notes TEXT,
    UNIQUE (repair_ID)
);

CREATE TABLE machine (
    Machine_ID INT   PRIMARY KEY,
    Making_Year INT,
    Class TEXT,
    Team TEXT,
    Machine_series TEXT,
    value_points REAL,
    quality_rank INT,
    UNIQUE (Machine_ID)
);

CREATE TABLE technician (
    technician_id REAL   PRIMARY KEY,
    Name TEXT,
    Team TEXT,
    Starting_Year REAL,
    Age INT,
    UNIQUE (technician_id)
);

CREATE TABLE repair_assignment (
    technician_id INT   PRIMARY KEY,
    repair_ID INT   PRIMARY KEY,
    Machine_ID INT   PRIMARY KEY,
    PRIMARY KEY (technician_id, repair_ID, Machine_ID),
    UNIQUE (technician_id, repair_ID, Machine_ID),
    FOREIGN KEY (Machine_ID) REFERENCES machine(Machine_ID),
    FOREIGN KEY (repair_ID) REFERENCES repair(repair_ID),
    FOREIGN KEY (technician_id) REFERENCES technician(technician_id)
);