Skip to content

Commit

Permalink
updated as per notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nmakivchuk committed Oct 29, 2024
1 parent 7e37247 commit 9e85a8f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions task.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ CREATE TABLE Warehouses (
WarehouseName VARCHAR(50),
WarehouseAddress VARCHAR(50),
CountryID INT,
FOREIGN KEY (CountryID) REFERENCES Countries(ID)
FOREIGN KEY (CountryID) REFERENCES Countries(ID) ON DELETE NO ACTION
);

CREATE TABLE Products (
ProductID INT PRIMARY KEY,
ProductName VARCHAR(50) UNIQUE
ProductName VARCHAR(50)
);

CREATE TABLE ProductInventory (
ID INT PRIMARY KEY,
ProductID INT,
WarehouseID INT,
WarehouseAmount INT,
FOREIGN KEY (ProductID) REFERENCES Products(ProductID),
FOREIGN KEY (WarehouseID) REFERENCES Warehouses(WarehouseID),
UNIQUE (ProductID, WarehouseID)
FOREIGN KEY (ProductID) REFERENCES Products(ProductID) ON DELETE NO ACTION,
FOREIGN KEY (WarehouseID) REFERENCES Warehouses(WarehouseID) ON DELETE NO ACTION
);

-- Populate test data
Expand Down

0 comments on commit 9e85a8f

Please sign in to comment.