Hello guys I wonder how I could calculate the average usage time of a product by model andmanufacturer for this product. If anyone can help me I will be grateful.
considering this table:
CREATE TABLE product(
id_product VARCHAR(100) UNIQUE,
id_type_product INTEGER NOT NULL,
id_model_product INTEGER NOT NULL,
manufacturer VARCHAR(50),
stock BOOLEAN DEFAULT TRUE,
CONSTRAINT PK_EPI PRIMARY KEY (id_product, id_type_product,id_model_product), CONSTRAINT FK_EPI_TYPEPRODUCT FOREIGN KEY (id_product) REFERENCES type_product (id_product) ON DELETE CASCADE
CONSTRAINT FK_EPI_MODELOEPI FOREIGN KEY (id_model_product) REFERENCES model_product (id_model_product) ON DELETE CASCADE
),