/* create Orders table into the database */ CREATE TABLE Orders ( OrderId INTEGER NOT NULL, CustomerId INTEGER NOT NULL, TotalCost DOUBLE, PRIMARY KEY (OrderId) ); /* create the table storing details of an order */ CREATE TABLE OrderDetails ( OrderId INTEGER NOT NULL, ProductId INTEGER NOT NULL, Quatity INT NOT NULL ); /* insert example orders */ INSERT INTO Orders ( OrderId, CustomerId, TotalCost ) VALUES ( 1, 1 /* Maria Anders */, 3800 /* = 2 * 1000 + 1800 */ ); INSERT INTO OrderDetails ( OrderId, ProductId, Quatity ) VALUES ( 1 /* previous order */, 1 /* HP Desktop */, 2 /* quatity */ ); INSERT INTO OrderDetails ( OrderId, ProductId, Quatity ) VALUES ( 1 /* previous order */, 2 /* Sony Laptop */, 1 /* quatity */ );