UPDATE subject_section SET facultyid = (SELECT facultyid FROM ref_subject WHERE subjectid = subject_section.subjectid)