Task: Text to Code
Input (English): Step 1: For each row in files table, find the corresponding rows in song table.
Step 2: find the average duration in the results of step 1 whose resolution less than 800
Output (English): SELECT Avg ( T1.duration ) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800