SELECT COUNT(DISTINCT b.id) as count FROM boms b INNER JOIN bom_components bc ON b.id = bc.bom_id INNER JOIN products p ON bc.component_id = p.id LEFT JOIN inventory_levels il ON p.id = il.product_id WHERE COALESCE(il.quantity, 0) < COALESCE(bc.quantity_required * 2, 0)