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
CREATE TABLE ShipmentRecords ( ShipmentID VARCHAR(10) PRIMARY KEY, ImporterName VARCHAR(100), OriginCountry VARCHAR(50), DateArrived DATE, Value DECIMAL(10, 2), Status VARCHAR(30) ); INSERT INTO ShipmentRecords (ShipmentID, ImporterName, OriginCountry, DateArrived, Value, Status) VALUES ('S001', 'Global Imports', 'China', '2025-04-02', 25000.00, 'Pending'), ('S002', 'Ocean Trade Co.', 'Japan', '2025-04-05', 15000.00, 'Cleared'), ('S003', 'Manila Exports', 'USA', '2025-04-10', 20000.00, 'Pending'), ('S004', 'TradeLink Corp', 'South Korea', '2025-04-12', 30000.00, 'Held for Review'), ('S005', 'EastPoint Ltd.', 'Vietnam', '2025-04-15', 18000.00, 'Cleared'); SELECT Format([DateArrived], "yyyy-mm") AS [Month], Count(*) AS TotalShipments, Sum([Value]) AS TotalValue FROM ShipmentRecords GROUP BY Format([DateArrived], "yyyy-mm") ORDER BY Format([DateArrived], "yyyy-mm");

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

Copy Clear