I have a problem that I do not know how to solve. I have 3 tables: table1 appointments: Date_ID, date, Patient_ID. Patient table2: name, Patient_ID, Department_ID, department2 table: Apartment_ID, department_name.
I need to get the number of appointments for each department. For example, there is patient "X" which is associated with a department --- > Apartment ID Then he asks for an appointment which is associated with a patient --- > Patient_ID