{"chip_model": {"columns": [[0, "Model_name", "TEXT", 0, null, 1], [1, "Launch_year", "REAL", 0, null, 0], [2, "RAM_MiB", "REAL", 0, null, 0], [3, "ROM_MiB", "REAL", 0, null, 0], [4, "Slots", "TEXT", 0, null, 0], [5, "WiFi", "TEXT", 0, null, 0], [6, "Bluetooth", "TEXT", 0, null, 0]], "primary_keys": ["Model_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Model_name"]]], "check_constraints": []}, "screen_mode": {"columns": [[0, "Graphics_mode", "REAL", 0, null, 1], [1, "Char_cells", "TEXT", 0, null, 0], [2, "Pixels", "TEXT", 0, null, 0], [3, "Hardware_colours", "REAL", 0, null, 0], [4, "used_kb", "REAL", 0, null, 0], [5, "map", "TEXT", 0, null, 0], [6, "Type", "TEXT", 0, null, 0]], "primary_keys": ["Graphics_mode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Graphics_mode"]]], "check_constraints": []}, "phone": {"columns": [[0, "Company_name", "TEXT", 0, null, 0], [1, "Hardware_Model_name", "TEXT", 0, null, 1], [2, "Accreditation_type", "TEXT", 0, null, 0], [3, "Accreditation_level", "TEXT", 0, null, 0], [4, "Date", "TEXT", 0, null, 0], [5, "chip_model", "TEXT", 0, null, 0], [6, "screen_mode", "TEXT", 0, null, 0]], "primary_keys": ["Hardware_Model_name"], "foreign_keys": [[0, 0, "chip_model", "chip_model", "Model_name", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "screen_mode", "screen_mode", "Graphics_mode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Hardware_Model_name"]]], "check_constraints": []}}
CREATE TABLE chip_model (
    Model_name TEXT   PRIMARY KEY,
    Launch_year REAL,
    RAM_MiB REAL,
    ROM_MiB REAL,
    Slots TEXT,
    WiFi TEXT,
    Bluetooth TEXT,
    UNIQUE (Model_name)
);

CREATE TABLE screen_mode (
    Graphics_mode REAL   PRIMARY KEY,
    Char_cells TEXT,
    Pixels TEXT,
    Hardware_colours REAL,
    used_kb REAL,
    map TEXT,
    Type TEXT,
    UNIQUE (Graphics_mode)
);

CREATE TABLE phone (
    Company_name TEXT,
    Hardware_Model_name TEXT   PRIMARY KEY,
    Accreditation_type TEXT,
    Accreditation_level TEXT,
    Date TEXT,
    chip_model TEXT,
    screen_mode TEXT,
    UNIQUE (Hardware_Model_name),
    FOREIGN KEY (chip_model) REFERENCES chip_model(Model_name),
    FOREIGN KEY (screen_mode) REFERENCES screen_mode(Graphics_mode)
);