
--DROP VIEW for testing purposes
--DROP VIEW AllTransactionDetails

--CREATE VIEW using INNER Joins
--CREATE VIEW AllTransactionDetails AS
--SELECT  Customers.cust_id
--, Customers.cust_name
--, Customers.cust_city
--, Orders.order_num
--, OrderItems.quantity
--, OrderItems.item_price
--, OrderItems.quantity * OrderItems.item_price AS LIneTotal
--, Products.prod_name
--, RTRIM(Vendors.vend_name) + ' ( ' + RTRIM(Vendors.vend_city) + ')' AS VendorLocation

--FROM Customers INNER JOIN Orders
--	ON Customers.cust_id = Orders.cust_id
--	INNER JOIN OrderItems
--	ON Orders.order_num = OrderItems.order_num
--	INNER JOIN Products
--	ON OrderItems.prod_id = Products.prod_id
--	INNER JOIN Vendors
--	ON Products.vend_id = Vendors.vend_id