Scripts
Scripts
-- WarehouseStock Table: Tracks stock levels in each warehouse for each product
CREATE TABLE WarehouseStock (
WarehouseStockID INT AUTO_INCREMENT PRIMARY KEY,
WarehouseID INT,
ProductID INT,
StockLevel INT DEFAULT 0,
LastUpdated DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (WarehouseID) REFERENCES Warehouses(WarehouseID),
FOREIGN KEY (ProductID) REFERENCES Products(ProductID)
);
USE northwind;
-- Reset counter
SET i = 1;
-- Reset counter
SET i = 1;
-- Reset counter
SET i = 1;
-- Reset counter
SET i = 1;
-- Reset counter
SET i = 1;
-- Reset counter
SET i = 1;
DELIMITER ;
[
{ "tableName": "Categories", "count": 7 },
{ "tableName": "Suppliers", "count": 3 },
{ "tableName": "Products", "count": 7 },
{ "tableName": "Warehouses", "count": 3 },
{ "tableName": "WarehouseStock", "count": 4 },
{ "tableName": "InventoryTransactions", "count": 3000000 },
{ "tableName": "Promotions", "count": 2 },
{ "tableName": "Customers", "count": 1000000 },
{ "tableName": "Employees", "count": 3 },
{ "tableName": "Regions", "count": 4 },
{ "tableName": "Territories", "count": 4 },
{ "tableName": "Shippers", "count": 3 },
{ "tableName": "Orders", "count": 5000000 },
{ "tableName": "OrderDetails", "count": 15000000 },
{ "tableName": "CustomerFeedback", "count": 2000000 },
{ "tableName": "Returns", "count": 500000 },
{ "tableName": "Payments", "count": 5000000 }
],
"totalRecords": 31500030