{"Attribute_Definitions": {"columns": [[0, "attribute_id", "INTEGER", 0, null, 1], [1, "attribute_name", "VARCHAR(30)", 0, null, 0], [2, "attribute_data_type", "VARCHAR(10)", 0, null, 0]], "primary_keys": ["attribute_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Catalogs": {"columns": [[0, "catalog_id", "INTEGER", 0, null, 1], [1, "catalog_name", "VARCHAR(50)", 0, null, 0], [2, "catalog_publisher", "VARCHAR(80)", 0, null, 0], [3, "date_of_publication", "DATETIME", 0, null, 0], [4, "date_of_latest_revision", "DATETIME", 0, null, 0]], "primary_keys": ["catalog_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Catalog_Structure": {"columns": [[0, "catalog_level_number", "INTEGER", 0, null, 1], [1, "catalog_id", "INTEGER", 1, null, 0], [2, "catalog_level_name", "VARCHAR(50)", 0, null, 0]], "primary_keys": ["catalog_level_number"], "foreign_keys": [[0, 0, "Catalogs", "catalog_id", "catalog_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Catalog_Contents": {"columns": [[0, "catalog_entry_id", "INTEGER", 0, null, 1], [1, "catalog_level_number", "INTEGER", 1, null, 0], [2, "parent_entry_id", "INTEGER", 0, null, 0], [3, "previous_entry_id", "INTEGER", 0, null, 0], [4, "next_entry_id", "INTEGER", 0, null, 0], [5, "catalog_entry_name", "VARCHAR(80)", 0, null, 0], [6, "product_stock_number", "VARCHAR(50)", 0, null, 0], [7, "price_in_dollars", "DOUBLE", 0, null, 0], [8, "price_in_euros", "DOUBLE", 0, null, 0], [9, "price_in_pounds", "DOUBLE", 0, null, 0], [10, "capacity", "VARCHAR(20)", 0, null, 0], [11, "length", "VARCHAR(20)", 0, null, 0], [12, "height", "VARCHAR(20)", 0, null, 0], [13, "width", "VARCHAR(20)", 0, null, 0]], "primary_keys": ["catalog_entry_id"], "foreign_keys": [[0, 0, "Catalog_Structure", "catalog_level_number", "catalog_level_number", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Catalog_Contents_Additional_Attributes": {"columns": [[0, "catalog_entry_id", "INTEGER", 1, null, 0], [1, "catalog_level_number", "INTEGER", 1, null, 0], [2, "attribute_id", "INTEGER", 1, null, 0], [3, "attribute_value", "VARCHAR(255)", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Catalog_Structure", "catalog_level_number", "catalog_level_number", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Catalog_Contents", "catalog_entry_id", "catalog_entry_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Attribute_Definitions (
    attribute_id INTEGER   PRIMARY KEY,
    attribute_name VARCHAR(30),
    attribute_data_type VARCHAR(10)
);

CREATE TABLE Catalogs (
    catalog_id INTEGER   PRIMARY KEY,
    catalog_name VARCHAR(50),
    catalog_publisher VARCHAR(80),
    date_of_publication DATETIME,
    date_of_latest_revision DATETIME
);

CREATE TABLE Catalog_Structure (
    catalog_level_number INTEGER   PRIMARY KEY,
    catalog_id INTEGER NOT NULL,
    catalog_level_name VARCHAR(50),
    FOREIGN KEY (catalog_id) REFERENCES Catalogs(catalog_id)
);

CREATE TABLE Catalog_Contents (
    catalog_entry_id INTEGER   PRIMARY KEY,
    catalog_level_number INTEGER NOT NULL,
    parent_entry_id INTEGER,
    previous_entry_id INTEGER,
    next_entry_id INTEGER,
    catalog_entry_name VARCHAR(80),
    product_stock_number VARCHAR(50),
    price_in_dollars DOUBLE,
    price_in_euros DOUBLE,
    price_in_pounds DOUBLE,
    capacity VARCHAR(20),
    length VARCHAR(20),
    height VARCHAR(20),
    width VARCHAR(20),
    FOREIGN KEY (catalog_level_number) REFERENCES Catalog_Structure(catalog_level_number)
);

CREATE TABLE Catalog_Contents_Additional_Attributes (
    catalog_entry_id INTEGER NOT NULL,
    catalog_level_number INTEGER NOT NULL,
    attribute_id INTEGER NOT NULL,
    attribute_value VARCHAR(255) NOT NULL,
    FOREIGN KEY (catalog_level_number) REFERENCES Catalog_Structure(catalog_level_number),
    FOREIGN KEY (catalog_entry_id) REFERENCES Catalog_Contents(catalog_entry_id)
);