Added query logic for returning course codes