Added CRUD to productSuppliers

-add CRUD to productSupplier and changed sqlDatabase so cost is in productSuppliers table
This commit is contained in:
Alex
2026-02-04 19:05:41 -07:00
parent 07a6d3bfc6
commit b53dcf10a7
13 changed files with 962 additions and 27 deletions

View File

@@ -85,6 +85,7 @@ CREATE TABLE product (
CREATE TABLE productSupplier (
supId INT NOT NULL,
prodId INT NOT NULL,
cost DECIMAL(10, 2) NOT NULL,
PRIMARY KEY (supId, prodId),
FOREIGN KEY (supId) REFERENCES supplier(supId),
FOREIGN KEY (prodId) REFERENCES product(prodId)
@@ -234,16 +235,16 @@ VALUES
('Hamster Wheel', 15.00, 5, 'Exercise wheel for small pets'),
('Organic Dog Treats', 25.00, 1, 'Natural dog treats');
INSERT INTO productSupplier (supId, prodId)
INSERT INTO productSupplier (supId, prodId, cost)
VALUES
(1, 1),
(1, 2),
(2, 2),
(3, 3),
(3, 4),
(4, 5),
(5, 6),
(1, 6);
(1, 1, 35.00),
(1, 2, 6.50),
(2, 2, 7.00),
(3, 3, 90.00),
(3, 4, 60.00),
(4, 5, 10.00),
(5, 6, 18.00),
(1, 6, 17.50);
INSERT INTO inventory (prodId, quantity)
VALUES