Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
-- 1. Insert Employee (using your Student ID) INSERT INTO Employee (EmployeeID, Name, Contact, Role) VALUES ('VSS39136', 'Alice Morgan', 'alice.morgan@holmeswinery.com', 'Winemaker'); -- 2. Insert Vineyard INSERT INTO Vineyard (Name, Location) VALUES ('Moonlight Estate', 'VIC'); -- 3. Insert Varietals INSERT INTO Varietal (Name) VALUES ('Shiraz'), ('Chardonnay'); -- 4. Insert VineyardVarietal (linking vineyard to both varietals) INSERT INTO VineyardVarietal (VineyardID, VarietalID, PlantingYear, Acreage) VALUES (1, 1, 2015, 20.5), (1, 2, 2016, 15.0); -- 5. Link Employee to Vineyard INSERT INTO VineyardEmployee (VineyardID, EmployeeID) VALUES (1, 'VSS39136'); -- 6. Insert Grapevine rows INSERT INTO Grapevine (VarietalID, VineyardID, PlantingDate, HealthStatus) VALUES (1, 1, '2015-06-15', 'Strong'), (2, 1, '2016-07-10', 'Adequate'); -- 7. Insert Harvest INSERT INTO Harvest (VineyardID, HarvestDate, Year) VALUES (1, '2024-03-20', 2024); -- 8. Insert HarvestDetail (yields from both varietals) INSERT INTO HarvestDetail (HarvestID, VarietalID, YieldWeight, SugarLevel, Acidity) VALUES (1, 1, 3200.50, 24.5, 3.2), (1, 2, 2700.75, 22.1, 3.5); -- 9. Insert Wine INSERT INTO Wine (Name, VintageYear, Description, WineType, AlcoholContent) VALUES ('Estate Shiraz Blend', 2024, 'A blend of bold Shiraz and crisp Chardonnay', 'Red', 'High'); -- 10. Link Wine to Varietals INSERT INTO WineVarietal (WineID, VarietalID) VALUES (1, 1), (1, 2); -- 11. Insert Batch INSERT INTO Batch (WineID, ProductionDate, Quantity) VALUES (1, '2024-04-15', 3000); -- 12. Insert Customer INSERT INTO Customer (Name, Address, Email, Phone) VALUES ('Liam Smith', '123 Grape Lane, VIC', 'liam.smith@mail.com', '0412345678'); -- 13. Insert SalesOrder (assigned to employee VSS39136) INSERT INTO SalesOrder (CustomerID, EmployeeID, OrderDate, TotalPrice, ShippingDetails) VALUES (1, 'VSS39136', '2025-04-05', 4500.00, 'Express delivery'); -- 14. Insert SalesOrderDetail INSERT INTO SalesOrderDetail (OrderID, BatchID, Quantity) VALUES (1, 1, 60);

Stuck with a problem? Got Error? Ask AI support!

Copy Clear