get components and team by name, use sub-query instead of knex.raw