SELECT Employee.username, Employee.first_name, Employee.last_name, Department.name, LocationBuilding.name, PhoneNumbers.phone_id, PhoneNumbers.fax_flag, PhoneNumbers.exchange, P.position, OrgChart.supervisor_id FROM P INNER JOIN OrgChart ON(P.employee_id=OrgChart.employee_id) INNER JOIN Employee ON(OrgChart.employee_id=Employee.employee_id) INNER JOIN PhoneNumbers ON(Employee.employee_id=PhoneNumbers.employee_id) INNER JOIN Department ON(OrgChart.department_id=Department.department_id) INNER JOIN LocationBuilding ON(Department.building_id=LocationBuilding.building_id) INNER JOIN Location ON(LocationBuilding.building_id=Location.building_id) INNER JOIN LocationRooms ON(Location.room_id=LocationRooms.room_id);" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > Employee.csv