My first post here and I am desperate. Need this to complete the last 2 questions of my assignment.
SELECT "Employee" AS PersonType,
EmployeeFirstName AS FirstName,
EmployeeLastName AS LastName,
CityName
FROM employee, cities
WHERE CityName IN (SELECT CityName WHERE employee.CityID = cities.CityID)
UNION
SELECT "Guest" AS PersonType,
GuestFirstName AS FirstName,
GuestLastName AS LastName,
CityName
FROM guest, cities
WHERE CityName IN (SELECT CityName WHERE guest.CityID = cities.CityID);
This is the code I wrote and it is outputting almost what I need. The problem in the assignment wants to display Employees or Guests that are from Winnipeg or London. My code gives me all the cities for each employee and guest. I know I need to filter for Winnipeg and London with something like WHERE CityName IN ('London','Winnipeg') But I don't know where it needs to go.
I also need to add that I cannot use JOIN or AND operators.
I know it might all sound confusing that is because it is to me so explaining my problem is not that simple. Thank you for the help.