Task: Text to Code
Input (English): Step 1: For each row in Person table, find the corresponding rows in PersonFriend table.
Step 2: find PersonFriend's name of the results of step 1 whose age greater than 40.
Step 3: find the Person's name of Person table for which age less than 30.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output (English): SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.age > 40 INTERSECT SELECT T1.name FROM Person AS T1 WHERE T1.age < 30