-- DBMS: snowflake
create or replace TABLE SALES_INVOICES (
	"InvoiceID" NUMBER(38,0),
	"CustomerID" NUMBER(38,0),
	"BillToCustomerID" NUMBER(38,0),
	"OrderID" NUMBER(38,0),
	"DeliveryMethodID" NUMBER(38,0),
	"ContactPersonID" NUMBER(38,0),
	"AccountsPersonID" NUMBER(38,0),
	"SalespersonPersonID" NUMBER(38,0),
	"PackedByPersonID" NUMBER(38,0),
	"InvoiceDate" VARCHAR(16777216),
	"CustomerPurchaseOrderNumber" NUMBER(38,0),
	"IsCreditNote" NUMBER(38,0),
	"CreditNoteReason" FLOAT,
	"Comments" FLOAT,
	"DeliveryInstructions" VARCHAR(16777216),
	"InternalComments" FLOAT,
	"TotalDryItems" NUMBER(38,0),
	"TotalChillerItems" NUMBER(38,0),
	"DeliveryRun" FLOAT,
	"RunPosition" FLOAT,
	"ReturnedDeliveryData" VARCHAR(16777216),
	"ConfirmedDeliveryTime" VARCHAR(16777216),
	"ConfirmedReceivedBy" VARCHAR(16777216),
	"LastEditedBy" NUMBER(38,0),
	"LastEditedWhen" VARCHAR(16777216)
);

INSERT INTO "WIDE_WORLD_IMPORTERS"."WIDE_WORLD_IMPORTERS"."SALES_INVOICES" (RunPosition, DeliveryInstructions, LastEditedWhen, ConfirmedReceivedBy, ContactPersonID, IsCreditNote, TotalChillerItems, SalespersonPersonID, DeliveryRun, DeliveryMethodID, InternalComments, BillToCustomerID, CustomerID, Comments, PackedByPersonID, TotalDryItems, AccountsPersonID, InvoiceDate, CreditNoteReason, ReturnedDeliveryData, InvoiceID, OrderID, LastEditedBy, ConfirmedDeliveryTime, CustomerPurchaseOrderNumber) VALUES (NULL, 'Unit 20, 231 Kaulina Street', '2016-02-12 07:00:00.0000000', 'Anda Liepa', 2227, 0, 1, 7, NULL, 3, NULL, 401, 514, NULL, 18, 0, 2001, '2016-02-11', NULL, '{"Events": [{ "Event":"Ready for collection","EventTime":"2016-02-11T12:00:00","ConNote":"EAN-125-64742"},{ "Event":"DeliveryAttempt","EventTime":"2016-02-12T07:40:00","ConNote":"EAN-125-64742","DriverID":11,"Latitude":43.5475771,"Longitude":-71.4067385,"Status":"Delivered"}],"DeliveredWhen":"2016-02-12T07:40:00","ReceivedBy":"Anda Liepa"}', 63692, 66440, 11, '2016-02-12 07:40:00.0000000', 15472), (NULL, 'Unit 115, 232 Abbasi Avenue', '2016-01-08 07:00:00.0000000', 'Nils Kalnins', 1075, 0, 1, 8, NULL, 3, NULL, 1, 38, NULL, 15, 0, 1001, '2016-01-07', NULL, '{"Events": [{ "Event":"Ready for collection","EventTime":"2016-01-07T12:00:00","ConNote":"EAN-125-62774"},{ "Event":"DeliveryAttempt","EventTime":"2016-01-08T07:25:00","ConNote":"EAN-125-62774","DriverID":19,"Latitude":37.1425588,"Longitude":-94.5107824,"Comment":"Receiver not present"}],"DeliveredWhen":"2016-01-08T07:25:00","ReceivedBy":"Nils Kalnins"}', 61724, 64377, 19, '2016-01-08 07:25:00.0000000', 16661), (NULL, 'Suite 56, 1750 Lampsa Road', '2016-01-08 07:00:00.0000000', 'Parsa Reuser', 2005, 0, 1, 6, NULL, 3, NULL, 401, 403, NULL, 15, 0, 2001, '2016-01-07', NULL, '{"Events": [{ "Event":"Ready for collection","EventTime":"2016-01-07T12:00:00","ConNote":"EAN-125-62773"},{ "Event":"DeliveryAttempt","EventTime":"2016-01-08T07:20:00","ConNote":"EAN-125-62773","DriverID":19,"Latitude":33.2986656,"Longitude":-111.2895709,"Status":"Delivered"}],"DeliveredWhen":"2016-01-08T07:20:00","ReceivedBy":"Parsa Reuser"}', 61723, 64376, 19, '2016-01-08 07:20:00.0000000', 12084), (NULL, 'Unit 20, 1253 Rahimi Lane', '2016-01-08 07:00:00.0000000', 'Krishnam Allu', 3200, 0, 1, 3, NULL, 3, NULL, 1000, 1000, NULL, 15, 0, 3200, '2016-01-07', NULL, '{"Events": [{ "Event":"Ready for collection","EventTime":"2016-01-07T12:00:00","ConNote":"EAN-125-62772"},{ "Event":"DeliveryAttempt","EventTime":"2016-01-08T07:15:00","ConNote":"EAN-125-62772","DriverID":19,"Latitude":36.4970385,"Longitude":-99.9866880,"Status":"Delivered"}],"DeliveredWhen":"2016-01-08T07:15:00","ReceivedBy":"Krishnam Allu"}', 61722, 64372, 19, '2016-01-08 07:15:00.0000000', 15165), (NULL, 'Suite 130, 1952 Laramee Street', '2016-05-14 07:00:00.0000000', 'Malati Shenoy', 1305, 0, 1, 3, NULL, 3, NULL, 1, 153, NULL, 12, 0, 1001, '2016-05-13', NULL, '{"Events": [{ "Event":"Ready for collection","EventTime":"2016-05-13T12:00:00","ConNote":"EAN-125-70400"},{ "Event":"DeliveryAttempt","EventTime":"2016-05-14T07:35:00","ConNote":"EAN-125-70400","DriverID":12,"Latitude":47.5929997,"Longitude":-93.6907581,"Status":"Delivered"}],"DeliveredWhen":"2016-05-14T07:35:00","ReceivedBy":"Malati Shenoy"}', 69350, 72359, 12, '2016-05-14 07:35:00.0000000', 17263);