select term_name, term_year, to_char(start_date, 'Mon DD YYYY') as start_date, to_char(end_date, 'Mon DD YYYY') as end_date from dotlrn_terms where term_id = :term_id where lower(dotlrn_class_instances_full.pretty_name) like '%'||lower(:keyword)||'%' where 1 = 1