Task: Text to Code
Input (English): Step 1: For each row in Shipments table, find corresponding rows in Invoices table and in Orders table.
Step 2: find customer_id of the results of step 1 with largest value of invoice_date
Output (English): SELECT T2.customer_id FROM Invoices AS T1 JOIN Orders AS T2 JOIN Shipments AS T3 ON T1.invoice_number = T3.invoice_number AND T3.order_id = T2.order_id ORDER BY T1.invoice_date Desc LIMIT 1