What are the advantages and disadvantages of using multiple JOIN statements with aliases in a complex database query in PHP?

When using multiple JOIN statements with aliases in a complex database query in PHP, the advantages include improved readability and organization of the query, as well as the ability to join multiple tables efficiently. However, the disadvantages include potential performance issues if the query is not optimized properly, as well as the increased complexity that may make it harder to debug and maintain the code.

$query = "
SELECT 
    orders.order_id, 
    customers.customer_name, 
    products.product_name
FROM 
    orders
JOIN 
    customers ON orders.customer_id = customers.customer_id
JOIN 
    order_details ON orders.order_id = order_details.order_id
JOIN 
    products ON order_details.product_id = products.product_id
WHERE 
    orders.order_date >= '2022-01-01'
";