------------------------------------------------------------------------
-- John David Ayers ----------------------------------------------------
-- November 5, 2009 ----------------------------------------------------
-- Unions --------------------------------------------------------------
------------------------------------------------------------------------

SELECT CustFirstName + ' ' + CustLastName AS [Full Name],
CustPhoneNumber AS [Phone Number],
CustCity AS [City],
CustState As [State],
'Customer' AS [ID]
FROM Customers
WHERE CustCity = 'Seattle' AND CustState = 'WA'
UNION
SELECT  EmpFirstName + ' ' +EmpLastName,
EmpPhoneNumber,
EmpCity,
EmpState,
'Employee'
FROM Employees
WHERE EmpCity = 'Seattle' AND EmpState = 'WA';

SELECT CustLastName AS [Last Name], CustFirstName AS [First Name]
FROM (((Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID)
INNER JOIN Order_Details on Orders.OrderNumber = Order_Details.OrderNumber)
INNER JOIN Products ON Products.ProductNumber = Order_Details.ProductNumber)
WHERE ProductName LIKE '%helmet%'
UNION
SELECT CustLastName, CustFirstName
FROM (((Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID)
INNER JOIN Order_Details on Orders.OrderNumber = Order_Details.OrderNumber)
INNER JOIN Products ON Products.ProductNumber = Order_Details.ProductNumber)
WHERE ProductName LIKE '%Bike';
