Task: Text to Code
Input (English): Step 1: For each row in trip table, find the corresponding rows in weather table.
Step 2: find the average duration in the results of step 1 whose min_visibility_miles greater than 50
Output (English): SELECT Avg ( T1.duration ) FROM trip AS T1 JOIN weather AS T2 WHERE T2.min_visibility_miles > 50