Â©Â Frank M. KromannÂ 2018Frank M.Â KromannBeginning PHP and MySQLhttps://doi.org/10.1007/978-1-4302-6044-8_31
simplistic data-driven applications rely on queries involving several tables. For instance, suppose you were charged with creating a human resources application and wanted to create an interface that displays each employeeâs name, e-mail address, total number of absences, and bonuses. The query might look like this:
SELECT emp.employee_id, emp.firstname, emp.lastname, emp.email,
Â Â Â Â Â Â Â COUNT(att.absence) AS absences, COUNT(att.vacation) AS vacation,
Â Â Â Â Â Â Â SUM(comp.bonus) AS bonus
FROM employees emp, attendance att, compensation comp
WHERE emp.employee_id ...