Write SQL query to solve given problem: What is the average duration of trips that ended on a foggy day?. Keep the solution inside sql tag ```sql [SQL-Query] ```
SELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Fog'