Good morning.
I tell you that personally I leave the table that returns the desired universe of data; for your case (I assume) is employee ; that is:
/* El "as" no es obligatorio para asignar el alias */
SELECT EP.ID_EMPLEADO, EP.NOMBRE, EP.APELLIDO_PATERNO, EP.APELLIDO_MATERNO FROM EMPLEADO EP;
Now we require the position also; it would be:
/* En alias para los campos si uso el "as" :D */
SELECT EP.ID_EMPLEADO, EP.NOMBRE, EP.APELLIDO_PATERNO, EP.APELLIDO_MATERNO,
PE.NOMBRE AS PUESTO
FROM EMPLEADO EP
INNER JOIN PUESTO_EMPLEADO PE ON PE.id_puesto_empleado = EP.id_puesto;
Now you also require payment and frequency ; it would be:
SELECT EP.ID_EMPLEADO, EP.NOMBRE, EP.APELLIDO_PATERNO, EP.APELLIDO_MATERNO,
PE.NOMBRE AS PUESTO, PAG.SUELDO, PAG.FRECUENCIA_PAGO
FROM EMPLEADO EP
INNER JOIN PUESTO_EMPLEADO PE ON PE.id_puesto_empleado = EP.id_puesto;
INNER JOIN PAGO_EMPLEADO PAG ON PAG.ID_EMPLEADO=EP.ID_EMPLEADO
ORDER BY EP.NOMBRE ASC;
According to the data you share in the illustration of your table scheme and what you want to obtain is what I suggest; considers that the INNER JOIN eliminates the EMPLOYEE records from the result of the query if there is no data recorded in the other tables or at least in one of them (those that are involved) ).
I like to start from the general to the particular with new things, and with practice in mind it is clear what to do with what you see and know should be the result.
Of course you add the WHERE as appropriate and verifying that it is true; see if "active" , "Active" , [...] and "ACTIVE" are the same when comparing in the database
May it be useful to you.