<reponame>jehboyes/planning_system
def definition():
    """
    Lists the components belonging to a component group.
    """
    sql = """
SELECT c.component_id, c.description, cgc.cgroup_id, cal.long_description as cal_name, 
	ISNULL(cs.description, '1 staff') as staffing_band_description
FROM c_component c 
LEFT JOIN c_cgroup_config cgc on cgc.component_id = c.component_id 
LEFT JOIN c_calendar cal on cal.calendar_type = c.calendar_type
LEFT OUTER JOIN c_component_staffing cs ON cs.band_id = c.staffing_band"""
    return sql
