Task: Text to Code
Input (English): Step 1: For each row in Has_Pet table, find corresponding rows in Student table and in Pets table.
Step 2: find Major, Age of the results of step 1 whose weight less than or equals cat
Output (English): SELECT T1.Major , T1.Age FROM Student AS T1 JOIN Has_Pet AS T2 ON T1.StuID = T2.StuID JOIN Pets AS T3 ON T2.PetID = T3.PetID WHERE T3.weight < = "cat"