-- sample startup data for XMLOrders

SET QUOTED_IDENTIFIER OFF
go

use wroxdb
go

-- employees
INSERT  employees
VALUES  (1,"Fred Brown",2.0)
INSERT  employees
VALUES  (2,"Bill Jackson",1.2)
INSERT  employees
VALUES  (3,"Charlie Watts",0.8)
go

-- payment types
INSERT pmt_types
VALUES('C','Cash')
INSERT pmt_types
VALUES('R','Credit Card')
INSERT pmt_types
VALUES('D','Debit Card')
go

-- products
INSERT products
VALUES(100,"Bright red jacket",123.99, 88.0)
INSERT products
VALUES(101,"Black trousers",36.99, 24.55)
INSERT products
VALUES(201,"Men's trainers",69.50, 48.12)
INSERT products
VALUES(202,"Ladies trainers",65.00, 41.40)
INSERT products
VALUES(301,"Cotton Socks",7.49, 5.30)
go

-- sample order
DECLARE @ord int

INSERT orders (order_date,emp_no,customer,deliver, shipping_charge, adm_rev_no,adm_time)
VALUES ('2001-03-10', 1, 'Mrs Jane Smith', 1, $10, 2, getdate())
SELECT @ord = @@IDENTITY

INSERT lines
VALUES(@ord, 1, 101, 1, 36.99, 24.55, round(36.99*0.02,2))
INSERT lines
VALUES(@ord, 2, 201, 2, 69.5, 48.12, round(69.5*0.02,2))

INSERT payments
VALUES(@ord, 1, 'C', 185.99)

go

