Task: Text to Code
Input (English): Step 1: For each row in Customer_Events table, find corresponding rows in Customers table and in Residents table.
Step 2: find Customers's customer_id, Customer_Events's date_moved_in, date_moved_out of the results of step 1
Output (English): SELECT T1.customer_id , T3.date_moved_in , T2.date_moved_out FROM Customers AS T1 JOIN Residents AS T2 JOIN Customer_Events AS T3 ON T1.customer_id = T3.customer_id AND T3.date_moved_in = T2.date_moved_in AND T1.customer_id = T3.customer_id