Per customer_id, keep the single row with the maximum loaded_ts (the most recent ingestion). Discard older versions. (The only rows that tie on loaded_ts are exact copies, so any tie-break works.)
Cast loaded_ts to DATE in the output so the column is stable for grading.
Sort by customer_id ascending.