นักเรียนนามสกุล Smithson ใช้รหัสรายวิชาอะไร
What is the code of the course which the student whose last name is Smithson took?
df_student = pd.DataFrame(columns=['stu_num', 'stu_lname']); df_enroll = pd.DataFrame(columns=['class_code', 'stu_num']); df_class = pd.DataFrame(columns=['crs_code', 'class_code'])
df_class.merge(df_enroll.merge(df_student[df_student['stu_lname'] == 'Smithson'], on='stu_num'), on='class_code')['crs_code'].tolist()